diff --git a/CHANGELOG.md b/CHANGELOG.md index 30979d0f987..447935f4a91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,93 +1,64 @@ ## 1.10.0 (Upcoming) ### NOTES: -This release contains breaking changes for practitioner relying on plugins - previously bundled into Packer. As specified in the [Bundled Plugins Removal announcement](https://www.hashicorp.com/blog/announcing-the-removal-of-bundled-plugins-in-hashicorp-packer) - HashiCorp maintained plugins will no longer be shipped with Packer. - Users are encouraged to use `packer init` or `packer plugins [...]` when managing required plugins - needed for executing their builds. - [GH-12660](https://github.com/hashicorp/packer/pull/12660) +This release contains breaking changes for those users who may be relying on plugins previously bundled into Packer. +As specified in the [Bundled Plugins Removal announcement](https://www.hashicorp.com/blog/announcing-the-removal-of-bundled-plugins-in-hashicorp-packer) HashiCorp maintained plugins +will no longer be shipped with Packer. Users are encouraged to use `packer init` or `packer plugins [...]` for managing required plugins needed for executing their +builds. [GH-12660](https://github.com/hashicorp/packer/pull/12660) The affected plugins include: -* [packer-plugin-amazon](https://github.com/hashicorp/packer-plugin-amazon) -* [packer-plugin-ansible](https://github.com/hashicorp/packer-plugin-ansible) -* [packer-plugin-azure](https://github.com/hashicorp/packer-plugin-azure) -* [packer-plugin-docker](https://github.com/hashicorp/packer-plugin-docker) -* [packer-plugin-googlecompute](https://github.com/hashicorp/packer-plugin-googlecompute) -* [packer-plugin-qemu](https://github.com/hashicorp/packer-plugin-qemu) -* [packer-plugin-vagrant](https://github.com/hashicorp/packer-plugin-vagrant) -* [packer-plugin-virtualbox](https://github.com/hashicorp/packer-plugin-virtualbox) -* [packer-plugin-vmware](https://github.com/hashicorp/packer-plugin-vmware) -* [packer-plugin-vsphere](https://github.com/hashicorp/packer-plugin-vsphere) +* packer-plugin-amazon +* packer-plugin-ansible +* packer-plugin-azure +* packer-plugin-docker +* packer-plugin-googlcompute +* packer-plugin-qemu +* packer-plugin-vagrant +* packer-plugin-virtualbox +* packer-plugin-vmware +* packer-plugin-vsphere ### SECURITY: -* Bump github.com/go-jose/go-jose/v3 to address GO-2023-2334. There have been - no reported issues with Packer but we are bumping given that it is a - secondary - dependency. [GH-12723](https://github.com/hashicorp/packer/pull/12723) -* Bump Go to 1.20.10 to Address CVE-2023-44487 / CVE-2023-39325. - [GH-12661](https://github.com/hashicorp/packer/pull/12661) * Bump Go to 1.20.11 CVE-2023-45283. There have been no reported issues with Packer but we are bumping given its usage of the path/filepath pkg. [GH-12690](https://github.com/hashicorp/packer/pull/12690) -* Bump Packer Plugin SDK to v0.5.2. - [GH-12717](https://github.com/hashicorp/packer/pull/12717) +* Bump Go to 1.20.10 to Address CVE-2023-44487 / CVE-2023-39325. + [GH-12661](https://github.com/hashicorp/packer/pull/12661) ### PLUGINS: * Removed all HashiCorp vendored plugins from being bundled into the Packer binary. -[GH-12660](https://github.com/hashicorp/packer/pull/12660), [GH-12720](https://github.com/hashicorp/packer/pull/12720) +[GH-12660](https://github.com/hashicorp/packer/pull/12660) * packer-plugin-hcloud: The Hetzner Cloud plugin has been handed over to the Hetzner integrations team. New releases for this plugin are available at https://github.com/hetznercloud/packer-plugin-hcloud. Existing references to the plugin will continue to work but users are advised to update the `required_plugins` block to use the new plugin source address. ``` - required_plugins { + required_plugins { parallels = { source = "github.com/hetznercloud/hcloud" version = "~> 1" - } + } } ``` + ### IMPROVEMENTS: -* cmd/init: Warn users running `packer init` on configuration templates with a +* cmd/init: warn users running `packer init` on configuration templates with a missing `required_plugins` blocks. [GH-12638](https://github.com/hashicorp/packer/pull/12638) -* cmd/plugins: Install SHA256SUM file with 0644 perms. +* cmd/plugins: install SHA256SUM file with 0644 perms. [GH-12665](https://github.com/hashicorp/packer/pull/12665) -* cmd/plugins: Remove SHA256SUM file on plugin removal. +* cmd/plugins: remove SHA256SUM file on plugin removal. [GH-12666](https://github.com/hashicorp/packer/pull/12666) -* cmd/plugins: Remove will error if it fails to find the plugin being selected +* cmd/plugins: remove will error if it fails to find the plugin being selected for removal. [GH-12669](https://github.com/hashicorp/packer/pull/12669) -* core/hcl2: Remove empty source file reference on unset variable errors. - [GH-12712](https://github.com/hashicorp/packer/pull/12712) -* core/hcl: Improve the recursive execution of data sources with other +* core/hcl: rework to remove the recursive execution of data sources with other data source dependencies. [GH-12608](https://github.com/hashicorp/packer/pull/12608) -* core: Bump github.com/hashicorp/hcp-sdk-go from 0.73.0 to 0.74.0 - - [GH-12704](https://github.com/hashicorp/packer/pull/12704) -* core: Bump Packer Plugin SDK to v0.5.2. - [GH-12717](https://github.com/hashicorp/packer/pull/12717) -* core: Provide integration link as hint in error message if a plugin component - is unknown. [GH-12705](https://github.com/hashicorp/packer/pull/12705) * core: Update version output for `packer -v` and `packer --version` to match `packer version`. [GH-12569](https://github.com/hashicorp/packer/pull/12569) -* docs: Update plugin installation guides with supported methods for 1.10.0 and - above. [GH-12713](https://github.com/hashicorp/packer/pull/12713) - -## 1.9.5 (December 4, 2023) - -### SECURITY - -* Bump github.com/go-jose/go-jose/v3 to address GO-2023-2334. - [GH-12723](https://github.com/hashicorp/packer/pull/12723) - -### BUG FIXES: - -* Add VirtualBox as known plugin prefix to prevent endless bundled plugin warning. - [GH-12719](https://github.com/hashicorp/packer/pull/12719) ## 1.9.4 (August 18, 2023) diff --git a/CODEOWNERS b/CODEOWNERS index b92152c7348..0efb6b1ac47 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,3 +2,5 @@ # release configuration +/.release/ @hashicorp/release-engineering +/.github/workflows/build.yml @hashicorp/release-engineering diff --git a/LICENSE b/LICENSE index 0918b4a93f4..f7d6cdd08cf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,33 +1,32 @@ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. -"Business Source License" is a trademark of MariaDB Corporation Ab. +“Business Source License” is a trademark of MariaDB Corporation Ab. Parameters Licensor: HashiCorp, Inc. -Licensed Work: Packer Version 1.10.0 or later. The Licensed Work is (c) 2023 - HashiCorp, Inc. +Licensed Work: Packer 1.10.0. The Licensed Work is (c) 2023 HashiCorp, Inc. Additional Use Grant: You may make production use of the Licensed Work, provided Your use does not include offering the Licensed Work to third parties on a hosted or embedded basis in order to compete with - HashiCorp's paid version(s) of the Licensed Work. For purposes + HashiCorp’s paid version(s) of the Licensed Work. For purposes of this license: - A "competitive offering" is a Product that is offered to third + A “competitive offering” is a Product that is offered to third parties on a paid basis, including through paid support arrangements, that significantly overlaps with the capabilities - of HashiCorp's paid version(s) of the Licensed Work. If Your + of HashiCorp’s paid version(s) of the Licensed Work. If Your Product is not a competitive offering when You first make it generally available, it will not become a competitive offering later due to HashiCorp releasing a new version of the Licensed Work with additional capabilities. In addition, Products that are not provided on a paid basis are not competitive. - "Product" means software that is offered to end users to manage + “Product” means software that is offered to end users to manage in their own environments or offered as a service on a hosted basis. - "Embedded" means including the source code or executable code - from the Licensed Work in a competitive offering. "Embedded" + “Embedded” means including the source code or executable code + from the Licensed Work in a competitive offering. “Embedded” also means packaging the competitive offering in such a way that the Licensed Work must be accessed or downloaded for the competitive offering to operate. @@ -86,7 +85,7 @@ Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index 29b34da1c04..d6f52ebcc22 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -177,7 +177,7 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL continue } - res.InsertSortedUniq(&Installation{ + res = append(res, &Installation{ BinaryPath: path, Version: pluginVersionStr, }) @@ -206,22 +206,6 @@ func (l InstallList) String() string { return v.String() } -// InsertSortedUniq inserts the installation in the right spot in the list by -// comparing the version lexicographically. -// A Duplicate version will replace any already present version. -func (l *InstallList) InsertSortedUniq(install *Installation) { - pos := sort.Search(len(*l), func(i int) bool { return (*l)[i].Version >= install.Version }) - if len(*l) > pos && (*l)[pos].Version == install.Version { - // already detected, let's ignore any new foundings, this way any plugin - // close to cwd or the packer exec takes precedence; this will be better - // for plugin development/tests. - return - } - (*l) = append((*l), nil) - copy((*l)[pos+1:], (*l)[pos:]) - (*l)[pos] = install -} - // Installation describes a plugin installation type Installation struct { // path to where binary is installed, if installed. diff --git a/packer/plugin-getter/plugins_test.go b/packer/plugin-getter/plugins_test.go index 513f2c4993b..e13f8cb3825 100644 --- a/packer/plugin-getter/plugins_test.go +++ b/packer/plugin-getter/plugins_test.go @@ -27,6 +27,8 @@ var ( pluginFolderTwo = filepath.Join("testdata", "plugins_2") + pluginFolderThree = filepath.Join("testdata", "plugins_3") + pluginFolderWrongChecksums = filepath.Join("testdata", "wrong_checksums") ) @@ -106,8 +108,8 @@ func TestPlugin_ListInstallations(t *testing.T) { BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_windows_amd64.exe"), }, { - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), Version: "v4.5.6", + BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), }, { Version: "v4.5.7", @@ -117,10 +119,22 @@ func TestPlugin_ListInstallations(t *testing.T) { Version: "v4.5.8", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.8_x5.0_windows_amd64.exe"), }, + { + Version: "v4.5.6", + BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), + }, { Version: "v4.5.9", BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), }, + { + Version: "v4.5.6", + BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp copy", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), + }, + { + Version: "v4.5.9", + BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp copy", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), + }, }, }, @@ -188,6 +202,10 @@ func TestPlugin_ListInstallations(t *testing.T) { Version: "v1.2.3", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.0_darwin_amd64"), }, + { + Version: "v1.2.3", + BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.1_darwin_amd64"), + }, { Version: "v1.2.4", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.4_x5.0_darwin_amd64"), @@ -276,12 +294,48 @@ func TestPlugin_ListInstallations(t *testing.T) { Version: "v4.5.8", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.8_x5.0_windows_amd64.exe"), }, + { + Version: "v4.5.6", + BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), + }, { Version: "v4.5.9", BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), }, }, }, + { + "test nil identifier - multiple plugins with same version", + fields{ + Identifier: "", + }, + ListInstallationsOptions{ + []string{ + pluginFolderThree, + }, + BinaryInstallationOptions{ + APIVersionMajor: "5", APIVersionMinor: "0", + OS: "linux", ARCH: "amd64", + Checksummers: []Checksummer{ + { + Type: "sha256", + Hash: sha256.New(), + }, + }, + }, + }, + false, + []*Installation{ + { + Version: "v1.2.5", + BinaryPath: filepath.Join(pluginFolderThree, "github.com", "hashicorp", "alazon", "packer-plugin-alazon_v1.2.5_x5.0_linux_amd64"), + }, + { + Version: "v1.2.5", + BinaryPath: filepath.Join(pluginFolderThree, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_linux_amd64"), + }, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 new file mode 100644 index 00000000000..7813681f5b4 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM new file mode 100644 index 00000000000..2ef9d7d4c35 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM @@ -0,0 +1 @@ +ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 new file mode 100644 index 00000000000..7813681f5b4 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM new file mode 100644 index 00000000000..2ef9d7d4c35 --- /dev/null +++ b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM @@ -0,0 +1 @@ +ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d \ No newline at end of file diff --git a/version/VERSION b/version/VERSION index 169f19b4901..81c871de46b 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -1.11.0 \ No newline at end of file +1.10.0 diff --git a/version/version.go b/version/version.go index a7eec6fd4bc..2df08d2d71b 100644 --- a/version/version.go +++ b/version/version.go @@ -22,7 +22,7 @@ var ( // A pre-release marker for the version can also be specified (e.g -dev). If this is omitted // The main version number that is being run at the moment. - Version = "1.11.0" + Version = "1.10.0" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release diff --git a/website/data/plugins-manifest.json b/website/data/plugins-manifest.json index 5a3c0034ad6..525d5ede175 100644 --- a/website/data/plugins-manifest.json +++ b/website/data/plugins-manifest.json @@ -22,13 +22,6 @@ "version": "latest", "sourceBranch": "main" }, - { - "title": "Git", - "path": "git", - "repo": "ethanmdavidson/packer-plugin-git", - "version": "latest", - "sourceBranch": "main" - }, { "title": "Gridscale", "path": "gridscale", @@ -52,14 +45,6 @@ "pluginTier": "community", "version": "latest" }, - { - "title": "Linode", - "path": "linode", - "repo": "linode/packer-plugin-linode", - "pluginTier": "verified", - "version": "latest", - "isHcpPackerReady": true - }, { "title": "Libvirt", "path": "libvirt", @@ -90,13 +75,6 @@ "pluginTier": "verified", "isHcpPackerReady": true }, - { - "title": "Parallels", - "path": "parallels", - "repo": "parallels/packer-plugin-parallels", - "version": "latest", - "pluginTier": "verified" - }, { "title": "Scaleway", "path": "scaleway", @@ -104,20 +82,6 @@ "pluginTier": "verified", "version": "latest" }, - { - "title": "SSH Key", - "path": "sshkey", - "repo": "ivoronin/packer-plugin-sshkey", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Tart", - "path": "tart", - "repo": "cirruslabs/packer-plugin-tart", - "pluginTier": "community", - "version": "latest" - }, { "title": "UCloud", "path": "ucloud",