Skip to content

Commit

Permalink
backport of commit 99578b7
Browse files Browse the repository at this point in the history
  • Loading branch information
nywilken committed Dec 5, 2023
1 parent 97e2e9e commit fa17f08
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 120 deletions.
79 changes: 25 additions & 54 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

# release configuration

/.release/ @hashicorp/release-engineering
/.github/workflows/build.yml @hashicorp/release-engineering
19 changes: 9 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
HashiCorps 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 HashiCorps 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.
Expand Down Expand Up @@ -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.
18 changes: 1 addition & 17 deletions packer/plugin-getter/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL
continue
}

res.InsertSortedUniq(&Installation{
res = append(res, &Installation{
BinaryPath: path,
Version: pluginVersionStr,
})
Expand Down Expand Up @@ -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.
Expand Down
56 changes: 55 additions & 1 deletion packer/plugin-getter/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ var (

pluginFolderTwo = filepath.Join("testdata", "plugins_2")

pluginFolderThree = filepath.Join("testdata", "plugins_3")

pluginFolderWrongChecksums = filepath.Join("testdata", "wrong_checksums")
)

Expand Down Expand Up @@ -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",
Expand All @@ -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"),
},
},
},

Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d
2 changes: 1 addition & 1 deletion version/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0
1.10.0
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 0 additions & 36 deletions website/data/plugins-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -90,34 +75,13 @@
"pluginTier": "verified",
"isHcpPackerReady": true
},
{
"title": "Parallels",
"path": "parallels",
"repo": "parallels/packer-plugin-parallels",
"version": "latest",
"pluginTier": "verified"
},
{
"title": "Scaleway",
"path": "scaleway",
"repo": "scaleway/packer-plugin-scaleway",
"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",
Expand Down

0 comments on commit fa17f08

Please sign in to comment.