From 35c579a9f689e00134e305f61d2d23e6069b3625 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 30 May 2023 14:15:24 -0400 Subject: [PATCH 01/92] CHANGELOG: update for 1.9.0 release --- CHANGELOG.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83f1f035501..4c56a2d840e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ -## 1.9.0 (Unreleased) +## 1.9.0 (May 31, 2023) ### NOTES: + * **Breaking Change**: Iteration fingerprints used to be computed from the Git SHA of the repository where the template is located when running packer build. This changes with this release, and now fingerprints are automatically generated @@ -12,13 +13,40 @@ these builds will work exactly as they did before. [GH-12172](https://github.com/hashicorp/packer/pull/12172) +* **Breaking Change**: Community-maintained plugins bundled with the Packer binary have been removed. + These external plugin components are released independently of Packer core and can be installed + directly by the user. Users relying on the external plugin components listed below should refer + to the `packer plugins` sub-command and, if using HCL2, a `required_plugins` block to define a + list of plugins for building a template. + ### PLUGINS + * Remove provisioner plugins for Chef, Converge, Puppet, Salt, and Inspec as vendored plugins. These plugins have been previously archived and not updated in release since being archived. These plugins can be installed using `packer init` or with the Packer plugins sub-command `packer plugins install github.com/hashicorp/chef`. [GH-12374](https://github.com/hashicorp/packer/pull/12374) +* The following community plugins won't be bundled with Packer anymore: + + * [Alicloud](https://github.com/hashicorp/packer-plugin-alicloud) + * [CloudStack](https://github.com/hashicorp/packer-plugin-cloudstack) + * [HCloud](https://github.com/hashicorp/packer-plugin-hcloud) + * [HyperOne](https://github.com/hashicorp/packer-plugin-hyperone) + * [Hyper-V](https://github.com/hashicorp/packer-plugin-hyperv) + * [JDCloud](https://github.com/hashicorp/packer-plugin-jdcloud) + * [LXC](https://github.com/hashicorp/packer-plugin-lxc) + * [LXD](https://github.com/hashicorp/packer-plugin-lxd) + * [NCloud](https://github.com/hashicorp/packer-plugin-ncloud) + * [OpenStack](https://github.com/hashicorp/packer-plugin-openstack) + * [Proxmox](https://github.com/hashicorp/packer-plugin-proxmox) + * [TencentCloud](https://github.com/hashicorp/packer-plugin-tencentcloud) + * [Triton](https://github.com/hashicorp/packer-plugin-triton) + * [Yandex](https://github.com/hashicorp/packer-plugin-yandex) + +Users relying on these external plugin components should refer to the `packer plugins` sub-command and, +if using HCL2, a `required_plugins` block to define a list of plugins to use for building a template. + ### IMPROVEMENTS: * core/hcp: Now, fingerprints used by HCP Packer are randomly generated ULIDs @@ -26,6 +54,14 @@ already specified in the environment. [GH-12172](https://github.com/hashicorp/packer/pull/12172) +### BUG FIXES: + +* Fix LDFLAGS for release pipelines: Between Packer 1.8.5 and Packer 1.8.7, changes + to the LDFLAGS in use for building the binaries for Packer had mistakenly + removed some compilation flags, leading to the final binaries not being stripped. + This change raised the size of the built binaries by as much as 45%. + In this release, we fixed the LDFLAGS during compilation, yielding leaner binaries. + ## 1.8.7 (May 4, 2023) ### NOTES: From f730bd640fe650327168e4e5d3574e0d4e57bde8 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 31 May 2023 11:45:50 -0400 Subject: [PATCH 02/92] changelog: update for release 1.9.0 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c56a2d840e..b03563e5c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,8 @@ * [Triton](https://github.com/hashicorp/packer-plugin-triton) * [Yandex](https://github.com/hashicorp/packer-plugin-yandex) + [GH-12436](https://github.com/hashicorp/packer/pull/12436) + Users relying on these external plugin components should refer to the `packer plugins` sub-command and, if using HCL2, a `required_plugins` block to define a list of plugins to use for building a template. @@ -51,7 +53,7 @@ if using HCL2, a `required_plugins` block to define a list of plugins to use for * core/hcp: Now, fingerprints used by HCP Packer are randomly generated ULIDs instead of a Git SHA, and a new one is always generated, unless one is - already specified in the environment. + specified in the environment. [GH-12172](https://github.com/hashicorp/packer/pull/12172) ### BUG FIXES: @@ -62,6 +64,9 @@ if using HCL2, a `required_plugins` block to define a list of plugins to use for This change raised the size of the built binaries by as much as 45%. In this release, we fixed the LDFLAGS during compilation, yielding leaner binaries. +* Bumped gopsutil to v3. This fixes a macOS intermittent crash reported by the community + [GH-12430](https://github.com/hashicorp/packer/issues/12430) + ## 1.8.7 (May 4, 2023) ### NOTES: From ac29a1366b16096abd738baf26937f5cd489ce46 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 31 May 2023 11:50:56 -0400 Subject: [PATCH 03/92] version: prepare for 1.10.0 releases --- version/VERSION | 2 +- version/version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/version/VERSION b/version/VERSION index f8e233b2733..81c871de46b 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -1.9.0 +1.10.0 diff --git a/version/version.go b/version/version.go index e389cebd2e7..c474c80d650 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.9.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 From 3f4e49e8477f14668046bf2c95db8b7051fcd2f3 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 31 May 2023 16:50:03 -0400 Subject: [PATCH 04/92] CHANGELOG: add advisory on multiproject support On HCP, multiproject support was GA'd recently, but Packer does not support the feature yet. To avoid clients being surprised if they encounter an error with this feature enabled, we add an advisory related to this feature not being supported for now, but planned for later. --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b03563e5c40..80cfffdc52c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,15 @@ if using HCL2, a `required_plugins` block to define a list of plugins to use for * Bumped gopsutil to v3. This fixes a macOS intermittent crash reported by the community [GH-12430](https://github.com/hashicorp/packer/issues/12430) +### HCP Packer -- Multi project support advisory + +If using HCP Packer to store metadata on your builds, please be aware that Packer +does not support this feature yet, and as such, having multiple projects in your +organization will make it impossible to use HCP Packer in this release. + +We are actively working on supporting this feature, which will be available in a +subsequent release. + ## 1.8.7 (May 4, 2023) ### NOTES: From 925cb5e5411d670af9f9e729b8a61daeb4f8b62d Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 1 Jun 2023 11:55:05 -0400 Subject: [PATCH 05/92] hcp: support HCP_PROJECT_ID environment variable With HCP supporting multi-projects now, Packer needs to take it into account when picking a project from an organisation. This commit adds two cases: 1. multiple projects are defined, none is supplied through HCP_PROJECT_ID: in this case we will default to the oldest project defined for the organisation. 2. we supply HCP_PROJECT_ID: in this case, we pick the project with the corresponding ID, and use it for publishing metadata. --- internal/hcp/api/client.go | 55 +++++++++- internal/hcp/api/client_test.go | 163 +++++++++++++++++++++++++++++ internal/hcp/env/env.go | 4 + internal/hcp/env/variables.go | 1 + website/content/docs/hcp/index.mdx | 2 + 5 files changed, 222 insertions(+), 3 deletions(-) create mode 100644 internal/hcp/api/client_test.go diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index a379af61b6f..21a07156cc2 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -6,10 +6,14 @@ package api import ( "fmt" + "log" + "os" + "time" packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" organizationSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/organization_service" projectSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" rmmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" "github.com/hashicorp/hcp-sdk-go/httpclient" "github.com/hashicorp/packer/internal/hcp/env" @@ -97,9 +101,54 @@ func (c *Client) loadProjectID() error { if err != nil { return fmt.Errorf("unable to fetch project id: %v", err) } - if len(listProjResp.Payload.Projects) > 1 { - return fmt.Errorf("this version of Packer does not support multiple projects") + + if env.HasProjectID() { + proj, err := findProjectByID(os.Getenv(env.HCPProjectID), listProjResp.Payload.Projects) + if err != nil { + return err + } + + c.ProjectID = proj.ID + } else { + if len(listProjResp.Payload.Projects) > 1 { + log.Printf("[WARNING] Multiple HCP projects found, will pick the oldest one by default\n" + + "To specify which project to use, set the HCP_PROJECT_ID environment variable to the one you want to use.") + } + + proj, err := findOldestProject(listProjResp.Payload.Projects) + if err != nil { + return err + } + + c.ProjectID = proj.ID } - c.ProjectID = listProjResp.Payload.Projects[0].ID + return nil } + +func findOldestProject(projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { + if len(projs) == 0 { + return nil, fmt.Errorf("no project found") + } + + proj := projs[0] + for i := 1; i < len(projs); i++ { + nxtProj := projs[i] + + if time.Time(nxtProj.CreatedAt).Before(time.Time(proj.CreatedAt)) { + proj = nxtProj + } + } + + return proj, nil +} + +func findProjectByID(projID string, projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { + for _, proj := range projs { + if proj.ID == projID { + return proj, nil + } + } + + return nil, fmt.Errorf("No project %q found", projID) +} diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go new file mode 100644 index 00000000000..47ff2b5fd98 --- /dev/null +++ b/internal/hcp/api/client_test.go @@ -0,0 +1,163 @@ +package api + +import ( + "testing" + "time" + + "github.com/go-openapi/strfmt" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" +) + +func TestFindProjectID(t *testing.T) { + testcases := []struct { + Name string + ProjectID string + ProjectList []*models.HashicorpCloudResourcemanagerProject + ExpectProjectID string + ExpectErr bool + }{ + { + "Only one project, project exists, success", + "test-project-exists", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-project-exists", + }, + }, + "test-project-exists", + false, + }, + { + "Multiple projects, project exists, success", + "test-project-exists", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "other-project-exists", + }, + { + ID: "test-project-exists", + }, + }, + "test-project-exists", + false, + }, + { + "One project, no id match, fail", + "test-project-exists", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "other-project-exists", + }, + }, + "", + true, + }, + { + "Multiple projects, no id match, fail", + "test-project-exists", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "other-project-exists", + }, + { + ID: "yet-another-project-exists", + }, + }, + "", + true, + }, + { + "No projects, no id match, fail", + "test-project-exists", + []*models.HashicorpCloudResourcemanagerProject{}, + "", + true, + }, + } + + for _, tt := range testcases { + t.Run(tt.Name, func(t *testing.T) { + proj, err := findProjectByID(tt.ProjectID, tt.ProjectList) + if (err != nil) != tt.ExpectErr { + t.Errorf("test findProjectByID, expected %t, got %t", + tt.ExpectErr, + err != nil) + } + + if proj != nil && proj.ID != tt.ExpectProjectID { + t.Errorf("expected to select project %q, got %q", tt.ExpectProjectID, proj.ID) + } + }) + } +} + +func TestFindOldestProject(t *testing.T) { + testcases := []struct { + Name string + ProjectList []*models.HashicorpCloudResourcemanagerProject + ExpectProjectID string + ExpectErr bool + }{ + { + "Only one project, project exists, success", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-project-exists", + }, + }, + "test-project-exists", + false, + }, + { + "Multiple projects, pick the oldest", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-project-exists", + CreatedAt: strfmt.DateTime(time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + { + ID: "test-oldest-project", + CreatedAt: strfmt.DateTime(time.Date(2022, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + }, + "test-oldest-project", + false, + }, + { + "Multiple projects, different order, pick the oldest", + []*models.HashicorpCloudResourcemanagerProject{ + { + ID: "test-oldest-project", + CreatedAt: strfmt.DateTime(time.Date(2022, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + { + ID: "test-project-exists", + CreatedAt: strfmt.DateTime(time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC)), + }, + }, + "test-oldest-project", + false, + }, + { + "No projects, should error", + []*models.HashicorpCloudResourcemanagerProject{}, + "", + true, + }, + } + + for _, tt := range testcases { + t.Run(tt.Name, func(t *testing.T) { + proj, err := findOldestProject(tt.ProjectList) + if (err != nil) != tt.ExpectErr { + t.Errorf("test findProjectByID, expected %t, got %t", + tt.ExpectErr, + err != nil) + } + + if proj != nil && proj.ID != tt.ExpectProjectID { + t.Errorf("expected to select project %q, got %q", tt.ExpectProjectID, proj.ID) + } + }) + } +} diff --git a/internal/hcp/env/env.go b/internal/hcp/env/env.go index c07d9cac478..0cf459015e8 100644 --- a/internal/hcp/env/env.go +++ b/internal/hcp/env/env.go @@ -9,6 +9,10 @@ import ( "strings" ) +func HasProjectID() bool { + return hasEnvVar(HCPProjectID) +} + func HasClientID() bool { return hasEnvVar(HCPClientID) } diff --git a/internal/hcp/env/variables.go b/internal/hcp/env/variables.go index 0fc654494b6..71258c13be3 100644 --- a/internal/hcp/env/variables.go +++ b/internal/hcp/env/variables.go @@ -6,6 +6,7 @@ package env const ( HCPClientID = "HCP_CLIENT_ID" HCPClientSecret = "HCP_CLIENT_SECRET" + HCPProjectID = "HCP_PROJECT_ID" HCPPackerRegistry = "HCP_PACKER_REGISTRY" HCPPackerBucket = "HCP_PACKER_BUCKET_NAME" HCPPackerBuildFingerprint = "HCP_PACKER_BUILD_FINGERPRINT" diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index de58397e8bf..35f7c2fd425 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -4,6 +4,8 @@ description: | page_title: HCP Packer --- +-> **Note:** On May 16th 2023, HCP introduced multi-project support to the platform. In order to use multiple projects in your organization, you will need to update Packer to version 1.9.1 or above. Starting with 1.9.1, you may specify a project ID to push builds to with the `HCP_PROJECT_ID` environment variable. If no project ID is specified, Packer will pick the project with the oldest creation date. Older versions of Packer are incompatible with multi-project support on HCP, and builds will fail for HCP organizations with multiple projects on versions before 1.9.1. + # HCP Packer The HCP Packer registry bridges the gap between image factories and image deployments, allowing development and security teams to work together to create, manage, and consume images in a centralized way. From 571adf9f1bd1bf251c9f0e704104734ffa6df04c Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 1 Jun 2023 14:48:07 -0400 Subject: [PATCH 06/92] CHANGELOG: add changelog for v1.9.1 --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80cfffdc52c..ab8a2b2abef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 1.9.0 (June 1, 2023) + +### BUG FIXES: + +* On May 16th 2023, HCP introduced multi-project support to the platform. + In order to use multiple projects in your organization, you will need to update Packer + to version 1.9.1 or above. Starting with 1.9.1, you may specify a project ID to push + builds to with the `HCP_PROJECT_ID` environment variable. If no project ID is specified, + Packer will pick the project with the oldest creation date. Older versions of Packer are + incompatible with multi-project support on HCP, and builds will fail for HCP + organizations with multiple projects on versions before 1.9.1. + [GH-12453](https://github.com/hashicorp/packer/pull/12453) + ## 1.9.0 (May 31, 2023) ### NOTES: From 2d5d78a306a2ddbc78d27b525a38f33aa632b33c Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 1 Jun 2023 15:36:20 -0400 Subject: [PATCH 07/92] CHANGELOG: fix latest release version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab8a2b2abef..6107fd2ca1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.9.0 (June 1, 2023) +## 1.9.1 (June 1, 2023) ### BUG FIXES: From 5f038ce8ace0d7c06958cd00644532637bb1b316 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 1 Jun 2023 16:53:37 -0400 Subject: [PATCH 08/92] CHANGELOG: prepare for upcoming v1.9.2 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6107fd2ca1c..d04040aa1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.9.2 (Upcoming) + ## 1.9.1 (June 1, 2023) ### BUG FIXES: From d563a3c6234eef7edca4a28a9fe55458bd7834f6 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 16:05:31 +0000 Subject: [PATCH 09/92] [COMPLIANCE] Add Copyright and License Headers --- internal/hcp/api/client_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go index 47ff2b5fd98..b1cdbff61c2 100644 --- a/internal/hcp/api/client_test.go +++ b/internal/hcp/api/client_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package api import ( From aeffaa790fc054833532d17514dd251403a98f77 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:09:00 -0400 Subject: [PATCH 10/92] docs: add a paragraph on fingerprint generation (#12464) * docs: add a paragraph on fingerprint generation Since version 1.9.0+ changed the way Packer generates fingerprints for HCP Packer, we add a small paragraph to explain how it used to be generated before, and how it changed in this version. * Apply suggestions from code review --------- Co-authored-by: Wilken Rivera --- website/content/docs/hcp/index.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index 35f7c2fd425..b7af158ee26 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -47,6 +47,9 @@ Refer to [`hcp_packer_registry`](/packer/docs/templates/hcl_templates/blocks/bui Packer uses a unique fingerprint for tracking the completion of builds associated to an iteration. By default a fingerprint is automatically generated by Packer during each invocation of `packer build`, unless a fingerprint is manually provided via the `HCP_PACKER_BUILD_FINGERPRINT` environment variable. +In versions before 1.9.0, this fingerprint was computed from the Git SHA of the current HEAD in which your template is stored. If you were running builds using a non Git managed template, you had to set the `HCP_PACKER_BUILD_FINGERPRINT` environment variable prior to invoking `packer build`. +Starting with Packer 1.9.0, fingerprint generation does not rely on Git at all, and instead Packer now generates a Unique Lexicographically sortable Identifier (ULID) as the fingerprint for every `packer build` invocation. + #### Fingerprints and Incomplete Iterations When you build a template with Packer, there's always a chance that it does not succeed because of a network issue, a provisioning failure, or some upstream error. When that happens, Packer will output the generated fingerprint associated with the incomplete iteration so that you can resume building that iteration using the `HCP_PACKER_BUILD_FINGERPRINT` environment variable; an iteration can be resumed until it is marked as complete. This environment variable is necessary for resuming an incomplete iteration, otherwise Packer will create a new iteration for the build. From ffa1e54af5e63c9de550948a43a2d951ad5d324b Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 16 Jun 2023 15:46:53 -0400 Subject: [PATCH 11/92] Delete check-legacy-links-format.yml (#12471) Remove the check-legacy-links-format.yml workflow. These checks are now included as part of our content conformance checks that run on PRs with documentation content changes. --- .github/workflows/check-legacy-links-format.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/check-legacy-links-format.yml diff --git a/.github/workflows/check-legacy-links-format.yml b/.github/workflows/check-legacy-links-format.yml deleted file mode 100644 index 08c128a9f49..00000000000 --- a/.github/workflows/check-legacy-links-format.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Legacy Link Format Checker - -on: - push: - paths: - - "website/content/**/*.mdx" - - "website/data/*-nav-data.json" - -jobs: - check-links: - uses: hashicorp/dev-portal/.github/workflows/docs-content-check-legacy-links-format.yml@475289345d312552b745224b46895f51cc5fc490 - with: - repo-owner: "hashicorp" - repo-name: "packer" - commit-sha: ${{ github.sha }} - mdx-directory: "website/content" - nav-data-directory: "website/data" From f1c1e496857867075469b2abb7f728484208ecb0 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 11 May 2023 16:48:30 -0400 Subject: [PATCH 12/92] Fix executable directory path --- packer/plugin_folders.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packer/plugin_folders.go b/packer/plugin_folders.go index 07e74d19121..99ff3b13a40 100644 --- a/packer/plugin_folders.go +++ b/packer/plugin_folders.go @@ -19,7 +19,7 @@ func PluginFolders(dirs ...string) []string { if path, err := os.Executable(); err != nil { log.Printf("[ERR] Error finding executable: %v", err) } else { - res = append(res, path) + res = append(res, filepath.Dir(path)) } res = append(res, dirs...) From f7a0df4bd189b556bf5321178c17ef47e42471a1 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 11 May 2023 16:50:28 -0400 Subject: [PATCH 13/92] Reduce the number of nest plugin scans Packer will try to discover installed plugins in all of the directories defined by packer.KnowPluginFolders. In a previous release logic was added to scan nested directories in order to load plugins installed by `packer plugins install`. This change resulted in a nested directory scan for each folder within the KnownPluginFolders slice. This change reduces the nested directory scan to only the directories where plugins would have been installed using `packer plugins install` --- packer/plugin.go | 224 +++++++++++++++++++++------------ packer/plugin_discover_test.go | 1 + 2 files changed, 147 insertions(+), 78 deletions(-) diff --git a/packer/plugin.go b/packer/plugin.go index 1b64482a89b..4bd5765f159 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -6,6 +6,7 @@ package packer import ( "crypto/sha256" "encoding/json" + "errors" "fmt" "log" "os" @@ -16,7 +17,6 @@ import ( "strings" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" - "github.com/hashicorp/packer-plugin-sdk/pathing" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" ) @@ -80,50 +80,42 @@ func (c *PluginConfig) Discover() error { return nil } - // TODO: use KnownPluginFolders here. TODO probably after JSON is deprecated - // so that we can keep the current behavior just the way it is. - - // Next, look in the same directory as the executable. - exePath, err := os.Executable() - if err != nil { - log.Printf("[ERR] Error loading exe directory: %s", err) - } else { - if err := c.discoverExternalComponents(filepath.Dir(exePath)); err != nil { - return err - } + if len(c.KnownPluginFolders) == 0 { + return errors.New("no known plugin folders defined") } - // Next, look in the default plugins directory inside the configdir/.packer.d/plugins. - dir, err := pathing.ConfigDir() - if err != nil { - log.Printf("[ERR] Error loading config directory: %s", err) - } else { - if err := c.discoverExternalComponents(filepath.Join(dir, "plugins")); err != nil { + // TODO after JSON is deprecated remove support for legacy component plugins. + for _, knownFolder := range c.KnownPluginFolders { + if err := c.discoverLegacyMonoComponents(knownFolder); err != nil { return err } } - // Next, look in the CWD. - if err := c.discoverExternalComponents("."); err != nil { + // Pick last folder as it's the one with the highest priority + // This is the same logic used when installing plugins via Packer's plugin installation commands. + pluginInstallationPath := c.KnownPluginFolders[len(c.KnownPluginFolders)-1] + if err := c.discoverInstalledComponents(pluginInstallationPath); err != nil { return err } - // Check whether there is a custom Plugin directory defined. This gets - // absolute preference. - if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { - sep := ":" - if runtime.GOOS == "windows" { - // on windows, PATH is semicolon-separated - sep = ";" + // Manually installed plugins take precedence over all. Duplicate plugins installed + // prior to the packer plugins install command should be removed by user to avoid overrides. + for _, knownFolder := range c.KnownPluginFolders { + pluginPaths, err := c.discoverSingle(filepath.Join(knownFolder, "packer-plugin-*")) + if err != nil { + return err } - plugPaths := strings.Split(packerPluginPath, sep) - for _, plugPath := range plugPaths { - if err := c.discoverExternalComponents(plugPath); err != nil { + for pluginName, pluginPath := range pluginPaths { + // Test pluginPath points to an executable + if _, err := exec.LookPath(pluginPath); err != nil { + log.Printf("[WARN] %q is not executable; skipping", pluginPath) + continue + } + if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { return err } } } - return nil } @@ -206,64 +198,86 @@ func (c *PluginConfig) discoverExternalComponents(path string) error { log.Printf("using external datasource %v", externallyUsed) } - //Check for installed plugins using the `packer plugins install` command - binInstallOpts := plugingetter.BinaryInstallationOptions{ - OS: runtime.GOOS, - ARCH: runtime.GOARCH, - APIVersionMajor: pluginsdk.APIVersionMajor, - APIVersionMinor: pluginsdk.APIVersionMinor, - Checksummers: []plugingetter.Checksummer{ - {Type: "sha256", Hash: sha256.New()}, - }, - } + return nil +} - if runtime.GOOS == "windows" { - binInstallOpts.Ext = ".exe" +func (c *PluginConfig) discoverLegacyMonoComponents(path string) error { + var err error + log.Printf("[TRACE] discovering plugins in %s", path) + + if !filepath.IsAbs(path) { + path, err = filepath.Abs(path) + if err != nil { + return err + } } + var externallyUsed []string - pluginPaths, err = c.discoverSingle(filepath.Join(path, "*", "*", "*", fmt.Sprintf("packer-plugin-*%s", binInstallOpts.FilenameSuffix()))) + pluginPaths, err := c.discoverSingle(filepath.Join(path, "packer-builder-*")) if err != nil { return err } - for pluginName, pluginPath := range pluginPaths { - var checksumOk bool - for _, checksummer := range binInstallOpts.Checksummers { - cs, err := checksummer.GetCacheChecksumOfFile(pluginPath) - if err != nil { - log.Printf("[TRACE] GetChecksumOfFile(%q) failed: %v", pluginPath, err) - continue - } - - if err := checksummer.ChecksumFile(cs, pluginPath); err != nil { - log.Printf("[TRACE] ChecksumFile(%q) failed: %v", pluginPath, err) - continue - } - checksumOk = true - break - } - - if !checksumOk { - log.Printf("[TRACE] No checksum found for %q ignoring possibly unsafe binary", path) - continue - } + newPath := pluginPath // this needs to be stored in a new variable for the func below + c.Builders.Set(pluginName, func() (packersdk.Builder, error) { + return c.Client(newPath).Builder() + }) + externallyUsed = append(externallyUsed, pluginName) + } + if len(externallyUsed) > 0 { + sort.Strings(externallyUsed) + log.Printf("[INFO] using external builders: %v", externallyUsed) + externallyUsed = nil + } - if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { - return err - } + pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-post-processor-*")) + if err != nil { + return err + } + for pluginName, pluginPath := range pluginPaths { + newPath := pluginPath // this needs to be stored in a new variable for the func below + c.PostProcessors.Set(pluginName, func() (packersdk.PostProcessor, error) { + return c.Client(newPath).PostProcessor() + }) + externallyUsed = append(externallyUsed, pluginName) + } + if len(externallyUsed) > 0 { + sort.Strings(externallyUsed) + log.Printf("using external post-processors %v", externallyUsed) + externallyUsed = nil } - // Manually installed plugins take precedence over all. Duplicate plugins installed - // prior to the packer plugins install command should be removed by user to avoid overrides. - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-plugin-*")) + pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-provisioner-*")) if err != nil { return err } + for pluginName, pluginPath := range pluginPaths { + newPath := pluginPath // this needs to be stored in a new variable for the func below + c.Provisioners.Set(pluginName, func() (packersdk.Provisioner, error) { + return c.Client(newPath).Provisioner() + }) + externallyUsed = append(externallyUsed, pluginName) + } + if len(externallyUsed) > 0 { + sort.Strings(externallyUsed) + log.Printf("using external provisioners %v", externallyUsed) + externallyUsed = nil + } + pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-datasource-*")) + if err != nil { + return err + } for pluginName, pluginPath := range pluginPaths { - if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { - return err - } + newPath := pluginPath // this needs to be stored in a new variable for the func below + c.DataSources.Set(pluginName, func() (packersdk.Datasource, error) { + return c.Client(newPath).Datasource() + }) + externallyUsed = append(externallyUsed, pluginName) + } + if len(externallyUsed) > 0 { + sort.Strings(externallyUsed) + log.Printf("using external datasource %v", externallyUsed) } return nil @@ -291,7 +305,7 @@ func (c *PluginConfig) discoverSingle(glob string) (map[string]string, error) { // We could do a full PATHEXT parse, but this is probably good enough. if runtime.GOOS == "windows" && strings.ToLower(filepath.Ext(file)) != ".exe" { log.Printf( - "[DEBUG] Ignoring plugin match %s, no exe extension", + "[TRACE] Ignoring plugin match %s, no exe extension", match) continue } @@ -307,7 +321,7 @@ func (c *PluginConfig) discoverSingle(glob string) (map[string]string, error) { // After the split the plugin name is "baz". pluginName = strings.SplitN(pluginName, "_", 2)[0] - log.Printf("[DEBUG] Discovered plugin: %s = %s", pluginName, match) + log.Printf("[INFO] Discovered potential plugin: %s = %s", pluginName, match) res[pluginName] = match } @@ -426,9 +440,9 @@ func (c *PluginConfig) Client(path string, args ...string) *PluginClient { } if strings.Contains(originalPath, PACKERSPACE) { - log.Printf("[TRACE] Starting internal plugin %s", args[len(args)-1]) + log.Printf("[INFO] Starting internal plugin %s", args[len(args)-1]) } else { - log.Printf("[TRACE] Starting external plugin %s %s", path, strings.Join(args, " ")) + log.Printf("[INFO] Starting external plugin %s %s", path, strings.Join(args, " ")) } var config PluginClientConfig config.Cmd = exec.Command(path, args...) @@ -437,3 +451,57 @@ func (c *PluginConfig) Client(path string, args ...string) *PluginClient { config.MaxPort = c.PluginMaxPort return NewClient(&config) } + +// discoverInstalledComponents scans the provided path for plugins installed by running packer plugins install or packer init. +// Valid plugins contain a matching system binary and valid checksum file. +func (c *PluginConfig) discoverInstalledComponents(path string) error { + //Check for installed plugins using the `packer plugins install` command + binInstallOpts := plugingetter.BinaryInstallationOptions{ + OS: runtime.GOOS, + ARCH: runtime.GOARCH, + APIVersionMajor: pluginsdk.APIVersionMajor, + APIVersionMinor: pluginsdk.APIVersionMinor, + Checksummers: []plugingetter.Checksummer{ + {Type: "sha256", Hash: sha256.New()}, + }, + } + + if runtime.GOOS == "windows" { + binInstallOpts.Ext = ".exe" + } + + pluginPath := filepath.Join(path, "*", "*", "*", fmt.Sprintf("packer-plugin-*%s", binInstallOpts.FilenameSuffix())) + pluginPaths, err := c.discoverSingle(pluginPath) + if err != nil { + return err + } + + for pluginName, pluginPath := range pluginPaths { + var checksumOk bool + for _, checksummer := range binInstallOpts.Checksummers { + cs, err := checksummer.GetCacheChecksumOfFile(pluginPath) + if err != nil { + log.Printf("[TRACE] GetChecksumOfFile(%q) failed: %v", pluginPath, err) + continue + } + + if err := checksummer.ChecksumFile(cs, pluginPath); err != nil { + log.Printf("[TRACE] ChecksumFile(%q) failed: %v", pluginPath, err) + continue + } + checksumOk = true + break + } + + if !checksumOk { + log.Printf("[WARN] No checksum found for %q ignoring possibly unsafe binary", path) + continue + } + + if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { + return err + } + } + + return nil +} diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index 91e8ba6b318..32dccf9aae6 100644 --- a/packer/plugin_discover_test.go +++ b/packer/plugin_discover_test.go @@ -24,6 +24,7 @@ func newPluginConfig() PluginConfig { var conf PluginConfig conf.PluginMinPort = 10000 conf.PluginMaxPort = 25000 + conf.KnownPluginFolders = []string{os.TempDir()} return conf } From 4347e8cee80729e85fadca9b2dcc6fd564115ce9 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 23 May 2023 21:05:35 -0400 Subject: [PATCH 14/92] Default to PuluginFolders is KnownPluginFolders is unset * PACKER_PLUGIN_PATH takes precedence over all --- packer/plugin.go | 3 +-- packer/plugin_discover_test.go | 1 - packer/plugin_folders.go | 9 +++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packer/plugin.go b/packer/plugin.go index 4bd5765f159..5e4360f4fd6 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -6,7 +6,6 @@ package packer import ( "crypto/sha256" "encoding/json" - "errors" "fmt" "log" "os" @@ -81,7 +80,7 @@ func (c *PluginConfig) Discover() error { } if len(c.KnownPluginFolders) == 0 { - return errors.New("no known plugin folders defined") + c.KnownPluginFolders = PluginFolders() } // TODO after JSON is deprecated remove support for legacy component plugins. diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index 32dccf9aae6..91e8ba6b318 100644 --- a/packer/plugin_discover_test.go +++ b/packer/plugin_discover_test.go @@ -24,7 +24,6 @@ func newPluginConfig() PluginConfig { var conf PluginConfig conf.PluginMinPort = 10000 conf.PluginMaxPort = 25000 - conf.KnownPluginFolders = []string{os.TempDir()} return conf } diff --git a/packer/plugin_folders.go b/packer/plugin_folders.go index 99ff3b13a40..52d63aac4cc 100644 --- a/packer/plugin_folders.go +++ b/packer/plugin_folders.go @@ -16,6 +16,11 @@ import ( func PluginFolders(dirs ...string) []string { res := []string{} + if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { + res = append(res, strings.Split(packerPluginPath, string(os.PathListSeparator))...) + return res + } + if path, err := os.Executable(); err != nil { log.Printf("[ERR] Error finding executable: %v", err) } else { @@ -30,9 +35,5 @@ func PluginFolders(dirs ...string) []string { res = append(res, filepath.Join(cd, "plugins")) } - if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { - res = append(res, strings.Split(packerPluginPath, string(os.PathListSeparator))...) - } - return res } From 18cc6edbd5e4dc9384976ecf5c7b307add010986 Mon Sep 17 00:00:00 2001 From: Dylan Staley <88163+dstaley@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:05:27 -0700 Subject: [PATCH 15/92] docs: move community tools to docs folder --- website/content/{ => docs}/community-tools.mdx | 0 website/data/docs-nav-data.json | 4 ++++ 2 files changed, 4 insertions(+) rename website/content/{ => docs}/community-tools.mdx (100%) diff --git a/website/content/community-tools.mdx b/website/content/docs/community-tools.mdx similarity index 100% rename from website/content/community-tools.mdx rename to website/content/docs/community-tools.mdx diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index e1de91658f1..7c7e110d518 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -887,6 +887,10 @@ "title": "Integration Program", "path": "partnerships" }, + { + "title": "Community Tools", + "path": "community-tools" + }, { "divider": true }, From 8982d4f168dd3042a53883408b4ff154d1f2a46a Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Mon, 3 Jul 2023 14:13:08 -0400 Subject: [PATCH 16/92] Migrate external Parallels plugin to Parallels/packer-plugin-parallels (#12476) * Update external plugin documentation source The Parallels plugin for Packer is now maintained by the Parallels team, under their respective GitHub org. This changes updates the source address for the external plugin that should be used for pulling new plugin documentation. * Removed packer-plugin-parallels for list of vendored plugins --- command/vendored_plugins.go | 4 ---- go.mod | 3 +-- go.sum | 2 -- website/data/plugins-manifest.json | 5 +++-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go index 79a8af171c6..0718b91a7c5 100644 --- a/command/vendored_plugins.go +++ b/command/vendored_plugins.go @@ -32,8 +32,6 @@ import ( googlecomputebuilder "github.com/hashicorp/packer-plugin-googlecompute/builder/googlecompute" googlecomputeexportpostprocessor "github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-export" googlecomputeimportpostprocessor "github.com/hashicorp/packer-plugin-googlecompute/post-processor/googlecompute-import" - parallelsisobuilder "github.com/hashicorp/packer-plugin-parallels/builder/parallels/iso" - parallelspvmbuilder "github.com/hashicorp/packer-plugin-parallels/builder/parallels/pvm" qemubuilder "github.com/hashicorp/packer-plugin-qemu/builder/qemu" vagrantbuilder "github.com/hashicorp/packer-plugin-vagrant/builder/vagrant" vagrantpostprocessor "github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant" @@ -69,8 +67,6 @@ var VendoredBuilders = map[string]packersdk.Builder{ "azure-dtl": new(azuredtlbuilder.Builder), "docker": new(dockerbuilder.Builder), "googlecompute": new(googlecomputebuilder.Builder), - "parallels-iso": new(parallelsisobuilder.Builder), - "parallels-pvm": new(parallelspvmbuilder.Builder), "qemu": new(qemubuilder.Builder), "vagrant": new(vagrantbuilder.Builder), "vsphere-clone": new(vsphereclonebuilder.Builder), diff --git a/go.mod b/go.mod index bc42114765a..fa48d7d58da 100644 --- a/go.mod +++ b/go.mod @@ -59,11 +59,11 @@ require ( ) require ( + github.com/go-openapi/strfmt v0.21.3 github.com/hashicorp/packer-plugin-ansible v1.0.3 github.com/hashicorp/packer-plugin-azure v1.4.0 github.com/hashicorp/packer-plugin-docker v1.0.8 github.com/hashicorp/packer-plugin-googlecompute v1.1.0 - github.com/hashicorp/packer-plugin-parallels v1.0.3 github.com/hashicorp/packer-plugin-qemu v1.0.9 github.com/hashicorp/packer-plugin-vagrant v1.0.3 github.com/hashicorp/packer-plugin-virtualbox v1.0.4 @@ -127,7 +127,6 @@ require ( github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/loads v0.21.2 // indirect github.com/go-openapi/spec v0.20.8 // indirect - github.com/go-openapi/strfmt v0.21.3 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/go-openapi/validate v0.22.1 // indirect github.com/gofrs/uuid v4.0.0+incompatible // indirect diff --git a/go.sum b/go.sum index bd6a68ceadb..96c6e63f953 100644 --- a/go.sum +++ b/go.sum @@ -457,8 +457,6 @@ github.com/hashicorp/packer-plugin-docker v1.0.8 h1:UWPG/pl+1RFsaNQVhEuowCeOZuES github.com/hashicorp/packer-plugin-docker v1.0.8/go.mod h1:4U3gHULbUw3okSqqZgQZD5ptyJKs0S7LfOOt2U3V4Jk= github.com/hashicorp/packer-plugin-googlecompute v1.1.0 h1:/cSZCJuRV6osaSa1uOy8cpN+c/uiCbrSsZ8vyNC0slk= github.com/hashicorp/packer-plugin-googlecompute v1.1.0/go.mod h1:k7MhKwEDw9ASP3a1y1syKJFZiZ8pO4oH40HvVgGHzUE= -github.com/hashicorp/packer-plugin-parallels v1.0.3 h1:smypphUCEj3arCdlvbNtZvGC1ujsUSRtN1MBvZHt/w8= -github.com/hashicorp/packer-plugin-parallels v1.0.3/go.mod h1:Q842nvosVmP5FnYozk8ZZj93HGIan19jHTxGeteBCb0= github.com/hashicorp/packer-plugin-qemu v1.0.9 h1:1YKBBzBULYUBWtpAZJTbaLjjZPAdQ63okkpTqMBTnzM= github.com/hashicorp/packer-plugin-qemu v1.0.9/go.mod h1:BpWIpVpOoPFV9Ppmzq4DP/S0QNoh1R+7DUCqxHdXc+Y= github.com/hashicorp/packer-plugin-sdk v0.4.0 h1:UyLYe0y02D9wkOQ3FeeZWyFg2+mx2vLuWRGUL5xt50I= diff --git a/website/data/plugins-manifest.json b/website/data/plugins-manifest.json index ee9c1f5daf5..675c8e7271d 100644 --- a/website/data/plugins-manifest.json +++ b/website/data/plugins-manifest.json @@ -235,8 +235,9 @@ { "title": "Parallels", "path": "parallels", - "repo": "hashicorp/packer-plugin-parallels", - "version": "latest" + "repo": "parallels/packer-plugin-parallels", + "version": "latest", + "pluginTier": "verified" }, { "title": "Profitbricks", From 9c85fc274af579aee846b21cdbc0b89f8eaefb0f Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 6 Jul 2023 16:00:36 -0400 Subject: [PATCH 17/92] Update plugin loading documentation (#12485) Packer checks a number of directories for plugins upon initialization, with the introduction of multi-component plugins and underlying changes to the Packer SDK the ordering changed slightly. These changes update the related documentation to reflect the new ordering, and adds a plugin loading ordering section to the docs to help users discover how plugin loading works. Include in this change are updates to the PACKER_CONFIG_DIR environment variables to reflect the XDG base directory specification used as the default Packer configuration directory layout. * Update website/content/docs/configure.mdx --- website/content/docs/configure.mdx | 80 +++++------- .../content/docs/plugins/install-plugins.mdx | 114 +++++++++--------- .../partials/plugins/plugin-location.mdx | 71 +++-------- 3 files changed, 107 insertions(+), 158 deletions(-) diff --git a/website/content/docs/configure.mdx b/website/content/docs/configure.mdx index cce9f1b554b..1ab98692584 100644 --- a/website/content/docs/configure.mdx +++ b/website/content/docs/configure.mdx @@ -13,69 +13,42 @@ so you generally don't have to worry about it until you want to tweak a configuration. If you're just getting started with Packer, don't worry about core configuration for now. -## Packer's home directory - -Plugins and core configuration files can exist in the home directory of Packer. -The home directory of Packer will be the first one of the following env values -to be set : - -| Unix | Windows | -| ---------------------- | --------------------- | -| `${PACKER_CONFIG_DIR}` | `%PACKER_CONFIG_DIR%` | -| `${APPDATA}` | `%APPDATA%` | -| `${HOME}` | `%HOME%` | -| user dir of `${USER}` | user dir of `${USER}` | - --> Note: On this page "Packer's home directory" will be referenced as -`PACKER_HOME_DIR`. - -## Packer's config file - -Packer can optionally read a JSON file for the end user to set core settings. -The config file of Packer will be looked up on the following paths: - -| Unix | Windows | -| -------------------------------- | -------------------------------- | -| `${PACKER_CONFIG}` | `%PACKER_CONFIG%` | -| `PACKER_HOME_DIR/.packerconfig` | `PACKER_HOME_DIR/packer.config/` | -| `${XDG_CONFIG_HOME}/packer` | | -| `PACKER_HOME_DIR/.config/packer` | | - ## Packer's config directory Packer's configuration directory can potentially contain plugins and internal -Packer files. The config dir of Packer will be looked up on the following paths: +Packer files. The Packer config directory will be looked up on the following paths: | Unix | Windows | | --------------------------- | --------------------------- | -| `PACKER_HOME_DIR/.packer.d` | `PACKER_HOME_DIR/packer.d/` | +| `${HOME}/.config/packer/` | `%APPDATA%\packer.d\` | + +-> **Note:** On Unix systems, Packer defaults to using the XDG base directory specification. +When the environment variable `PACKER_CONFIG_DIR` is unset or empty a default equal to `$HOME/.config/packer` should be used. +In all other cases, where there is an existing older style `.packer.d` directory (e.g `$HOME/.packer.d/`) or PACKER_CONFIG_DIR is not empty +the older configuration directory will be used. Examples: -- On a Unix system, if the `$PACKER_CONFIG_DIR` env var is set to +- On a Unix system, if the `$PACKER_CONFIG_DIR` environment variable is set to `/home/packer`, the config directory will be: `/home/packer/.packer.d/` and other values will not be checked. -- On a Unix system, if the `HOME` env var is `/home/azr` or the `USER` env var - is `azr`, then the config directory will default to `/home/azr/.packer.d/`. -- On a Windows system, if the `PACKER_CONFIG_DIR` env var is set to `C:/`,the +- On a Windows system, if the `PACKER_CONFIG_DIR` environment variable is set to `C:/`,the config directory will be: `C:/packer.d/` and other values will not be checked. -## Packer's plugin directory - -@include "plugins/plugin-location.mdx" + +## Packer's config file (deprecated) -The format of the configuration file is basic JSON. +Packer can optionally read a JSON file for the end user to set core settings. +The config file of Packer will be looked up on the following paths: -## Packer's cache directory +| Unix | Windows | +| -------------------------------- | --------------------------------- | +| `${PACKER_CONFIG}` | `%PACKER_CONFIG%` | +| `${HOME}/.packerconfig` | `%APPDATA%\packer.config\` | -Packer uses a cache directory to download large files and for logistics around -large file download. By default, Packer caches things in the current directory, -under: `./packer_cache/`. This can be changed by setting the `PACKER_CACHE_DIR` -env var. It is recommended to share the same Packer cache dir across your -builds if you have multiple builds doing similar things to avoid downloading the -same ISO twice for example. +The format of the configuration file is basic JSON. -## Packer config file configuration Reference +### Packer config file configuration Reference Below is the list of all available configuration parameters for the core configuration file. None of these are required, since all have defaults. @@ -94,13 +67,20 @@ configuration file. None of these are required, since all have defaults. and the [`packer init`](/packer/docs/commands/init) command to install plugins; if you are using both, the `required_plugin` config will take precedence. -### HCP Packer Configuration +## Packer's plugin directory + +@include "plugins/plugin-location.mdx" -You can configure both legacy JSON and HCL2 Packer templates to publish image metadata to an active HCP Packer registry. The HCP Packer registry helps you track information about machine images, clearly designate which images are appropriate for test and production environments, and query the right images to use in both Packer and Terraform configurations. +## Packer's cache directory -For complete configuration details and examples, refer to [Packer Template Configuration](/hcp/docs/packer/store-image-metadata/template-configuration) in the HCP Packer documentation. +Packer uses a cache directory to download large files and for logistics around +large file download. By default, Packer caches things in the current directory, +under: `./packer_cache/`. This can be changed by setting the `PACKER_CACHE_DIR` +env var. It is recommended to share the same Packer cache directory across your +builds if you have multiple builds doing similar things to avoid downloading the +same ISO twice for example. -## Full list of Environment Variables usable for Packer +## Environment Variables usable for Packer Packer uses a variety of environmental variables. A listing and description of each can be found below: diff --git a/website/content/docs/plugins/install-plugins.mdx b/website/content/docs/plugins/install-plugins.mdx index 86ec7c5c15f..3af8ebbbf4c 100644 --- a/website/content/docs/plugins/install-plugins.mdx +++ b/website/content/docs/plugins/install-plugins.mdx @@ -13,6 +13,10 @@ post-processor components that ship with the Packer binary. Packer automatically This page explains how to install custom external plugins. Refer to [External Plugins](/packer/plugins) for a list of available plugins and their documentation. +## Plugin Loading Order + +@include "plugins/plugin-location.mdx" + ## Installation Guides Choose the tab that corresponds to the type of plugin you want to install. If you are not sure, check the plugin's name. @@ -22,10 +26,10 @@ Choose the tab that corresponds to the type of plugin you want to install. If yo -~> **Note**: Only _multi-component plugin binaries_ -- that is plugins named +-> **Note:** Only _multi-component plugin binaries_ -- plugins named packer-plugin-\*, like the `packer-plugin-amazon` -- are expected to work with Packer init. The legacy `builder`, `post-processor` and `provisioner` plugin -types will keep on being detected but Packer cannot install them automatically. +types will continue to be detected but Packer cannot install them automatically. If a plugin you use has not been upgraded to use the multi-component plugin architecture, contact your maintainer to request an upgrade. @@ -64,9 +68,8 @@ packer { Each plugin has two identifiers: -- A `source` address, which is only necessary when requiring a plugin outside the HashiCorp domain. -- A unique **local name**, which is used everywhere else in a Packer - configuration. +- A `source` address, which is necessary when requiring a plugin not bundled with the Packer binary. +- A unique **local name**, which is used everywhere else in a Packer configuration. ## Local Names @@ -135,7 +138,8 @@ follows: For example, the fictional `myawesomecloud` plugin could belong to the `hashicorp` namespace on `github.com`, so its `source` could be `github.com/hashicorp/myawesomecloud`, -Note: the actual _repository_ that myawesomecloud comes from must always have + +-> Note: the actual _repository_ that myawesomecloud comes from must always have the name format `github.com/hashicorp/packer-plugin-myawesomecloud`, but the `required_plugins` block omits the redundant `packer-plugin-` repository prefix for brevity. @@ -144,9 +148,34 @@ The source address with all three components given explicitly is called the plugin's _fully-qualified address_. You will see fully-qualified address in various outputs, like error messages. -## Plugin location +## Plugin Installation Workflow -@include "plugins/plugin-location.mdx" +* [`packer init`](/packer/docs/commands/init) will install plugins in the **last** directory +in the following numbered list. + +1. `PACKER_PLUGINS_PATH` if set will be the sole location for installing plugins. All other +plugin directories will be ignored. +1. `PACKER_CONFIG_DIR`\plugins on Windows systems, or `PACKER_CONFIG_DIR`/plugins on all other systems. + +* During the initialization of Packer, any plugin required in the +**`required_plugins`** section will be looked up in all entries of the following +list. **First** plugin found takes precedence. Two binaries of the same plugin +with two different version will be considered as two different plugins. Highest +found version matching `required_plugins` will be taken into consideration. + +During initialization, on a `darwin_amd64` system, Packer will look-up for the +following files: + +* `PACKER_PLUGIN_PATH/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` +* `PACKER_CONFIG_DIR/plugins/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` + +The first plugin-name/version files found will take precedence. + +For plugins located under the `github.com/azr/happycloud/` directory structure an accompanying SHA256SUM file +will be required in order for `packer init` to ensure the plugin being loaded has not been tampered with. +The SHA256SUM file will be automatically generated when a plugin is installed via `packer init` if the plugin +was installed manually into `PACKER_CONFIG_DIR/plugins/github.com/azr/happycloud/` then the file +`PACKER_CONFIG_DIR/plugins/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64_SHA256SUM` must be generated manually as well. ## Implicit Github urls @@ -171,37 +200,32 @@ will avoid conflicting with other plugins for other tools, like Terraform. --> The [`packer plugins`](/packer/docs/commands/plugins) command allows to install plugins without going through -`init`. For manual installation of plugin binaries, without the `packer plugins` command, please continue reading. +-> The [`packer plugins`](/packer/docs/commands/plugins), available from Packer v1.8.0, command allows +you to install plugins without going through `init`. -The easiest way to manually install a plugin is to name it correctly, then place -it in the proper directory. To name a plugin correctly, make sure the binary is -named `packer-plugin-NAME`. For example, `packer-plugin-amazon` for a "plugin" -binary named "amazon". This binary will make one or more components available to -use. Valid types for plugins are down this page. - -Once the plugin is named properly, Packer automatically discovers plugins in -the following directories in the given order. If a conflicting plugin is found -later, it will take precedence over one found earlier. +```shell +packer plugins install github.com/hashicorp/vagrant +``` -1. The directory where `packer` is, or the executable directory. +## Plugin Installation Workflow +Plugin installation via `packer plugins install` works similar to that of the `packer init` command, with the following +exceptions no `required_plugins` block required and can be used with both legacy JSON and HCL2 templates. -2. The `$HOME/.packer.d/plugins` directory, if `$HOME` is defined (Unix) +* [`packer plugins install`](/packer/docs/commands/plugins) will install plugins in the **last** directory +in the following numbered list. -3. The `%APPDATA%/packer.d/plugins` if `%APPDATA%` is defined (Windows) +1. `PACKER_PLUGINS_PATH` if set will be the sole location for installing plugins. All other +plugin directories will be ignored. +1. `PACKER_CONFIG_DIR`\plugins on Windows systems, or `PACKER_CONFIG_DIR`/plugins on all other systems. -4. The `%USERPROFILE%/packer.d/plugins` if `%USERPROFILE%` is defined - (Windows) -5. The current working directory. +For manual installation of plugin binaries, without the `packer plugins` command, please continue reading. -6. The directory defined in the env var `PACKER_PLUGIN_PATH`. There can be more - than one directory defined; for example, `~/custom-dir-1:~/custom-dir-2`. - Separate directories in the PATH string using a colon (`:`) on POSIX systems and - a semicolon (`;`) on Windows systems. The above example path would be able to - find a provisioner named `packer-provisioner-foo` in either - `~/custom-dir-1/packer-provisioner-foo` or - `~/custom-dir-2/packer-provisioner-foo`. +The easiest way to manually install a plugin is to name it correctly, then place +it in the proper directory. To name a plugin correctly, make sure the binary is +named `packer-plugin-NAME`. For example, `packer-plugin-amazon` for a "plugin" +binary named "amazon". This binary will make one or more components available to +use. Valid types for plugins are down this page. The valid types for plugins are: @@ -217,6 +241,7 @@ The valid types for plugins are: - `provisioner` - A provisioner to install software on images created by a builder. + @@ -226,29 +251,6 @@ named `packer-COMPONENT-NAME`. For example, `packer-provisioner-comment` for a " binary named "comment". This binary will make a single provisioner named `comment` available to use. Valid types for plugins are down this page. -Once the plugin is named properly, Packer automatically discovers plugins in -the following directories in the given order. If a conflicting plugin is found -later, it will take precedence over one found earlier. - -1. The directory where `packer` is, or the executable directory. - -2. The `$HOME/.packer.d/plugins` directory, if `$HOME` is defined (Unix) - -3. The `%APPDATA%/packer.d/plugins` if `%APPDATA%` is defined (Windows) - -4. The `%USERPROFILE%/packer.d/plugins` if `%USERPROFILE%` is defined - (Windows) - -5. The current working directory. - -6. The directory defined in the env var `PACKER_PLUGIN_PATH`. There can be more - than one directory defined; for example, `~/custom-dir-1:~/custom-dir-2`. - Separate directories in the PATH string using a colon (`:`) on POSIX systems and - a semicolon (`;`) on Windows systems. The above example path would be able to - find a provisioner named `packer-provisioner-foo` in either - `~/custom-dir-1/packer-provisioner-foo` or - `~/custom-dir-2/packer-provisioner-foo`. - The valid types for plugins are: - `plugin` - A plugin binary that can contain one or more of each Packer component @@ -264,4 +266,4 @@ The valid types for plugins are: builder. - \ No newline at end of file + diff --git a/website/content/partials/plugins/plugin-location.mdx b/website/content/partials/plugins/plugin-location.mdx index eec78bf10b9..d8e997c7d44 100644 --- a/website/content/partials/plugins/plugin-location.mdx +++ b/website/content/partials/plugins/plugin-location.mdx @@ -1,58 +1,25 @@ -Plugins will usually be located in the -[PACKER_HOME_DIR](/packer/docs/configure#packer-s-home-directory). +Upon the initialization of Packer, any externally installed plugin will be automatically +discovered and loaded. -* [`packer init`](/packer/docs/commands/init) will install plugins in the **last** directory -in the following numbered list. +Packer plugins will usually be located within a plugins sub-directory under Packer's main config directory +[PACKER_CONFIG_DIR](/packer/docs/configure#packer-s-config-directory). If `PACKER_CONFIG_DIR` is +either not set or empty, a default equal to `$HOME/.config/packer/plugins` on UNIX, or `%APPDATA%\packer.d\plugins` +for Windows, will be used. -* During the initialization of Packer, any plugin required in the -**`required_plugins`** section will be looked up in all entries of the following -list. **First** plugin found takes precedence. Two binaries of the same plugin -with two different version will be considered as two different plugins. Highest -found version matching `required_plugins` will be taken into consideration. +Where applicable, some installation processes such as `packer init` may override the plugin loading process. +Refer to the specific installation guides for any plugin loading overrides. -1. The directory where `packer` is, or the executable directory. -1. The current working directory. (`"."`) -1. The `PACKER_HOME_DIR/plugins` directory. `PACKER_HOME_DIR` refers to *[Packer's home -directory](/packer/docs/configure#packer-s-home-directory)*, if it could be found. -1. The director(y/ies) under the `PACKER_PLUGIN_PATH` env var, if `PACKER_PLUGIN_PATH` -is set. +Packer uses the following process for loading the correct plugin: -~> **Note**: There can be more than one directory in the `PACKER_PLUGIN_PATH` -env var, it will be seperated by a semicolon (`;`) on Windows systems and a -colon (`:`) on other systems. The order priority will be kept. +1. All directories under the `PACKER_PLUGIN_PATH` environment variable, if `PACKER_PLUGIN_PATH` +is set. The `PACKER_PLUGIN_PATH` takes precedences over all other plugin directories; no other directories will be checked. +1. The directory where `packer` is installed, or the executable directory. +1. The current working directory, where `packer build` is being invoked. (`"."`) +1. The `PACKER_CONFIG_DIR/plugins` directory. `PACKER_CONFIG_DIR` refers to *[Packer's config +directory](/packer/docs/configure#packer-s-config-directory)*, if it could be found. -Using the following example : -```hcl - required_plugins { - happycloud = { - version = ">= 2.7.0" - source = "github.com/azr/happycloud" - } - } -``` +-> **Note:** The `PACKER_PLUGIN_PATH` environment variable can be set to more that one directories; +for example, ~/custom-dir-1:~/custom-dir-2. Separate directories in the PATH string using a colon (:) on UNIX systems +and a semicolon (;) on Windows systems. The above example path would be able to find a single or multi-component plugin +in either `~/custom-dir-1/packer/` or `~/custom-dir-2/`. -The plugin getter will then install the binaries in the following location for a -system with no `PACKER_PLUGIN_PATH` env var set. - -* `PACKER_HOME_DIR/plugins/github.com/hashicorp/happycloud/` - -During initialization, on a `darwin_amd64` system, Packer will look-up for the -following files: - -* `PACKER_EXEC_DIR/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `./github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `PACKER_HOME_DIR/plugins/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `PACKER_PLUGIN_PATH/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64` -* `./packer-plugin-happycloud` - -The first plugin-name/version files found will take precedence. - -For plugins located under the `github.com/azr/happycloud/` directory structure an accompanying SHA256SUM file -will be required in order for `packer init` to ensure the plugin being loaded has not been tampered with. -The SHA256SUM file will be automatically generated when a plugin is installed via `packer init` if the plugin -was installed manually into `PACKER_HOME_DIR/plugins/github.com/azr/happycloud/` then the file -`PACKER_HOME_DIR/plugins/github.com/azr/happycloud/packer-plugin-happycloud_*_x5.0_darwin_amd64_SHA256SUM` must be generated manually as well. - --> Note: `PACKER_HOME_DIR` is not an actual env var and refers to [Packer's home -directory](#packer-s-home-directory). `PACKER_EXEC_DIR` is not an actual env var -and refers to the directory where `packer` is, or the executable directory. From 8beddcf52aa2f56594848a13d666e8356140aede Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 12 Jul 2023 10:24:05 -0400 Subject: [PATCH 18/92] website: fix header on configure page When the config file header was reworked, an erroneous link was included and placed so close to the header that it was rendered verbatim in the final documentation page. By adding an extra empty line in between the anchor link and the header, this renders correctly. --- website/content/docs/configure.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/website/content/docs/configure.mdx b/website/content/docs/configure.mdx index 1ab98692584..18eeb409396 100644 --- a/website/content/docs/configure.mdx +++ b/website/content/docs/configure.mdx @@ -36,6 +36,7 @@ Examples: config directory will be: `C:/packer.d/` and other values will not be checked. + ## Packer's config file (deprecated) Packer can optionally read a JSON file for the end user to set core settings. From 0e3de18e989ec7d366679d6ebd95e8437c81798d Mon Sep 17 00:00:00 2001 From: akkuman Date: Thu, 13 Jul 2023 16:41:50 +0800 Subject: [PATCH 19/92] fix: revise env var PACKER_PLUGIN_PATH ref: https://github.com/hashicorp/packer/pull/8616/files#diff-0e426a43248661127a0c0ee115aef7a1093b635f8993b3f7ebb1dd9f05b8f249R153 --- website/content/docs/plugins/install-plugins.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/plugins/install-plugins.mdx b/website/content/docs/plugins/install-plugins.mdx index 3af8ebbbf4c..0460e6c561c 100644 --- a/website/content/docs/plugins/install-plugins.mdx +++ b/website/content/docs/plugins/install-plugins.mdx @@ -153,7 +153,7 @@ various outputs, like error messages. * [`packer init`](/packer/docs/commands/init) will install plugins in the **last** directory in the following numbered list. -1. `PACKER_PLUGINS_PATH` if set will be the sole location for installing plugins. All other +1. `PACKER_PLUGIN_PATH` if set will be the sole location for installing plugins. All other plugin directories will be ignored. 1. `PACKER_CONFIG_DIR`\plugins on Windows systems, or `PACKER_CONFIG_DIR`/plugins on all other systems. From 456bc2397b3950860d09eb4c3ca324dcc2ac512f Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 17 Jul 2023 11:25:42 -0400 Subject: [PATCH 20/92] hcl2template: only warn once for missing plugins In HCL2, if a template contains a `required_plugins' block, but the required plugins are not installed, we print a warning. Prior to this commit, this was reported as an error once per missing plugin, which was redundant. This commit changes that by gathering all the missing plugins once, and printing them as a bullet list, so the message isn't redundant anymore. --- hcl2template/plugin.go | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/hcl2template/plugin.go b/hcl2template/plugin.go index bd1080b836b..1c32ef7779e 100644 --- a/hcl2template/plugin.go +++ b/hcl2template/plugin.go @@ -8,6 +8,7 @@ import ( "fmt" "log" "runtime" + "strings" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer-plugin-sdk/didyoumean" @@ -77,6 +78,8 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { return diags } + uninstalledPlugins := map[string]string{} + for _, pluginRequirement := range pluginReqs { sortedInstalls, err := pluginRequirement.ListInstallations(opts) if err != nil { @@ -88,11 +91,7 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { continue } if len(sortedInstalls) == 0 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("no plugin installed for %s %v", pluginRequirement.Identifier, pluginRequirement.VersionConstraints.String()), - Detail: "Did you run packer init for this project ?", - }) + uninstalledPlugins[pluginRequirement.Identifier.String()] = pluginRequirement.VersionConstraints.String() continue } log.Printf("[TRACE] Found the following %q installations: %v", pluginRequirement.Identifier, sortedInstalls) @@ -108,6 +107,20 @@ func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { } } + if len(uninstalledPlugins) > 0 { + detailMessage := &strings.Builder{} + detailMessage.WriteString("The following plugins are required, but not installed:\n\n") + for pluginName, pluginVersion := range uninstalledPlugins { + fmt.Fprintf(detailMessage, "* %s %s\n", pluginName, pluginVersion) + } + detailMessage.WriteString("\nDid you run packer init for this project ?") + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing plugins", + Detail: detailMessage.String(), + }) + } + return diags } From 2824320aa165ccf1a6b5aedad27699288b373382 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 11 Jul 2023 10:40:22 -0400 Subject: [PATCH 21/92] packer: remove discoverExternalComponents Since the `discoverExternalComponents' function was defined but not called anywhere, it is dead code, and can be safely removed from the codebase. --- packer/plugin.go | 82 ------------------------------------------------ 1 file changed, 82 deletions(-) diff --git a/packer/plugin.go b/packer/plugin.go index 5e4360f4fd6..a4321d90fd0 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -118,88 +118,6 @@ func (c *PluginConfig) Discover() error { return nil } -func (c *PluginConfig) discoverExternalComponents(path string) error { - var err error - log.Printf("[TRACE] discovering plugins in %s", path) - - if !filepath.IsAbs(path) { - path, err = filepath.Abs(path) - if err != nil { - return err - } - } - var externallyUsed []string - - pluginPaths, err := c.discoverSingle(filepath.Join(path, "packer-builder-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.Builders.Set(pluginName, func() (packersdk.Builder, error) { - return c.Client(newPath).Builder() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("[INFO] using external builders: %v", externallyUsed) - externallyUsed = nil - } - - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-post-processor-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.PostProcessors.Set(pluginName, func() (packersdk.PostProcessor, error) { - return c.Client(newPath).PostProcessor() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("using external post-processors %v", externallyUsed) - externallyUsed = nil - } - - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-provisioner-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.Provisioners.Set(pluginName, func() (packersdk.Provisioner, error) { - return c.Client(newPath).Provisioner() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("using external provisioners %v", externallyUsed) - externallyUsed = nil - } - - pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-datasource-*")) - if err != nil { - return err - } - for pluginName, pluginPath := range pluginPaths { - newPath := pluginPath // this needs to be stored in a new variable for the func below - c.DataSources.Set(pluginName, func() (packersdk.Datasource, error) { - return c.Client(newPath).Datasource() - }) - externallyUsed = append(externallyUsed, pluginName) - } - if len(externallyUsed) > 0 { - sort.Strings(externallyUsed) - log.Printf("using external datasource %v", externallyUsed) - } - - return nil -} - func (c *PluginConfig) discoverLegacyMonoComponents(path string) error { var err error log.Printf("[TRACE] discovering plugins in %s", path) From a2930bda4fb9863687bd614ea3b875604d1acda0 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 11 Jul 2023 15:41:37 -0400 Subject: [PATCH 22/92] packer: warn on bundled plugins usage Since bundled plugins will be removed in an upcoming version of Packer, this commit adds a new warning message whenever a template uses one such plugin. This warning has been implemented on build, validate, console and the inspect subcommands. In addition to warning about the upcoming change and potential issue this will cause, this warning message proposes solutions to the user so they know what they'll have to do in order not to rely on those bundled plugins later. --- acctest/plugin/bundled_plugin_test.go | 181 ++++++++++++++++++ .../test-fixtures/basic_amazon_bundled.json | 10 + .../basic_amazon_bundled.pkr.hcl | 11 ++ ...basic_amazon_with_required_plugins.pkr.hcl | 20 ++ command/build.go | 10 +- command/meta.go | 175 +++++++++++++++++ command/validate.go | 10 +- command/vendored_plugins.go | 168 ++++++++++++++++ config.go | 4 + hcl2template/parser.go | 15 +- hcl2template/plugin.go | 2 +- packer/core.go | 6 + packer/run_interfaces.go | 7 + 13 files changed, 603 insertions(+), 16 deletions(-) create mode 100644 acctest/plugin/bundled_plugin_test.go create mode 100644 acctest/plugin/test-fixtures/basic_amazon_bundled.json create mode 100644 acctest/plugin/test-fixtures/basic_amazon_bundled.pkr.hcl create mode 100644 acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl diff --git a/acctest/plugin/bundled_plugin_test.go b/acctest/plugin/bundled_plugin_test.go new file mode 100644 index 00000000000..e9308a59869 --- /dev/null +++ b/acctest/plugin/bundled_plugin_test.go @@ -0,0 +1,181 @@ +package plugin + +import ( + _ "embed" + "errors" + "fmt" + "os" + "os/exec" + "strings" + "testing" + + "github.com/hashicorp/go-multierror" + amazonacc "github.com/hashicorp/packer-plugin-amazon/builder/ebs/acceptance" + "github.com/hashicorp/packer-plugin-sdk/acctest" + "github.com/hashicorp/packer/hcl2template/addrs" +) + +//go:embed test-fixtures/basic_amazon_bundled.pkr.hcl +var basicAmazonBundledEbsTemplate string + +func TestAccBuildBundledPlugins(t *testing.T) { + plugin := addrs.Plugin{ + Hostname: "github.com", + Namespace: "hashicorp", + Type: "amazon", + } + testCase := &acctest.PluginTestCase{ + Name: "amazon-ebs_bundled_test", + Setup: func() error { + return cleanupPluginInstallation(plugin) + }, + Teardown: func() error { + helper := amazonacc.AMIHelper{ + Region: "us-east-1", + Name: "packer-plugin-bundled-amazon-ebs-test", + } + return helper.CleanUpAmi() + }, + Template: basicAmazonBundledEbsTemplate, + Type: "amazon-ebs", + Init: false, + Check: func(buildCommand *exec.Cmd, logfile string) error { + if buildCommand.ProcessState != nil { + if buildCommand.ProcessState.ExitCode() != 0 { + return fmt.Errorf("Bad exit code. Logfile: %s", logfile) + } + } + + rawLogs, err := os.ReadFile(logfile) + if err != nil { + return fmt.Errorf("failed to read logs: %s", err) + } + + var errs error + + logs := string(rawLogs) + + if !strings.Contains(logs, "Warning: Bundled plugins used") { + errs = multierror.Append(errs, errors.New("expected warning about bundled plugins used, did not find it")) + } + + if !strings.Contains(logs, "Then run 'packer init' to manage installation of the plugins") { + errs = multierror.Append(errs, errors.New("expected suggestion about packer init in logs, did not find it.")) + } + + return errs + }, + } + + acctest.TestPlugin(t, testCase) +} + +//go:embed test-fixtures/basic_amazon_with_required_plugins.pkr.hcl +var basicAmazonRequiredPluginEbsTemplate string + +func TestAccBuildBundledPluginsWithRequiredPlugins(t *testing.T) { + plugin := addrs.Plugin{ + Hostname: "github.com", + Namespace: "hashicorp", + Type: "amazon", + } + testCase := &acctest.PluginTestCase{ + Name: "amazon-ebs_with_required_plugins_test", + Setup: func() error { + return cleanupPluginInstallation(plugin) + }, + Teardown: func() error { + helper := amazonacc.AMIHelper{ + Region: "us-east-1", + Name: "packer-plugin-required-plugin-amazon-ebs-test", + } + return helper.CleanUpAmi() + }, + Template: basicAmazonRequiredPluginEbsTemplate, + Type: "amazon-ebs", + Init: false, + Check: func(buildCommand *exec.Cmd, logfile string) error { + if buildCommand.ProcessState != nil { + if buildCommand.ProcessState.ExitCode() != 1 { + return fmt.Errorf("Bad exit code. Logfile: %s", logfile) + } + } + + rawLogs, err := os.ReadFile(logfile) + if err != nil { + return fmt.Errorf("failed to read logs: %s", err) + } + + var errs error + + logs := string(rawLogs) + + if strings.Contains(logs, "Warning: Bundled plugins used") { + errs = multierror.Append(errs, errors.New("did not expect warning about bundled plugins used")) + } + + if !strings.Contains(logs, "Missing plugins") { + errs = multierror.Append(errs, errors.New("expected error about plugins required and not installed, did not find it")) + } + + return errs + }, + } + + acctest.TestPlugin(t, testCase) +} + +//go:embed test-fixtures/basic_amazon_bundled.json +var basicAmazonBundledEbsTemplateJSON string + +func TestAccBuildBundledPluginsJSON(t *testing.T) { + plugin := addrs.Plugin{ + Hostname: "github.com", + Namespace: "hashicorp", + Type: "amazon", + } + testCase := &acctest.PluginTestCase{ + Name: "amazon-ebs_bundled_test_json", + Setup: func() error { + return cleanupPluginInstallation(plugin) + }, + Teardown: func() error { + helper := amazonacc.AMIHelper{ + Region: "us-east-1", + Name: "packer-plugin-bundled-amazon-ebs-test-json", + } + return helper.CleanUpAmi() + }, + Template: basicAmazonBundledEbsTemplateJSON, + Type: "amazon-ebs", + Init: false, + Check: func(buildCommand *exec.Cmd, logfile string) error { + if buildCommand.ProcessState != nil { + if buildCommand.ProcessState.ExitCode() != 0 { + return fmt.Errorf("Bad exit code. Logfile: %s", logfile) + } + } + + rawLogs, err := os.ReadFile(logfile) + if err != nil { + return fmt.Errorf("failed to read logs: %s", err) + } + + var errs error + + logs := string(rawLogs) + + if !strings.Contains(logs, "Warning: Bundled plugins used") { + errs = multierror.Append(errs, errors.New("expected warning about bundled plugins, did not find it.")) + } + + if !strings.Contains(logs, "plugins with the 'packer plugins install' command") { + errs = multierror.Append(errs, errors.New("expected suggestion about packer plugins install in logs, did not find it.")) + } + + return errs + }, + } + + acctest.TestPlugin(t, testCase) +} diff --git a/acctest/plugin/test-fixtures/basic_amazon_bundled.json b/acctest/plugin/test-fixtures/basic_amazon_bundled.json new file mode 100644 index 00000000000..f674cd130d1 --- /dev/null +++ b/acctest/plugin/test-fixtures/basic_amazon_bundled.json @@ -0,0 +1,10 @@ +{ + "builders": [{ + "type": "amazon-ebs", + "region": "us-east-1", + "instance_type": "m3.medium", + "source_ami": "ami-76b2a71e", + "ssh_username": "ubuntu", + "ami_name": "packer-plugin-bundled-amazon-ebs-test-json" + }] +} diff --git a/acctest/plugin/test-fixtures/basic_amazon_bundled.pkr.hcl b/acctest/plugin/test-fixtures/basic_amazon_bundled.pkr.hcl new file mode 100644 index 00000000000..c17a09df04f --- /dev/null +++ b/acctest/plugin/test-fixtures/basic_amazon_bundled.pkr.hcl @@ -0,0 +1,11 @@ +source "amazon-ebs" "basic-test" { + region = "us-east-1" + instance_type = "m3.medium" + source_ami = "ami-76b2a71e" + ssh_username = "ubuntu" + ami_name = "packer-plugin-bundled-amazon-ebs-test" +} + +build { + sources = ["source.amazon-ebs.basic-test"] +} diff --git a/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl b/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl new file mode 100644 index 00000000000..f9ba5a55b2c --- /dev/null +++ b/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl @@ -0,0 +1,20 @@ +packer { + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon", + version = "~> 1" + } + } +} + +source "amazon-ebs" "basic-test" { + region = "us-east-1" + instance_type = "m3.medium" + source_ami = "ami-76b2a71e" + ssh_username = "ubuntu" + ami_name = "packer-plugin-bundled-amazon-ebs-test" +} + +build { + sources = ["source.amazon-ebs.basic-test"] +} diff --git a/command/build.go b/command/build.go index b707fe22d6f..842938adcb9 100644 --- a/command/build.go +++ b/command/build.go @@ -87,7 +87,15 @@ func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int return ret } - diags := packerStarter.Initialize(packer.InitializeOptions{}) + diags := packerStarter.DetectPluginBinaries() + ret = writeDiags(c.Ui, nil, diags) + if ret != 0 { + return ret + } + + diags = packerStarter.Initialize(packer.InitializeOptions{}) + bundledDiags := c.DetectBundledPlugins(packerStarter) + diags = append(bundledDiags, diags...) ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret diff --git a/command/meta.go b/command/meta.go index 99123fd8ec7..1579d152237 100644 --- a/command/meta.go +++ b/command/meta.go @@ -9,7 +9,9 @@ import ( "fmt" "io" "os" + "strings" + "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclparse" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/template" @@ -179,3 +181,176 @@ func (m *Meta) GetConfigFromJSON(cla *MetaArgs) (packer.Handler, int) { } return core, ret } + +func (m *Meta) DetectBundledPlugins(handler packer.Handler) hcl.Diagnostics { + var plugins []string + + switch h := handler.(type) { + case *packer.Core: + plugins = m.detectBundledPluginsJSON(h) + case *hcl2template.PackerConfig: + plugins = m.detectBundledPluginsHCL2(handler.(*hcl2template.PackerConfig)) + } + + if len(plugins) == 0 { + return nil + } + + buf := &strings.Builder{} + buf.WriteString("This template relies on the use of plugins bundled into the Packer binary.\n") + buf.WriteString("The practice of bundling external plugins into Packer will be removed in an upcoming version.\n\n") + switch h := handler.(type) { + case *packer.Core: + buf.WriteString("To remove this warning and ensure builds keep working you can install these external plugins with the 'packer plugins install' command\n\n") + + for _, plugin := range plugins { + fmt.Fprintf(buf, "* packer plugins install %s\n", plugin) + } + + buf.WriteString("\nAlternatively, if you upgrade your templates to HCL2, you can use 'packer init' with a 'required_plugins' block to automatically install external plugins.\n\n") + fmt.Fprintf(buf, "You can try HCL2 by running 'packer hcl2_upgrade %s'", h.Template.Path) + case *hcl2template.PackerConfig: + buf.WriteString("To remove this warning, add the following section to your template:\n") + buf.WriteString(m.fixRequiredPlugins(h)) + buf.WriteString("\nThen run 'packer init' to manage installation of the plugins") + } + + return hcl.Diagnostics{ + &hcl.Diagnostic{ + Severity: hcl.DiagWarning, + Summary: "Bundled plugins used", + Detail: buf.String(), + }, + } +} + +func (m *Meta) detectBundledPluginsJSON(core *packer.Core) []string { + bundledPlugins := map[string]struct{}{} + + tmpl := core.Template + if tmpl == nil { + panic("No template parsed. This is a Packer bug which should be reported, please open an issue on the project's issue tracker.") + } + + for _, b := range tmpl.Builders { + builderType := fmt.Sprintf("packer-builder-%s", b.Type) + if bundledStatus[builderType] { + bundledPlugins[builderType] = struct{}{} + } + } + + for _, p := range tmpl.Provisioners { + provisionerType := fmt.Sprintf("packer-provisioner-%s", p.Type) + if bundledStatus[provisionerType] { + bundledPlugins[provisionerType] = struct{}{} + } + } + + for _, pps := range tmpl.PostProcessors { + for _, pp := range pps { + postProcessorType := fmt.Sprintf("packer-post-processor-%s", pp.Type) + if bundledStatus[postProcessorType] { + bundledPlugins[postProcessorType] = struct{}{} + } + } + } + + return compileBundledPluginList(bundledPlugins) +} + +var knownPluginPrefixes = map[string]string{ + "amazon": "github.com/hashicorp/amazon", + "ansible": "github.com/hashicorp/ansible", + "azure": "github.com/hashicorp/azure", + "docker": "github.com/hashicorp/docker", + "googlecompute": "github.com/hashicorp/googlecompute", + "qemu": "github.com/hashicorp/qemu", + "vagrant": "github.com/hashicorp/vagrant", + "vmware": "github.com/hashicorp/vmware", + "vsphere": "github.com/hashicorp/vsphere", +} + +func (m *Meta) fixRequiredPlugins(config *hcl2template.PackerConfig) string { + plugins := map[string]struct{}{} + + for _, b := range config.Builds { + for _, b := range b.Sources { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(b.Type, prefix) { + plugins[plugin] = struct{}{} + } + } + } + + for _, p := range b.ProvisionerBlocks { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(p.PType, prefix) { + plugins[plugin] = struct{}{} + } + } + } + + for _, pps := range b.PostProcessorsLists { + for _, pp := range pps { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(pp.PType, prefix) { + plugins[plugin] = struct{}{} + } + } + } + } + } + + for _, ds := range config.Datasources { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(ds.Type, prefix) { + plugins[plugin] = struct{}{} + } + } + } + + retPlugins := make([]string, 0, len(plugins)) + for plugin := range plugins { + retPlugins = append(retPlugins, plugin) + } + + return generateRequiredPluginsBlock(retPlugins) +} + +func (m *Meta) detectBundledPluginsHCL2(config *hcl2template.PackerConfig) []string { + bundledPlugins := map[string]struct{}{} + + for _, b := range config.Builds { + for _, src := range b.Sources { + builderType := fmt.Sprintf("packer-builder-%s", src.Type) + if bundledStatus[builderType] { + bundledPlugins[builderType] = struct{}{} + } + } + + for _, p := range b.ProvisionerBlocks { + provisionerType := fmt.Sprintf("packer-provisioner-%s", p.PType) + if bundledStatus[provisionerType] { + bundledPlugins[provisionerType] = struct{}{} + } + } + + for _, pps := range b.PostProcessorsLists { + for _, pp := range pps { + postProcessorType := fmt.Sprintf("packer-post-processor-%s", pp.PType) + if bundledStatus[postProcessorType] { + bundledPlugins[postProcessorType] = struct{}{} + } + } + } + } + + for _, ds := range config.Datasources { + dsType := fmt.Sprintf("packer-datasource-%s", ds.Type) + if bundledStatus[dsType] { + bundledPlugins[dsType] = struct{}{} + } + } + + return compileBundledPluginList(bundledPlugins) +} diff --git a/command/validate.go b/command/validate.go index 1bc4cc1d7eb..2b7e2107b0d 100644 --- a/command/validate.go +++ b/command/validate.go @@ -65,9 +65,17 @@ func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int return 0 } - diags := packerStarter.Initialize(packer.InitializeOptions{ + diags := packerStarter.DetectPluginBinaries() + ret = writeDiags(c.Ui, nil, diags) + if ret != 0 { + return ret + } + + diags = packerStarter.Initialize(packer.InitializeOptions{ SkipDatasourcesExecution: !cla.EvaluateDatasources, }) + bundledDiags := c.DetectBundledPlugins(packerStarter) + diags = append(bundledDiags, diags...) ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go index 0718b91a7c5..d6e5f836338 100644 --- a/command/vendored_plugins.go +++ b/command/vendored_plugins.go @@ -4,6 +4,10 @@ package command import ( + "fmt" + "log" + "strings" + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" // Previously core-bundled components, split into their own plugins but @@ -102,6 +106,170 @@ var VendoredPostProcessors = map[string]packersdk.PostProcessor{ "vsphere": new(vspherepostprocessor.PostProcessor), } +// bundledStatus is used to know if one of the bundled components is loaded from +// an external plugin, or from the bundled plugins. +// +// We keep track of this to produce a warning if a user relies on one +// such plugin, as they will be removed in a later version of Packer. +var bundledStatus = map[string]bool{ + "packer-builder-amazon-ebs": false, + "packer-builder-amazon-chroot": false, + "packer-builder-amazon-ebssurrogate": false, + "packer-builder-amazon-ebsvolume": false, + "packer-builder-amazon-instance": false, + "packer-post-processor-amazon-import": false, + "packer-datasource-amazon-ami": false, + "packer-datasource-amazon-secretsmanager": false, + + "packer-provisioner-ansible": false, + "packer-provisioner-ansible-local": false, + + "packer-provisioner-azure-dtlartifact": false, + "packer-builder-azure-arm": false, + "packer-builder-azure-chroot": false, + "packer-builder-azure-dtl": false, + + "packer-builder-docker": false, + "packer-post-processor-docker-import": false, + "packer-post-processor-docker-push": false, + "packer-post-processor-docker-save": false, + "packer-post-processor-docker-tag": false, + + "packer-builder-googlecompute": false, + "packer-post-processor-googlecompute-export": false, + "packer-post-processor-googlecompute-import": false, + + "packer-builder-qemu": false, + + "packer-builder-vagrant": false, + "packer-post-processor-vagrant": false, + "packer-post-processor-vagrant-cloud": false, + + "packer-builder-virtualbox-iso": false, + "packer-builder-virtualbox-ovf": false, + "packer-builder-virtualbox-vm": false, + + "packer-builder-vmware-iso": false, + "packer-builder-vmware-vmx": false, + + "packer-builder-vsphere-clone": false, + "packer-builder-vsphere-iso": false, + "packer-post-processor-vsphere-template": false, + "packer-post-processor-vsphere": false, +} + +// TrackBundledPlugin marks a component as loaded from Packer's bundled plugins +// instead of from an externally loaded plugin. +// +// NOTE: `pluginName' must be in the format `packer--' +func TrackBundledPlugin(pluginName string) { + _, exists := bundledStatus[pluginName] + if !exists { + return + } + + bundledStatus[pluginName] = true +} + +var componentPluginMap = map[string]string{ + "packer-builder-amazon-ebs": "github.com/hashicorp/amazon", + "packer-builder-amazon-chroot": "github.com/hashicorp/amazon", + "packer-builder-amazon-ebssurrogate": "github.com/hashicorp/amazon", + "packer-builder-amazon-ebsvolume": "github.com/hashicorp/amazon", + "packer-builder-amazon-instance": "github.com/hashicorp/amazon", + "packer-post-processor-amazon-import": "github.com/hashicorp/amazon", + "packer-datasource-amazon-ami": "github.com/hashicorp/amazon", + "packer-datasource-amazon-secretsmanager": "github.com/hashicorp/amazon", + + "packer-provisioner-ansible": "github.com/hashicorp/ansible", + "packer-provisioner-ansible-local": "github.com/hashicorp/ansible", + + "packer-provisioner-azure-dtlartifact": "github.com/hashicorp/azure", + "packer-builder-azure-arm": "github.com/hashicorp/azure", + "packer-builder-azure-chroot": "github.com/hashicorp/azure", + "packer-builder-azure-dtl": "github.com/hashicorp/azure", + + "packer-builder-docker": "github.com/hashicorp/docker", + "packer-post-processor-docker-import": "github.com/hashicorp/docker", + "packer-post-processor-docker-push": "github.com/hashicorp/docker", + "packer-post-processor-docker-save": "github.com/hashicorp/docker", + "packer-post-processor-docker-tag": "github.com/hashicorp/docker", + + "packer-builder-googlecompute": "github.com/hashicorp/googlecompute", + "packer-post-processor-googlecompute-export": "github.com/hashicorp/googlecompute", + "packer-post-processor-googlecompute-import": "github.com/hashicorp/googlecompute", + + "packer-builder-qemu": "github.com/hashicorp/qemu", + + "packer-builder-vagrant": "github.com/hashicorp/vagrant", + "packer-post-processor-vagrant": "github.com/hashicorp/vagrant", + "packer-post-processor-vagrant-cloud": "github.com/hashicorp/vagrant", + + "packer-builder-virtualbox-iso": "github.com/hashicorp/virtualbox", + "packer-builder-virtualbox-ovf": "github.com/hashicorp/virtualbox", + "packer-builder-virtualbox-vm": "github.com/hashicorp/virtualbox", + + "packer-builder-vmware-iso": "github.com/hashicorp/vmware", + "packer-builder-vmware-vmx": "github.com/hashicorp/vmware", + + "packer-builder-vsphere-clone": "github.com/hashicorp/vsphere", + "packer-builder-vsphere-iso": "github.com/hashicorp/vsphere", + "packer-post-processor-vsphere-template": "github.com/hashicorp/vsphere", + "packer-post-processor-vsphere": "github.com/hashicorp/vsphere", +} + +// compileBundledPluginList returns a list of plugins to import in a config +// +// This only works on bundled plugins and serves as a way to inform users that +// they should not rely on a bundled plugin anymore, but give them recommendations +// on how to manage those plugins instead. +func compileBundledPluginList(componentMap map[string]struct{}) []string { + plugins := map[string]struct{}{} + for component := range componentMap { + plugin, ok := componentPluginMap[component] + if !ok { + log.Printf("Unknown bundled plugin component: %q", component) + continue + } + + plugins[plugin] = struct{}{} + } + + pluginList := make([]string, 0, len(plugins)) + for plugin := range plugins { + pluginList = append(pluginList, plugin) + } + + return pluginList +} + +func generateRequiredPluginsBlock(plugins []string) string { + if len(plugins) == 0 { + return "" + } + + buf := &strings.Builder{} + buf.WriteString(` +packer { + required_plugins {`) + + for _, plugin := range plugins { + pluginName := strings.Replace(plugin, "github.com/hashicorp/", "", 1) + fmt.Fprintf(buf, ` + %s = { + source = %q + version = "~> 1" + }`, pluginName, plugin) + } + + buf.WriteString(` + } +} +`) + + return buf.String() +} + // Upon init lets load up any plugins that were vendored manually into the default // set of plugins. func init() { diff --git a/config.go b/config.go index 6b59b98fe63..af679dd8e0b 100644 --- a/config.go +++ b/config.go @@ -153,6 +153,7 @@ func (c *config) discoverInternalComponents() error { for builder := range command.Builders { builder := builder if !c.Plugins.Builders.Has(builder) { + command.TrackBundledPlugin(fmt.Sprintf("packer-builder-%s", builder)) bin := fmt.Sprintf("%s%splugin%spacker-builder-%s", packerPath, PACKERSPACE, PACKERSPACE, builder) c.Plugins.Builders.Set(builder, func() (packersdk.Builder, error) { @@ -164,6 +165,7 @@ func (c *config) discoverInternalComponents() error { for provisioner := range command.Provisioners { provisioner := provisioner if !c.Plugins.Provisioners.Has(provisioner) { + command.TrackBundledPlugin(fmt.Sprintf("packer-provisioner-%s", provisioner)) bin := fmt.Sprintf("%s%splugin%spacker-provisioner-%s", packerPath, PACKERSPACE, PACKERSPACE, provisioner) c.Plugins.Provisioners.Set(provisioner, func() (packersdk.Provisioner, error) { @@ -175,6 +177,7 @@ func (c *config) discoverInternalComponents() error { for postProcessor := range command.PostProcessors { postProcessor := postProcessor if !c.Plugins.PostProcessors.Has(postProcessor) { + command.TrackBundledPlugin(fmt.Sprintf("packer-post-processor-%s", postProcessor)) bin := fmt.Sprintf("%s%splugin%spacker-post-processor-%s", packerPath, PACKERSPACE, PACKERSPACE, postProcessor) c.Plugins.PostProcessors.Set(postProcessor, func() (packersdk.PostProcessor, error) { @@ -186,6 +189,7 @@ func (c *config) discoverInternalComponents() error { for dataSource := range command.Datasources { dataSource := dataSource if !c.Plugins.DataSources.Has(dataSource) { + command.TrackBundledPlugin(fmt.Sprintf("packer-datasource-%s", dataSource)) bin := fmt.Sprintf("%s%splugin%spacker-datasource-%s", packerPath, PACKERSPACE, PACKERSPACE, dataSource) c.Plugins.DataSources.Set(dataSource, func() (packersdk.Datasource, error) { diff --git a/hcl2template/parser.go b/hcl2template/parser.go index 2246131fa88..a724bb807bd 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -308,19 +308,8 @@ func filterVarsFromLogs(inputOrLocal Variables) { } func (cfg *PackerConfig) Initialize(opts packer.InitializeOptions) hcl.Diagnostics { - var diags hcl.Diagnostics - - // enable packer to start plugins requested in required_plugins. - moreDiags := cfg.detectPluginBinaries() - diags = append(diags, moreDiags...) - if moreDiags.HasErrors() { - return diags - } - - moreDiags = cfg.InputVariables.ValidateValues() - diags = append(diags, moreDiags...) - moreDiags = cfg.LocalVariables.ValidateValues() - diags = append(diags, moreDiags...) + diags := cfg.InputVariables.ValidateValues() + diags = append(diags, cfg.LocalVariables.ValidateValues()...) diags = append(diags, cfg.evaluateDatasources(opts.SkipDatasourcesExecution)...) diags = append(diags, checkForDuplicateLocalDefinition(cfg.LocalBlocks)...) diags = append(diags, cfg.evaluateLocalVariables(cfg.LocalBlocks)...) diff --git a/hcl2template/plugin.go b/hcl2template/plugin.go index 1c32ef7779e..4a5c0186647 100644 --- a/hcl2template/plugin.go +++ b/hcl2template/plugin.go @@ -55,7 +55,7 @@ func (cfg *PackerConfig) PluginRequirements() (plugingetter.Requirements, hcl.Di return reqs, diags } -func (cfg *PackerConfig) detectPluginBinaries() hcl.Diagnostics { +func (cfg *PackerConfig) DetectPluginBinaries() hcl.Diagnostics { opts := plugingetter.ListInstallationsOptions{ FromFolders: cfg.parser.PluginConfig.KnownPluginFolders, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ diff --git a/packer/core.go b/packer/core.go index 4d62cce6bc3..b711af080bc 100644 --- a/packer/core.go +++ b/packer/core.go @@ -132,6 +132,12 @@ func NewCore(c *CoreConfig) *Core { return core } +// DetectPluginBinaries is used to load required plugins from the template, +// since it is unsupported in JSON, this is essentially a no-op. +func (c *Core) DetectPluginBinaries() hcl.Diagnostics { + return nil +} + func (c *Core) Initialize(_ InitializeOptions) hcl.Diagnostics { err := c.initialize() if err != nil { diff --git a/packer/run_interfaces.go b/packer/run_interfaces.go index 5bf1151529c..253998c20a4 100644 --- a/packer/run_interfaces.go +++ b/packer/run_interfaces.go @@ -40,6 +40,12 @@ type InitializeOptions struct { SkipDatasourcesExecution bool } +type PluginBinaryDetector interface { + // DetectPluginBinaries is used only for HCL2 templates, and loads required + // plugins if specified. + DetectPluginBinaries() hcl.Diagnostics +} + // The Handler handles all Packer things. This interface reflects the Packer // commands, ex: init, console ( evaluate ), fix config, inspect config, etc. To // run a build we will start the builds and then the core of Packer handles @@ -53,6 +59,7 @@ type Handler interface { BuildGetter ConfigFixer ConfigInspector + PluginBinaryDetector } //go:generate enumer -type FixConfigMode From b522edca36cdbc33c3c24c8659d0b4e69682b4e0 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 14 Jul 2023 17:11:54 -0400 Subject: [PATCH 23/92] hcl2_upgrade: add required_plugins in out template When a legacy JSON template references built-in plugins, we add them to the resulting template as a `required_plugins' block in HCL2. --- command/hcl2_upgrade.go | 85 ++++++++++++++++++- command/hcl2_upgrade_test.go | 1 + .../hcl2_upgrade/ami_test/expected.pkr.hcl | 8 ++ .../aws-access-config/expected.pkr.hcl | 6 ++ .../hcl2_upgrade/azure_shg/expected.pkr.hcl | 8 ++ .../bundled-plugin-used/expected.pkr.hcl | 29 +++++++ .../bundled-plugin-used/input.json | 11 +++ .../hcl2_upgrade/complete/expected.pkr.hcl | 6 ++ .../hcl2_upgrade/minimal/expected.pkr.hcl | 6 ++ .../hcl2_upgrade/source-name/expected.pkr.hcl | 6 ++ .../expected.pkr.hcl | 8 ++ .../without-annotations/expected.pkr.hcl | 6 ++ 12 files changed, 176 insertions(+), 4 deletions(-) create mode 100644 command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl create mode 100644 command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index adba96d7f87..08b7d2ad745 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -797,16 +797,93 @@ type PackerParser struct { } func (p *PackerParser) Parse(tpl *template.Template) error { + reqPlugins, err := p.generateRequiredPluginsBlock(tpl) + if err != nil { + return err + } + + if tpl.MinVersion == "" && reqPlugins == nil { + return nil + } + + fileContent := hclwrite.NewEmptyFile() + body := fileContent.Body() + packerBody := body.AppendNewBlock("packer", nil).Body() + if tpl.MinVersion != "" { - fileContent := hclwrite.NewEmptyFile() - body := fileContent.Body() - packerBody := body.AppendNewBlock("packer", nil).Body() packerBody.SetAttributeValue("required_version", cty.StringVal(fmt.Sprintf(">= %s", tpl.MinVersion))) - p.out = fileContent.Bytes() } + + if reqPlugins != nil { + packerBody.AppendBlock(reqPlugins) + } + + p.out = fileContent.Bytes() + return nil } +func gatherPluginsFromTemplate(tpl *template.Template) []string { + plugins := map[string]struct{}{} + + for _, b := range tpl.Builders { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(b.Type, prefix) { + plugins[plugin] = struct{}{} + } + } + } + + for _, p := range tpl.Provisioners { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(p.Type, prefix) { + plugins[plugin] = struct{}{} + } + } + } + + for _, pps := range tpl.PostProcessors { + for _, pp := range pps { + for prefix, plugin := range knownPluginPrefixes { + if strings.HasPrefix(pp.Type, prefix) { + plugins[plugin] = struct{}{} + } + } + } + } + + if len(plugins) == 0 { + return nil + } + + retPlugins := make([]string, 0, len(plugins)) + for plugin := range plugins { + retPlugins = append(retPlugins, plugin) + } + + sort.Strings(retPlugins) + + return retPlugins +} + +func (p *PackerParser) generateRequiredPluginsBlock(tpl *template.Template) (*hclwrite.Block, error) { + plugins := gatherPluginsFromTemplate(tpl) + if len(plugins) == 0 { + return nil, nil + } + + reqPlugins := hclwrite.NewBlock("required_plugins", nil) + for _, plugin := range plugins { + pluginBlock := cty.ObjectVal(map[string]cty.Value{ + "source": cty.StringVal(plugin), + "version": cty.StringVal("~> 1"), + }) + reqPlugins.Body().SetAttributeValue(strings.Replace(plugin, "github.com/hashicorp/", "", 1), pluginBlock) + } + + return reqPlugins, nil +} + func (p *PackerParser) Write(out *bytes.Buffer) { if len(p.out) > 0 { if p.WithAnnotations { diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index d2f92b6b690..afa8575aa8e 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -38,6 +38,7 @@ func Test_hcl2_upgrade(t *testing.T) { {folder: "complete-variables-with-template-engine", flags: []string{}}, {folder: "undeclared-variables", flags: []string{}, exitCode: 0}, {folder: "varfile-with-no-variables-block", flags: []string{}, exitCode: 0}, + {folder: "bundled-plugin-used", flags: []string{}, exitCode: 0}, } for _, tc := range tc { diff --git a/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl index 72ccb20383c..8a72f3551b0 100644 --- a/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl @@ -1,3 +1,11 @@ +packer { + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } +} source "amazon-ebs" "autogenerated_1" { run_tags = { diff --git a/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl index 9ccbe9dc2fc..8c34e4735b3 100644 --- a/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/aws-access-config/expected.pkr.hcl @@ -1,5 +1,11 @@ packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } variable "aws_access_key" { diff --git a/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl index 089ce80a781..15d5a4ad33e 100644 --- a/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl @@ -1,3 +1,11 @@ +packer { + required_plugins { + azure = { + source = "github.com/hashicorp/azure" + version = "~> 1" + } + } +} source "azure-arm" "autogenerated_1" { shared_image_gallery { diff --git a/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl new file mode 100644 index 00000000000..cce175b01bd --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl @@ -0,0 +1,29 @@ +packer { + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + ansible = { + source = "github.com/hashicorp/ansible" + version = "~> 1" + } + googlecompute = { + source = "github.com/hashicorp/googlecompute" + version = "~> 1" + } + } +} + +source "amazon-ebs" "autogenerated_1" { +} + +build { + sources = ["source.amazon-ebs.autogenerated_1"] + + provisioner "ansible-local" { + } + + post-processor "googlecompute-import" { + } +} diff --git a/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json new file mode 100644 index 00000000000..917c7105e5a --- /dev/null +++ b/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json @@ -0,0 +1,11 @@ +{ + "builders": [{ + "type": "amazon-ebs" + }], + "provisioners": [{ + "type": "ansible-local" + }], + "post-processors": [{ + "type": "googlecompute-import" + }] +} diff --git a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl index bcc669b6438..a6800c67210 100644 --- a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl @@ -14,6 +14,12 @@ # See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } # All generated input variables will be of 'string' type as this is how Packer JSON diff --git a/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl index 2802e8e18b0..316293c39e7 100644 --- a/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl @@ -14,6 +14,12 @@ # See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } # All generated input variables will be of 'string' type as this is how Packer JSON diff --git a/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl index b5adf8ef55b..c4145f7d145 100644 --- a/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl @@ -14,6 +14,12 @@ # See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } # All generated input variables will be of 'string' type as this is how Packer JSON diff --git a/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl index a160d0c9eed..16c3c21ca24 100644 --- a/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/vsphere_linux_options_and_network_interface/expected.pkr.hcl @@ -1,3 +1,11 @@ +packer { + required_plugins { + vsphere = { + source = "github.com/hashicorp/vsphere" + version = "~> 1" + } + } +} source "vsphere-clone" "autogenerated_1" { RAM_reserve_all = false diff --git a/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl index e332c21e08f..414ebc55a96 100644 --- a/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl @@ -1,5 +1,11 @@ packer { required_version = ">= 1.6.0" + required_plugins { + amazon = { + source = "github.com/hashicorp/amazon" + version = "~> 1" + } + } } variable "aws_access_key" { From 6e764658b7722aa09e7a825f5d6a126bfa268797 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Tue, 18 Jul 2023 16:14:35 -0400 Subject: [PATCH 24/92] Makefile: remove mode-check target (#12505) The Makefile would check for executable files inside the Packer repository, and produce errors if one was detected and not explicitely whitelisted through the `EXECUTABLE_FILES' Makefile variable. This check was introduced a while back to avoid having executable files in the repository, but this check can be problematic sometimes because of how it is written, namely when building the website, which causes a lot of JS executable files to appear in the hierarchy, and in turn this causes the shell expansion to fail because of the large number of arguments. Since this test is not necessary for Packer to build or test, and since it implies that we have to maintain the whitelist regex, we remove it from the Makefile. --- Makefile | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index ad6cfd3a28a..01d62f0053c 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,6 @@ GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) GOPATH=$(shell go env GOPATH) -EXECUTABLE_FILES=$(shell find . -type f -executable | egrep -v '^\./(website/[vendor|tmp]|vendor/|\.git|bin/|scripts/|pkg/)' | egrep -v '.*(\.sh|\.bats|\.git)' | egrep -v './provisioner/(ansible|inspec)/test-fixtures/exit1') - # Get the git commit GIT_DIRTY=$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true) GIT_COMMIT=$(shell git rev-parse --short HEAD) @@ -133,15 +131,6 @@ fmt-check: fmt ## Check go code formatting exit 1; \ fi -mode-check: ## Check that only certain files are executable - @echo "==> Checking that only certain files are executable..." - @if [ ! -z "$(EXECUTABLE_FILES)" ]; then \ - echo "These files should not be executable or they must be white listed in the Makefile:"; \ - echo "$(EXECUTABLE_FILES)" | xargs -n1; \ - exit 1; \ - else \ - echo "Check passed."; \ - fi fmt-docs: @find ./website/pages/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \; @@ -166,7 +155,7 @@ generate-check: generate ## Check go code generation is on par exit 1; \ fi -test: mode-check vet ## Run unit tests +test: vet ## Run unit tests @go test -count $(COUNT) $(TEST) $(TESTARGS) -timeout=3m # acctest runs provisioners acceptance tests @@ -178,7 +167,7 @@ testacc: # install-build-deps generate ## Run acceptance tests @echo "WARN: Acceptance tests will take a long time to run and may cost money. Ctrl-C if you want to cancel." PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) $(TESTARGS) -timeout=120m -testrace: mode-check vet ## Test with race detection enabled +testrace: vet ## Test with race detection enabled @go test -count $(COUNT) -race $(TEST) $(TESTARGS) -timeout=3m -p=8 # Runs code coverage and open a html page with report From 5271c287498556266deb2ffb06f0164bbacf09f1 Mon Sep 17 00:00:00 2001 From: GaryNg Date: Tue, 18 Jul 2023 21:47:06 +0800 Subject: [PATCH 25/92] Add closing code block --- .../docs/templates/hcl_templates/functions/contextual/vault.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx index f36e8f65823..c4b25b9798f 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx @@ -49,6 +49,7 @@ local "foo" { expression = vault("secrets/hello", "foo") sensitive = true } +``` The `local` block example accesses the Vault path `secrets/foo` and returns the value stored at the key `foo`, storing it as the local variable `local.foo`. However, the output of From cc1e2fca782de3e1a854597a6ed51445cba93765 Mon Sep 17 00:00:00 2001 From: GaryNg Date: Tue, 18 Jul 2023 21:52:26 +0800 Subject: [PATCH 26/92] Prefix url with product slug --- .../docs/templates/hcl_templates/functions/contextual/vault.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx index c4b25b9798f..95454cf211c 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx @@ -54,7 +54,7 @@ local "foo" { The `local` block example accesses the Vault path `secrets/foo` and returns the value stored at the key `foo`, storing it as the local variable `local.foo`. However, the output of the newly stored local variable will be filtered from the Packer build output, and replaced -with the value ''. See [Local Values](/docs/templates/hcl_templates/locals) for more details. +with the value ''. See [Local Values](/packer/docs/templates/hcl_templates/locals) for more details. ## Usage From 58b193f221308f6235cca015153543672b0aeede Mon Sep 17 00:00:00 2001 From: GaryNg Date: Wed, 19 Jul 2023 22:55:14 +0800 Subject: [PATCH 27/92] Use backtick to prevent html parsing Co-authored-by: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> --- .../docs/templates/hcl_templates/functions/contextual/vault.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx index 95454cf211c..8136a10114d 100644 --- a/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx +++ b/website/content/docs/templates/hcl_templates/functions/contextual/vault.mdx @@ -54,7 +54,7 @@ local "foo" { The `local` block example accesses the Vault path `secrets/foo` and returns the value stored at the key `foo`, storing it as the local variable `local.foo`. However, the output of the newly stored local variable will be filtered from the Packer build output, and replaced -with the value ''. See [Local Values](/packer/docs/templates/hcl_templates/locals) for more details. +with the value ``. See [Local Values](/packer/docs/templates/hcl_templates/locals) for more details. ## Usage From 0194d839b0ffb1a07ba10e72b693bd12daf9e636 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" <129506189+hashicorp-tsccr[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 13:20:14 -0400 Subject: [PATCH 28/92] Result of tsccr-helper -log-level=info -pin-all-workflows . (#12507) Co-authored-by: hashicorp-tsccr[bot] --- .github/workflows/acceptance-test.yml | 10 +++++----- .github/workflows/auto-close-stale-issues.yml | 2 +- .github/workflows/build.yml | 14 +++++++------- .github/workflows/check-plugin-docs.yml | 4 ++-- .github/workflows/create-release-branch.yml | 2 +- .github/workflows/go-test.yml | 14 +++++++------- .github/workflows/go-validate.yml | 18 +++++++++--------- .github/workflows/issue-comment-created.yml | 2 +- .github/workflows/issue-migrator.yml | 2 +- .github/workflows/issues-opened.yml | 8 ++++---- .github/workflows/jira.yml | 6 +++--- .github/workflows/lock.yml | 2 +- .github/workflows/nightly-release.yml | 12 ++++++------ 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index 98d012cb8d4..783b6bdccde 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -19,7 +19,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: 'Determine Go version' id: get-go-version # We use .go-version as our source of truth for current Go @@ -40,12 +40,12 @@ jobs: # Packer GH Token for API Rate Limiting PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - name: IAM Assume Role - uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 + uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0 with: role-to-assume: ${{ env.AWS_ROLE_ARN }} aws-region: ${{ env.AWS_REGION }} @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 + uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 with: payload: | { diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml index 40b04dec196..af4a089df5d 100644 --- a/.github/workflows/auto-close-stale-issues.yml +++ b/.github/workflows/auto-close-stale-issues.yml @@ -14,7 +14,7 @@ jobs: pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-latest steps: - - uses: actions/stale@a20b814fb01b71def3bd6f56e7494d667ddf28da # v8.0.0 + - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-issue-stale: 23 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 657b9c39ebc..b713ef62393 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: 'Determine Go version' id: get-go-version # We use .go-version as our source of truth for current Go @@ -44,7 +44,7 @@ jobs: product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }} set-ld-flags: ${{ steps.set-ld-flags.outputs.set-ld-flags }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: set product version id: set-product-version uses: hashicorp/actions-set-product-version@v1 @@ -67,7 +67,7 @@ jobs: filepath: ${{ steps.generate-metadata-file.outputs.filepath }} steps: - name: 'Checkout directory' - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Generate metadata file id: generate-metadata-file uses: hashicorp/actions-generate-metadata@main @@ -105,7 +105,7 @@ jobs: GOPRIVATE: "github.com/hashicorp" GO111MODULE: on steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Go Build env: PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} @@ -142,7 +142,7 @@ jobs: GO111MODULE: on steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Go Build env: PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} @@ -204,7 +204,7 @@ jobs: GO111MODULE: on steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Go Build env: PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} @@ -234,7 +234,7 @@ jobs: env: version: ${{ needs.set-product-version.outputs.product-version }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Docker Build (Action) uses: hashicorp/actions-docker-build@v1 with: diff --git a/.github/workflows/check-plugin-docs.yml b/.github/workflows/check-plugin-docs.yml index c43ae9cb33c..00ba2851ef8 100644 --- a/.github/workflows/check-plugin-docs.yml +++ b/.github/workflows/check-plugin-docs.yml @@ -23,9 +23,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 with: node-version: '16.x' - name: Install Dependencies diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index 0d1f4f3953c..780087058b7 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -4,7 +4,7 @@ jobs: create-branch: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - uses: hashicorp/actions-create-release-branch@v1 with: token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 93f8eeb1ae8..2f426d16a03 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -24,7 +24,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: 'Determine Go version' id: get-go-version run: | @@ -36,8 +36,8 @@ jobs: runs-on: ubuntu-latest name: Linux go tests steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci @@ -47,8 +47,8 @@ jobs: runs-on: macos-latest name: Darwin go tests steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go test ./... -coverprofile=coverage.txt -covermode=atomic @@ -58,8 +58,8 @@ jobs: runs-on: windows-latest name: Windows go tests steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go test ./... -coverprofile=coverage.txt -covermode=atomic diff --git a/.github/workflows/go-validate.yml b/.github/workflows/go-validate.yml index d67b3aa5151..a3c45f794ff 100644 --- a/.github/workflows/go-validate.yml +++ b/.github/workflows/go-validate.yml @@ -20,7 +20,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: 'Determine Go version' id: get-go-version run: | @@ -32,8 +32,8 @@ jobs: runs-on: ubuntu-latest name: Go Mod Tidy steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go mod tidy @@ -43,10 +43,10 @@ jobs: runs-on: ubuntu-latest name: Lint steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: fetch-depth: 0 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: echo "$GITHUB_SHA" @@ -59,8 +59,8 @@ jobs: runs-on: ubuntu-latest name: Fmt check steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: make fmt-check @@ -70,8 +70,8 @@ jobs: runs-on: ubuntu-latest name: Generate check steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: make generate-check diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows/issue-comment-created.yml index f250dc1f101..e28ac0d0939 100644 --- a/.github/workflows/issue-comment-created.yml +++ b/.github/workflows/issue-comment-created.yml @@ -14,7 +14,7 @@ jobs: issues: write # for actions-ecosystem/action-remove-labels to remove issue labels runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 with: github_token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/issue-migrator.yml b/.github/workflows/issue-migrator.yml index 9acc66ee6d4..58eed27f22a 100644 --- a/.github/workflows/issue-migrator.yml +++ b/.github/workflows/issue-migrator.yml @@ -12,7 +12,7 @@ jobs: if: startsWith(github.event.label.name, 'remote-plugin/') runs-on: ubuntu-latest steps: - - uses: bflad/action-migrate-issue@main # TSCCR: no entry for repository "bflad/action-migrate-issue" + - uses: bflad/action-migrate-issue@main # TSCCR: no entry for repository "bflad/action-migrate-issue" with: source-issue-comment: | This issue has been migrated to {target-issue-url} due to the [Packer Plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index 57a8cd0cb65..86adfacef1f 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -13,8 +13,8 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - uses: github/issue-labeler@e24a3eb6b2e28c8904d086302a2b760647f5f45c # v3.1 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: github/issue-labeler@98b5412841f6c4b0b3d9c29d53c13fad16bd7de2 # v3.2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-triage.yml @@ -27,7 +27,7 @@ jobs: if: contains(github.event.issue.labels.*.name, 'question') runs-on: ubuntu-latest steps: - - uses: actions-ecosystem/action-create-comment@v1.0.2 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" + - uses: actions-ecosystem/action-create-comment@v1.0.2 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" with: github_token: ${{ secrets.GITHUB_TOKEN }} body: | @@ -39,7 +39,7 @@ jobs: If no activity is taken on this question within 30 days it will be automatically closed. If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. - - uses: actions-ecosystem/action-add-labels@v1.1.3 # TSCCR: no entry for repository "actions-ecosystem/action-add-labels" + - uses: actions-ecosystem/action-add-labels@v1.1.3 # TSCCR: no entry for repository "actions-ecosystem/action-add-labels" with: github_token: ${{ secrets.GITHUB_TOKEN }} labels: needs-reply diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml index e0e82a97f01..a0fe240edb6 100644 --- a/.github/workflows/jira.yml +++ b/.github/workflows/jira.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Login - uses: atlassian/gajira-login@45fd029b9f1d6d8926c6f04175aa80c0e42c9026 # v3.0.1 + uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3 env: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} @@ -61,7 +61,7 @@ jobs: - name: Create ticket id: create-ticket if: steps.search.outputs.issue == '' && github.event.label.name == 'sync to jira' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: atlassian/gajira-create@59e177c4f6451399df5b4911c2211104f171e669 # v3.0.1 + uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3 with: project: HPR issuetype: "${{ steps.set-ticket-type.outputs.type }}" @@ -74,7 +74,7 @@ jobs: - name: Add tracking comment if: steps.create-ticket.outputs.issue != '' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: actions-ecosystem/action-create-comment@v1.0.0 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" + uses: actions-ecosystem/action-create-comment@v1.0.0 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" with: github_token: ${{ secrets.GITHUB_TOKEN }} body: | diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 77f57ab0a7f..f1f17b35893 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write # for dessant/lock-threads to lock PRs runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836 # v4.0.0 + - uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21 # v4.0.1 with: github-token: ${{ github.token }} issue-comment: > diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index ea388be057c..72a1ee3503b 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -24,7 +24,7 @@ jobs: needs: build-artifacts runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - name: Download built artifacts uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: @@ -38,7 +38,7 @@ jobs: echo "BUILD_OUTPUT_LIST=$(cat tmp2.txt | tr '\n' ',' | perl -ple 'chop')" >> $GITHUB_ENV rm -rf tmp.txt && rm -rf tmp2.txt - name: Advance nightly tag - uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3 + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -62,7 +62,7 @@ jobs: - name: Create a nightly GitHub prerelease id: create_prerelease continue-on-error: true - uses: ncipollo/release-action@v1 # TSCCR: no entry for repository "ncipollo/release-action" + uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 with: name: nightly artifacts: "${{ env.BUILD_OUTPUT_LIST }}" @@ -85,7 +85,7 @@ jobs: - name: Retry failed nightly GitHub prerelease id: create_prerelease_retry if: steps.create_prerelease.outcome == 'failure' - uses: ncipollo/release-action@v1 # TSCCR: no entry for repository "ncipollo/release-action" + uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 with: name: nightly artifacts: "${{ env.BUILD_OUTPUT_LIST }}" @@ -101,7 +101,7 @@ jobs: run: | echo "prerelease_id=${{ steps.create_prerelease_retry.outputs.id }}" >> $GITHUB_ENV - name: Publish nightly GitHub prerelease - uses: eregon/publish-release@v1 # TSCCR: no entry for repository "eregon/publish-release" + uses: eregon/publish-release@46913fa2b3f7edc7345ae3c17f6d1b093a54916d # v1.0.5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -117,7 +117,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 + uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 with: payload: | { From 3c4a4f06da67f1f6a472e373dde3b0bb0d7a67e9 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 19 Jul 2023 10:26:27 -0400 Subject: [PATCH 29/92] CHANGELOG: add changelog for Packer 1.9.2 --- CHANGELOG.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d04040aa1a8..54fd88302ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,61 @@ -## 1.9.2 (Upcoming) +## 1.9.2 (July 19, 2023) + +### NOTES: + +* Vendored plugins within Packer have not been updated. Plugin releases occur on + a regular basis to address issues and feature requests. + Please note that in an upcoming version of Packer, we will remove the last + bundled plugins from Packer. + Users are encouraged to use `packer init` for HCL2 templates or + `packer plugins install` with legacy JSON templates for installing external + plugins. + +* Packer will now warn when using bundled plugins. This feature will be removed in + a future version of the tool, so this warning is meant to bring awareness of the + upcoming change, and to help users update their environment/templates to be + ready for this. + [GH-12495](https://github.com/hashicorp/packer/pull/12495) + +### BUG FIXES: + +* Fixed a bug with how Packer was discovering plugins: in order to load + plugins, Packer would recursively scan all the known directories in which + we could have installed plugins. This caused unnecessary directory + walks and slowdowns upon invocation. Packer will now only check + for nested plugins within the directories used by commands such as `packer + init`, or `packer plugins install`, or as defined in PACKER_PLUGIN_PATH. + Refer to + [Packer's plugin directory documentation](https://developer.hashicorp.com/packer/docs/configure#packer-s-plugin-directory) + for details on how loading works. + [GH-12414](https://github.com/hashicorp/packer/pull/12414) + +* The `packer init` subcommand now bundles all the missing installed plugins into one + condensed warning, as opposed to one warning per missing plugin. + [GH-12506](https://github.com/hashicorp/packer/pull/12506) + +### PLUGINS: + +* packer-plugin-parallels: The Parallels plugin has been handed over to the Parallels + team. New releases for this plugin are available at + https://github.com/parallels/packer-plugin-parallels. This plugin is is no longer + being bundled in the Packer binary release. 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. + [GH-12476](https://github.com/hashicorp/packer/pull/12476) + ``` + required_plugins { + parallels = { + source = "github.com/parallels/parallels" + version = "~> 1" + } + } + ``` + +### IMPROVEMENTS: + +* The `hcl2_upgrade` subcommand will now add `required_plugins` to the template + generated from JSON for all our officially supported plugins. + [GH-12504](https://github.com/hashicorp/packer/pull/12504) ## 1.9.1 (June 1, 2023) From e3c20e3dc5cb085affe015e14881bfe0aa028e03 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 19 Jul 2023 17:10:21 -0400 Subject: [PATCH 30/92] CHANGELOG: prepare for 1.9.3 --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54fd88302ef..9c693c7fd3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.9.3 (Upcoming) + ## 1.9.2 (July 19, 2023) ### NOTES: @@ -5,15 +7,13 @@ * Vendored plugins within Packer have not been updated. Plugin releases occur on a regular basis to address issues and feature requests. Please note that in an upcoming version of Packer, we will remove the last - bundled plugins from Packer. - Users are encouraged to use `packer init` for HCL2 templates or + bundled plugins from Packer. Users are encouraged to use `packer init` for HCL2 templates or `packer plugins install` with legacy JSON templates for installing external plugins. * Packer will now warn when using bundled plugins. This feature will be removed in a future version of the tool, so this warning is meant to bring awareness of the - upcoming change, and to help users update their environment/templates to be - ready for this. + upcoming change, and help users update their templates. [GH-12495](https://github.com/hashicorp/packer/pull/12495) ### BUG FIXES: @@ -37,7 +37,7 @@ * packer-plugin-parallels: The Parallels plugin has been handed over to the Parallels team. New releases for this plugin are available at - https://github.com/parallels/packer-plugin-parallels. This plugin is is no longer + https://github.com/parallels/packer-plugin-parallels. This plugin is no longer being bundled in the Packer binary release. 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. @@ -53,8 +53,8 @@ ### IMPROVEMENTS: -* The `hcl2_upgrade` subcommand will now add `required_plugins` to the template - generated from JSON for all our officially supported plugins. +* The `hcl2_upgrade` sub-command will now add `required_plugins` to the template + generated from JSON for [official plugins](https://developer.hashicorp.com/packer/plugins#tiers-and-namespaces). [GH-12504](https://github.com/hashicorp/packer/pull/12504) ## 1.9.1 (June 1, 2023) From 02f1d5058718e4494a729ca280d4828f7bd07530 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:37:27 +0000 Subject: [PATCH 31/92] build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /website Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- website/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/package-lock.json b/website/package-lock.json index b18174e0193..c96a4c2977f 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -13700,9 +13700,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -24337,9 +24337,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrap-ansi": { From e9e4534321dfc00bd2fe561c5b1cf4c5f8d94323 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 00:16:20 +0000 Subject: [PATCH 32/92] build(deps): bump tough-cookie from 4.0.0 to 4.1.3 in /website Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3. - [Release notes](https://github.com/salesforce/tough-cookie/releases) - [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md) - [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3) --- updated-dependencies: - dependency-name: tough-cookie dependency-type: indirect ... Signed-off-by: dependabot[bot] --- website/package-lock.json | 80 ++++++++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 14 deletions(-) diff --git a/website/package-lock.json b/website/package-lock.json index c96a4c2977f..fa295779654 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -9851,6 +9851,13 @@ "node": ">=6" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true, + "peer": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -10314,6 +10321,13 @@ "dev": true, "peer": true }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "peer": true + }, "node_modules/resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -12429,24 +12443,25 @@ } }, "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "peer": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "engines": { "node": ">=6" } }, "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, "peer": true, "engines": { @@ -13058,6 +13073,17 @@ "dev": true, "peer": true }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "peer": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/url-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-regex/-/url-regex-5.0.0.tgz", @@ -21357,6 +21383,13 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true, + "peer": true + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -21703,6 +21736,13 @@ "dev": true, "peer": true }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "peer": true + }, "resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -23372,21 +23412,22 @@ } }, "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "peer": true, "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "dependencies": { "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, "peer": true } @@ -23846,6 +23887,17 @@ "dev": true, "peer": true }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "peer": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "url-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-regex/-/url-regex-5.0.0.tgz", From 739b2acd203f9a506744c5dd9df42a2190171ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 19 Jul 2023 23:35:26 +0200 Subject: [PATCH 33/92] docs: fix typo (#12493) --- .../templates/hcl_templates/functions/collection/lookup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx index a936d02a70c..0eb686063f1 100644 --- a/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx +++ b/website/content/docs/templates/hcl_templates/functions/collection/lookup.mdx @@ -6,7 +6,7 @@ description: The lookup function retrieves an element value from a map given its # `lookup` Function `lookup` retrieves the value of a single element from a map, given its key. -If the given key does not exist, a the given default value is returned instead. +If the given key does not exist, the given default value is returned instead. ```hcl lookup(map, key, default) From 13ed8d90b3b4ac18461add0a00826d093406ebd0 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 20 Jul 2023 07:37:04 -0400 Subject: [PATCH 34/92] Update github-script action REST calls Breaking changed introduced in actions/github-script@v6. https://github.com/actions/github-script#breaking-changes-in-v5 --- .github/workflows/nightly-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 72a1ee3503b..e63c05ea30d 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -43,7 +43,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | try { - await github.git.deleteRef({ + await github.rest.git.deleteRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "tags/nightly" @@ -51,7 +51,7 @@ jobs: } catch (e) { console.log("Warning: The nightly tag doesn't exist yet, so there's nothing to do. Trace: " + e) } - await github.git.createRef({ + await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "refs/tags/nightly", From 682f2e7b6c15a046ff6619c4788904e5031fd6b8 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 21 Jul 2023 17:37:50 -0400 Subject: [PATCH 35/92] .github/workflows: Replace untrusted GHA in repo workflows (#12530) The GHA action used for adding comments or labels to issues untrusted by TSCCR have been replaced with an approved set of actions. The updated workflows use actions/github-script for adding comments or labels to an issue. Related to: https://github.com/hashicorp/security-tsccr/pull/608 --- .github/workflows/issues-opened.yml | 35 ++++++++++++++++++----------- .github/workflows/jira.yml | 16 ++++++++----- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index 86adfacef1f..7cc3f4cc5fe 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -23,24 +23,33 @@ jobs: name: Redirect to discuss permissions: contents: read - issues: write # for actions-ecosystem/action-create-comment to create comments + issues: write # for actions/github-script to create comments and add labels if: contains(github.event.issue.labels.*.name, 'question') runs-on: ubuntu-latest steps: - - uses: actions-ecosystem/action-create-comment@v1.0.2 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" + - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - body: | - Hi 👋 thanks for reaching out. + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: | + Hi 👋 thanks for reaching out. - For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. - As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. - We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. - If no activity is taken on this question within 30 days it will be automatically closed. + For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. + As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. + We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. + If no activity is taken on this question within 30 days it will be automatically closed. - If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. - - uses: actions-ecosystem/action-add-labels@v1.1.3 # TSCCR: no entry for repository "actions-ecosystem/action-add-labels" + If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. + - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - labels: needs-reply + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['needs-reply'] + }) diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml index a0fe240edb6..bdb6b8a5ce2 100644 --- a/.github/workflows/jira.yml +++ b/.github/workflows/jira.yml @@ -11,7 +11,7 @@ jobs: sync: name: Sync to JIRA permissions: - issues: write # for actions-ecosytem/action-create-comment + issues: write # for actions/github-script to create comments runs-on: ubuntu-latest steps: - name: Login @@ -74,13 +74,17 @@ jobs: - name: Add tracking comment if: steps.create-ticket.outputs.issue != '' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: actions-ecosystem/action-create-comment@v1.0.0 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - body: | - This issue has been synced to JIRA for planning. + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: | + This issue has been synced to JIRA for planning. - JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}}) + JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}}) From 2401add228605115f20aea60023ecbf9cd2360ad Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Mon, 24 Jul 2023 11:52:57 -0400 Subject: [PATCH 36/92] Fix body attribute for github-script comment --- .github/workflows/issues-opened.yml | 4 ++-- .github/workflows/jira.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index 7cc3f4cc5fe..c899e9993b3 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -34,7 +34,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: | + body: ` Hi 👋 thanks for reaching out. For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. @@ -42,7 +42,7 @@ jobs: We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. If no activity is taken on this question within 30 days it will be automatically closed. - If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. + If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue.` - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: script: | diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml index bdb6b8a5ce2..70ae2c562c1 100644 --- a/.github/workflows/jira.yml +++ b/.github/workflows/jira.yml @@ -81,10 +81,10 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: | + body: ` This issue has been synced to JIRA for planning. - JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}}) + JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}})` From a1957a1deff6b71f0905e6a4f1f8b565bc79dd3f Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:03:29 +0000 Subject: [PATCH 37/92] [COMPLIANCE] Add Copyright and License Headers --- acctest/plugin/bundled_plugin_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/acctest/plugin/bundled_plugin_test.go b/acctest/plugin/bundled_plugin_test.go index e9308a59869..9f21dfac626 100644 --- a/acctest/plugin/bundled_plugin_test.go +++ b/acctest/plugin/bundled_plugin_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package plugin import ( From 74b5c2aa56e4cccd227f96a3cd36f66261f86b76 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 30 May 2023 13:56:00 -0400 Subject: [PATCH 38/92] issue-comment-created: Add guard for labels The action currently fails when trying to remove the stale or waiting-reply labels from issues that do not actually contain the labels in question. This update adds a guard clause to only run the action on issues containing at least one of the labels. --- .github/workflows/issue-comment-created.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows/issue-comment-created.yml index e28ac0d0939..a5c112d2a15 100644 --- a/.github/workflows/issue-comment-created.yml +++ b/.github/workflows/issue-comment-created.yml @@ -12,6 +12,7 @@ jobs: permissions: contents: read # for actions/checkout to fetch code issues: write # for actions-ecosystem/action-remove-labels to remove issue labels + if: ${{contains(github.event.issue.labels.*.name, 'waiting-reply') || contains(github.event.issue.labels.*.name, 'stale')}} runs-on: ubuntu-latest steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 From 55decee2427dc438213688db46d507b5f1caa981 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 24 Jul 2023 14:01:28 -0400 Subject: [PATCH 39/92] .github: fix issues-opened.yml workflow This commit fixes a bug with the first script, as the object passed to the REST API is not closed properly. --- .github/workflows/issues-opened.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index c899e9993b3..565b89af048 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -43,6 +43,8 @@ jobs: If no activity is taken on this question within 30 days it will be automatically closed. If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue.` + }) + - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: script: | @@ -51,5 +53,5 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, labels: ['needs-reply'] - }) + }) From 38101a64c9650798cd60ea873227a5828bf1525a Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 19 Jul 2023 12:42:37 -0400 Subject: [PATCH 40/92] hcp: Add support for project level service principals HCP supports two types of service principals: Organization-level and project-level. When a user tries to publish to an active HCP Packer registry using a plsp the client fails when configuring the client due to a API permission error; namely plsp do not have the permissions to query an org for a list of projects. Setting the HCP_PROJECT_ID does not resolve the issue because the call to ListProjects is still executed. This changes updates the client configuration params to obtain both the HCP Organization and Project IDs that will be used for connecting to the HCP Packer registry. With this change if a user provides a project Id via the HCP_PROJECT_ID environment variable no call to ListProjects will be made. Instead the value will be take as is and used to create the connection. A user connecting with a project level service principals must provide a valid HCP_PROJECT_ID in order to connect. --- internal/hcp/api/client.go | 118 +++++++++++++++++++++----------- internal/hcp/api/client_test.go | 4 +- internal/hcp/env/env.go | 4 ++ internal/hcp/env/variables.go | 1 + 4 files changed, 84 insertions(+), 43 deletions(-) diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index 21a07156cc2..89d4a39b489 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -7,6 +7,7 @@ package api import ( "fmt" "log" + "net/http" "os" "time" @@ -44,39 +45,67 @@ func NewClient() (*Client, error) { } } - cl, err := httpclient.New(httpclient.Config{ + hcpClientCfg := httpclient.Config{ SourceChannel: fmt.Sprintf("packer/%s", version.PackerVersion.FormattedVersion()), - }) - if err != nil { + } + if err := hcpClientCfg.Canonicalize(); err != nil { return nil, &ClientError{ StatusCode: InvalidClientConfig, Err: err, } } + cl, err := httpclient.New(hcpClientCfg) + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } + } client := &Client{ Packer: packerSvc.New(cl, nil), Organization: organizationSvc.New(cl, nil), Project: projectSvc.New(cl, nil), } + //if both HCP_ORGANIZATION_ID and HCP_PROJECT_ID are set via env variables the hcpConfig may have all we need already. + if hcpClientCfg.Profile().OrganizationID != "" && hcpClientCfg.Profile().ProjectID != "" { + client.OrganizationID = hcpClientCfg.Profile().OrganizationID + client.ProjectID = hcpClientCfg.Profile().ProjectID - if err := client.loadOrganizationID(); err != nil { - return nil, &ClientError{ - StatusCode: InvalidClientConfig, - Err: err, - } + return client, nil } - if err := client.loadProjectID(); err != nil { - return nil, &ClientError{ - StatusCode: InvalidClientConfig, - Err: err, + + if client.OrganizationID == "" { + err := client.loadOrganizationID() + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } } } + if client.ProjectID == "" { + err := client.loadProjectID() + if err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, + } + } + } return client, nil } func (c *Client) loadOrganizationID() error { + if c.OrganizationID != "" { + return nil + } + + if env.HasOrganizationID() { + c.OrganizationID = os.Getenv(env.HCPOrganizationID) + return nil + } // Get the organization ID. listOrgParams := organizationSvc.NewOrganizationServiceListParams() listOrgResp, err := c.Organization.OrganizationServiceList(listOrgParams, nil) @@ -92,55 +121,62 @@ func (c *Client) loadOrganizationID() error { } func (c *Client) loadProjectID() error { + if c.ProjectID != "" { + return nil + } + if env.HasProjectID() { + c.ProjectID = os.Getenv(env.HCPProjectID) + return nil + } // Get the project using the organization ID. listProjParams := projectSvc.NewProjectServiceListParams() listProjParams.ScopeID = &c.OrganizationID scopeType := string(rmmodels.HashicorpCloudResourcemanagerResourceIDResourceTypeORGANIZATION) listProjParams.ScopeType = &scopeType listProjResp, err := c.Project.ProjectServiceList(listProjParams, nil) - if err != nil { - return fmt.Errorf("unable to fetch project id: %v", err) - } - - if env.HasProjectID() { - proj, err := findProjectByID(os.Getenv(env.HCPProjectID), listProjResp.Payload.Projects) - if err != nil { - return err - } - c.ProjectID = proj.ID - } else { - if len(listProjResp.Payload.Projects) > 1 { - log.Printf("[WARNING] Multiple HCP projects found, will pick the oldest one by default\n" + - "To specify which project to use, set the HCP_PROJECT_ID environment variable to the one you want to use.") + if err != nil { + //For permission errors our service principle may not have the perms + // to see all projects for an Org; this is the case for project-level service principles. + serviceErr, ok := err.(*projectSvc.ProjectServiceListDefault) + if !ok { + return fmt.Errorf("unable to fetch project list: %v", err) } - - proj, err := findOldestProject(listProjResp.Payload.Projects) - if err != nil { - return err + if serviceErr.Code() == http.StatusForbidden { + return fmt.Errorf("unable to fetch project\n\n"+ + "If the provided credentials are tied to a specific project trying setting the %s environment variable to one you want to use.", env.HCPProjectID) } + } - c.ProjectID = proj.ID + if len(listProjResp.Payload.Projects) > 1 { + log.Printf("[WARNING] Multiple HCP projects found, will pick the oldest one by default\n"+ + "To specify which project to use, set the %s environment variable to the one you want to use.", env.HCPProjectID) } + proj, err := getOldestProject(listProjResp.Payload.Projects) + if err != nil { + return err + } + c.ProjectID = proj.ID return nil } -func findOldestProject(projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { - if len(projs) == 0 { +// getOldestProject retrieves the oldest project from a list based on its created_at time. +func getOldestProject(projects []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { + if len(projects) == 0 { return nil, fmt.Errorf("no project found") } - proj := projs[0] - for i := 1; i < len(projs); i++ { - nxtProj := projs[i] - - if time.Time(nxtProj.CreatedAt).Before(time.Time(proj.CreatedAt)) { - proj = nxtProj + oldestTime := time.Now() + var oldestProj *models.HashicorpCloudResourcemanagerProject + for _, proj := range projects { + projTime := time.Time(proj.CreatedAt) + if projTime.Before(oldestTime) { + oldestProj = proj + oldestTime = projTime } } - - return proj, nil + return oldestProj, nil } func findProjectByID(projID string, projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go index b1cdbff61c2..466b390b828 100644 --- a/internal/hcp/api/client_test.go +++ b/internal/hcp/api/client_test.go @@ -94,7 +94,7 @@ func TestFindProjectID(t *testing.T) { } } -func TestFindOldestProject(t *testing.T) { +func TestGetOldestProject(t *testing.T) { testcases := []struct { Name string ProjectList []*models.HashicorpCloudResourcemanagerProject @@ -151,7 +151,7 @@ func TestFindOldestProject(t *testing.T) { for _, tt := range testcases { t.Run(tt.Name, func(t *testing.T) { - proj, err := findOldestProject(tt.ProjectList) + proj, err := getOldestProject(tt.ProjectList) if (err != nil) != tt.ExpectErr { t.Errorf("test findProjectByID, expected %t, got %t", tt.ExpectErr, diff --git a/internal/hcp/env/env.go b/internal/hcp/env/env.go index 0cf459015e8..0186be1671f 100644 --- a/internal/hcp/env/env.go +++ b/internal/hcp/env/env.go @@ -13,6 +13,10 @@ func HasProjectID() bool { return hasEnvVar(HCPProjectID) } +func HasOrganizationID() bool { + return hasEnvVar(HCPOrganizationID) +} + func HasClientID() bool { return hasEnvVar(HCPClientID) } diff --git a/internal/hcp/env/variables.go b/internal/hcp/env/variables.go index 71258c13be3..8c74b600d47 100644 --- a/internal/hcp/env/variables.go +++ b/internal/hcp/env/variables.go @@ -7,6 +7,7 @@ const ( HCPClientID = "HCP_CLIENT_ID" HCPClientSecret = "HCP_CLIENT_SECRET" HCPProjectID = "HCP_PROJECT_ID" + HCPOrganizationID = "HCP_ORGANIZATION_ID" HCPPackerRegistry = "HCP_PACKER_REGISTRY" HCPPackerBucket = "HCP_PACKER_BUCKET_NAME" HCPPackerBuildFingerprint = "HCP_PACKER_BUILD_FINGERPRINT" From 60c66fdf9fa0f30986f5b857f4fc69f6a21834dc Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 20 Jul 2023 16:03:43 -0400 Subject: [PATCH 41/92] Add additional validation for manually set project ids When setting a project id via the HCP_PROJECT_ID env the client will try to validate the project by checking that it has an associated registry. If the project is invalid or not a valid UUID an error will be displayed to the user * Add comment to clarify usage of SDK loaded env. variables --- internal/hcp/api/client.go | 48 ++++++++++++------- internal/hcp/api/client_test.go | 83 --------------------------------- 2 files changed, 31 insertions(+), 100 deletions(-) diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index 89d4a39b489..f28999d57b6 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -11,6 +11,7 @@ import ( "os" "time" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" organizationSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/organization_service" projectSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" @@ -67,7 +68,12 @@ func NewClient() (*Client, error) { Organization: organizationSvc.New(cl, nil), Project: projectSvc.New(cl, nil), } - //if both HCP_ORGANIZATION_ID and HCP_PROJECT_ID are set via env variables the hcpConfig may have all we need already. + // A client.Config.hcpConfig is set when calling Canonicalize on basic HCP httpclient, as on line 52. + // If a user sets HCP_* env. variables they will be loaded into the client via the SDK and used for any client calls. + // For HCP_ORGANIZATION_ID and HCP_PROJECT_ID if they are both set via env. variables the call to hcpClientCfg.Connicalize() + // will automatically loaded them using the FromEnv configOption. + // + // If both values are set we should have all that we need to continue so we can returned the configured client. if hcpClientCfg.Profile().OrganizationID != "" && hcpClientCfg.Profile().ProjectID != "" { client.OrganizationID = hcpClientCfg.Profile().OrganizationID client.ProjectID = hcpClientCfg.Profile().ProjectID @@ -94,14 +100,11 @@ func NewClient() (*Client, error) { } } } + return client, nil } func (c *Client) loadOrganizationID() error { - if c.OrganizationID != "" { - return nil - } - if env.HasOrganizationID() { c.OrganizationID = os.Getenv(env.HCPOrganizationID) return nil @@ -121,11 +124,12 @@ func (c *Client) loadOrganizationID() error { } func (c *Client) loadProjectID() error { - if c.ProjectID != "" { - return nil - } if env.HasProjectID() { c.ProjectID = os.Getenv(env.HCPProjectID) + err := c.ValidateRegistryForProject() + if err != nil { + return fmt.Errorf("project validation for id %q responded in error: %v", c.ProjectID, err) + } return nil } // Get the project using the organization ID. @@ -136,15 +140,15 @@ func (c *Client) loadProjectID() error { listProjResp, err := c.Project.ProjectServiceList(listProjParams, nil) if err != nil { - //For permission errors our service principle may not have the perms - // to see all projects for an Org; this is the case for project-level service principles. + //For permission errors, our service principal may not have the ability + // to see all projects for an Org; this is the case for project-level service principals. serviceErr, ok := err.(*projectSvc.ProjectServiceListDefault) if !ok { return fmt.Errorf("unable to fetch project list: %v", err) } if serviceErr.Code() == http.StatusForbidden { return fmt.Errorf("unable to fetch project\n\n"+ - "If the provided credentials are tied to a specific project trying setting the %s environment variable to one you want to use.", env.HCPProjectID) + "If the provided credentials are tied to a specific project try setting the %s environment variable to one you want to use.", env.HCPProjectID) } } @@ -179,12 +183,22 @@ func getOldestProject(projects []*models.HashicorpCloudResourcemanagerProject) ( return oldestProj, nil } -func findProjectByID(projID string, projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { - for _, proj := range projs { - if proj.ID == projID { - return proj, nil - } +// ValidateRegistryForProject validates that there is an active registry associated to the configured organization and project ids. +// A successful validation will result in a nil response. All other response represent an invalid registry error request or a registry not found error. +func (client *Client) ValidateRegistryForProject() error { + params := packer_service.NewPackerServiceGetRegistryParams() + params.LocationOrganizationID = client.OrganizationID + params.LocationProjectID = client.ProjectID + + resp, err := client.Packer.PackerServiceGetRegistry(params, nil) + if err != nil { + return err } - return nil, fmt.Errorf("No project %q found", projID) + if resp.GetPayload().Registry == nil { + return fmt.Errorf("No active HCP Packer registry was found for the organization %q and project %q", client.OrganizationID, client.ProjectID) + } + + return nil + } diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go index 466b390b828..16d321beb77 100644 --- a/internal/hcp/api/client_test.go +++ b/internal/hcp/api/client_test.go @@ -11,89 +11,6 @@ import ( "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" ) -func TestFindProjectID(t *testing.T) { - testcases := []struct { - Name string - ProjectID string - ProjectList []*models.HashicorpCloudResourcemanagerProject - ExpectProjectID string - ExpectErr bool - }{ - { - "Only one project, project exists, success", - "test-project-exists", - []*models.HashicorpCloudResourcemanagerProject{ - { - ID: "test-project-exists", - }, - }, - "test-project-exists", - false, - }, - { - "Multiple projects, project exists, success", - "test-project-exists", - []*models.HashicorpCloudResourcemanagerProject{ - { - ID: "other-project-exists", - }, - { - ID: "test-project-exists", - }, - }, - "test-project-exists", - false, - }, - { - "One project, no id match, fail", - "test-project-exists", - []*models.HashicorpCloudResourcemanagerProject{ - { - ID: "other-project-exists", - }, - }, - "", - true, - }, - { - "Multiple projects, no id match, fail", - "test-project-exists", - []*models.HashicorpCloudResourcemanagerProject{ - { - ID: "other-project-exists", - }, - { - ID: "yet-another-project-exists", - }, - }, - "", - true, - }, - { - "No projects, no id match, fail", - "test-project-exists", - []*models.HashicorpCloudResourcemanagerProject{}, - "", - true, - }, - } - - for _, tt := range testcases { - t.Run(tt.Name, func(t *testing.T) { - proj, err := findProjectByID(tt.ProjectID, tt.ProjectList) - if (err != nil) != tt.ExpectErr { - t.Errorf("test findProjectByID, expected %t, got %t", - tt.ExpectErr, - err != nil) - } - - if proj != nil && proj.ID != tt.ExpectProjectID { - t.Errorf("expected to select project %q, got %q", tt.ExpectProjectID, proj.ID) - } - }) - } -} - func TestGetOldestProject(t *testing.T) { testcases := []struct { Name string From d0198c8a1714d23b64e82bcf716397c692f7c4d2 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 24 Jul 2023 15:16:29 -0400 Subject: [PATCH 42/92] packer: track bundled plugins usage on telemetry --- command/meta.go | 2 ++ packer/telemetry.go | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/command/meta.go b/command/meta.go index 1579d152237..fb3d9efb2a7 100644 --- a/command/meta.go +++ b/command/meta.go @@ -196,6 +196,8 @@ func (m *Meta) DetectBundledPlugins(handler packer.Handler) hcl.Diagnostics { return nil } + packer.CheckpointReporter.SetBundledUsage() + buf := &strings.Builder{} buf.WriteString("This template relies on the use of plugins bundled into the Packer binary.\n") buf.WriteString("The practice of bundling external plugins into Packer will be removed in an upcoming version.\n\n") diff --git a/packer/telemetry.go b/packer/telemetry.go index d4e20696649..b1f0347b2ba 100644 --- a/packer/telemetry.go +++ b/packer/telemetry.go @@ -26,7 +26,7 @@ const ( JSONTemplate PackerTemplateType = "JSON" ) -const TelemetryVersion string = "beta/packer/6" +const TelemetryVersion string = "beta/packer/7" const TelemetryPanicVersion string = "beta/packer_panic/4" var CheckpointReporter *CheckpointTelemetry @@ -37,6 +37,7 @@ type PackerReport struct { Error string `json:"error"` Command string `json:"command"` TemplateType PackerTemplateType `json:"template_type"` + UseBundled bool `json:"use_bundled"` } type CheckpointTelemetry struct { @@ -44,6 +45,7 @@ type CheckpointTelemetry struct { signatureFile string startTime time.Time templateType PackerTemplateType + useBundled bool } func NewCheckpointReporter(disableSignature bool) *CheckpointTelemetry { @@ -128,6 +130,11 @@ func (c *CheckpointTelemetry) SetTemplateType(t PackerTemplateType) { c.templateType = t } +// SetBundledUsage marks the template as using bundled plugins +func (c *CheckpointTelemetry) SetBundledUsage() { + c.useBundled = true +} + func (c *CheckpointTelemetry) Finalize(command string, errCode int, err error) error { if c == nil { return nil @@ -145,6 +152,7 @@ func (c *CheckpointTelemetry) Finalize(command string, errCode int, err error) e extra.Error = err.Error() } + extra.UseBundled = c.useBundled extra.TemplateType = c.templateType params.Payload = extra // b, _ := json.MarshalIndent(params, "", " ") From 3512a175a6d35cf3311a81a1f1f750bf8281d7d5 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 24 Jul 2023 11:41:04 -0400 Subject: [PATCH 43/92] command: change wording for init's postitional arg `packer init' is meant to be invoked on a template file or a directory. This was described in the command-line help message as `[template.pkr.hcl|folder]'. Because this is encapsulated between square brackets, this could be taken as an option instead of a positional, mandatory argument. This commit changes the wording to adopt a similar convention as `packer build', so the two are consistent in how they are invoked, and to avoid mistaking this argument as optional. --- command/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/init.go b/command/init.go index 761627134d6..b95eb86992b 100644 --- a/command/init.go +++ b/command/init.go @@ -180,7 +180,7 @@ packer { func (*InitCommand) Help() string { helpText := ` -Usage: packer init [options] [config.pkr.hcl|folder/] +Usage: packer init [options] TEMPLATE Install all the missing plugins required in a Packer config. Note that Packer does not have a state. From 392232933ff1ef66025d3fd82ac3e353fbaf0356 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 24 Jul 2023 11:43:31 -0400 Subject: [PATCH 44/92] website: add usage notice to init The `packer init' command's wording was not clear, so it was changed in a preceding commit, and this commit aims to add more details on how the command is meant to be used, along with a simple example. --- website/content/docs/commands/init.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/website/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index 52b72eb8151..e6209d2c15e 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -19,6 +19,26 @@ the first command that should be executed when working with a new or existing template. This command is always safe to run multiple times. Though subsequent runs may give errors, this command will never delete anything. +You should invoke `packer init` on either an HCL2 template, or a directory that contains +at least a valid HCL2 template, and eventually other related dependencies like varfiles +for example. + +Example: + +```sh +$ ls . +template.pkr.hcl varfile.pkrvars.pkr.hcl + +$ packer init template.pkr.hcl # You can invoke packer init on a single template in this case + # This works if the template is self-contained, but may fail if + # the template is meant to be built as a bundle of partials. + +$ packer init . # Alternatively, you can invoke packer init on a directory instead, + # which behaves the same in a configuration like this one, but if + # the target is a collection ofHCL2 templates, this is the + # preferred way to invoke it. +``` + Packer does not currently have the notion of a state like Terraform has. In other words, currently `packer init` is only in charge of installing Packer plugins. From 5c9ab19d8fa8467aa2c64d227579c070047ecab2 Mon Sep 17 00:00:00 2001 From: "hashicorp-tsccr[bot]" Date: Thu, 27 Jul 2023 12:40:14 +0000 Subject: [PATCH 45/92] Result of tsccr-helper -log-level=info -pin-all-workflows . --- .github/workflows/issue-migrator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-migrator.yml b/.github/workflows/issue-migrator.yml index 58eed27f22a..719cfa44f2f 100644 --- a/.github/workflows/issue-migrator.yml +++ b/.github/workflows/issue-migrator.yml @@ -12,7 +12,7 @@ jobs: if: startsWith(github.event.label.name, 'remote-plugin/') runs-on: ubuntu-latest steps: - - uses: bflad/action-migrate-issue@main # TSCCR: no entry for repository "bflad/action-migrate-issue" + - uses: bflad/action-migrate-issue@2e049d822b08e67d25b938343227051518f14d9a # v1.0.2 with: source-issue-comment: | This issue has been migrated to {target-issue-url} due to the [Packer Plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). From d1aa103ebc80bcc2863a7bc61c49245847143b94 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 27 Jul 2023 17:12:17 -0400 Subject: [PATCH 46/92] workflows/jira: Fix syntax error for createComment --- .github/workflows/jira.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml index 70ae2c562c1..a3fa8cd7ea8 100644 --- a/.github/workflows/jira.yml +++ b/.github/workflows/jira.yml @@ -68,9 +68,7 @@ jobs: summary: "${{ github.event.repository.name }}: ${{ github.event.issue.title }}" description: "${{ github.event.issue.body }}\n\n_Created from GitHub by ${{ github.actor }}._" # The field customfield_10089 refers to the Issue Link field in JIRA. - fields: '{ "customfield_10089": "${{ github.event.issue.html_url }}", - "components": [{ "name": "OSS" }], - "labels": ${{ steps.set-ticket-labels.outputs.labels }} }' + fields: '{ "customfield_10089": "${{ github.event.issue.html_url }}", "components": [{ "name": "OSS" }], "labels": ${{ steps.set-ticket-labels.outputs.labels }} }' - name: Add tracking comment if: steps.create-ticket.outputs.issue != '' && steps.set-ticket-type.outputs.type != 'Invalid' @@ -83,8 +81,6 @@ jobs: repo: context.repo.repo, body: ` This issue has been synced to JIRA for planning. - JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}})` - - + }) From d3d33714e6834de18a8a71c44874171ec4093503 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 27 Jul 2023 15:58:29 -0400 Subject: [PATCH 47/92] Update plugin loading for current directory Starting with Go 1.19 the loading of binaries from the current working directory was deemed as a possible security problem. Thus the use of exec.Command or exec.LookPath no longer resolves an executable within the current working directory. This change updates the discover logic to return absolute paths for any discovered plugin, which is called directly when passed to exec.Command or exec.LookPath. By doing this Packer is able to load a custom plugin sitting in the current working directory as it did in version prior to v1.9.2. --- packer/plugin.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packer/plugin.go b/packer/plugin.go index a4321d90fd0..1a6a0ab845c 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -239,7 +239,11 @@ func (c *PluginConfig) discoverSingle(glob string) (map[string]string, error) { pluginName = strings.SplitN(pluginName, "_", 2)[0] log.Printf("[INFO] Discovered potential plugin: %s = %s", pluginName, match) - res[pluginName] = match + pluginPath, err := filepath.Abs(match) + if err != nil { + pluginPath = match + } + res[pluginName] = pluginPath } return res, nil From a96584fb5613106cd106087f7f841fd57ff98cff Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 27 Jul 2023 16:04:34 -0400 Subject: [PATCH 48/92] Update plugin discover logic When copying a plugin's checksum file (packer-plugin-*_SHA256SUM) installed by `packer plugins install` or `packer init` into a separate directory the file may be copied with the executable bit turned out. If unchanged after the copy, Packer would discover the checksum file as a possible plugin match and error when trying to execute describe on the plugin look a like. This change adds a checksum file test to the plugin matching logic. If the discovered plugin name is a checksum it is excluded from the discovered plugin list. --- packer/plugin.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packer/plugin.go b/packer/plugin.go index 1a6a0ab845c..69f0b631c7d 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -20,6 +20,11 @@ import ( plugingetter "github.com/hashicorp/packer/packer/plugin-getter" ) +var defaultChecksummer = plugingetter.Checksummer{ + Type: "sha256", + Hash: sha256.New(), +} + // PluginConfig helps load and use packer plugins type PluginConfig struct { KnownPluginFolders []string @@ -227,6 +232,14 @@ func (c *PluginConfig) discoverSingle(glob string) (map[string]string, error) { continue } + if strings.Contains(strings.ToUpper(file), defaultChecksummer.FileExt()) { + log.Printf( + "[TRACE] Ignoring plugin match %s, which looks to be a checksum file", + match) + continue + + } + // If the filename has a ".", trim up to there if idx := strings.Index(file, ".exe"); idx >= 0 { file = file[:idx] @@ -383,7 +396,7 @@ func (c *PluginConfig) discoverInstalledComponents(path string) error { APIVersionMajor: pluginsdk.APIVersionMajor, APIVersionMinor: pluginsdk.APIVersionMinor, Checksummers: []plugingetter.Checksummer{ - {Type: "sha256", Hash: sha256.New()}, + defaultChecksummer, }, } From 848039dcdb2a150b0271e044407327e7ec8ec347 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 28 Jul 2023 12:48:02 -0400 Subject: [PATCH 49/92] Update plugin discover testing * Add test case for loading plugin in CWD * Add test case to validate checksume files are ignored * Update Discover to include CWD "." in PluginFolders if KnowPluginFolders is unset --- packer/plugin.go | 3 +- packer/plugin_discover_test.go | 424 +++++++++++++++++++-------------- 2 files changed, 244 insertions(+), 183 deletions(-) diff --git a/packer/plugin.go b/packer/plugin.go index 69f0b631c7d..dd3e6d31719 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -85,7 +85,8 @@ func (c *PluginConfig) Discover() error { } if len(c.KnownPluginFolders) == 0 { - c.KnownPluginFolders = PluginFolders() + //PluginFolders should match the call in github.com/hahicorp/packer/main.go#loadConfig + c.KnownPluginFolders = PluginFolders(".") } // TODO after JSON is deprecated remove support for legacy component plugins. diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index 91e8ba6b318..fec52607d83 100644 --- a/packer/plugin_discover_test.go +++ b/packer/plugin_discover_test.go @@ -154,6 +154,233 @@ func TestDiscoverDatasource(t *testing.T) { } } +func TestMultiPlugin_describe(t *testing.T) { + createMockPlugins(t, mockPlugins) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s", err.Error()) + } + + for mockPluginName, plugin := range mockPlugins { + for mockBuilderName := range plugin.Builders { + expectedBuilderName := mockPluginName + "-" + mockBuilderName + + if !c.Builders.Has(expectedBuilderName) { + t.Fatalf("expected to find builder %q", expectedBuilderName) + } + } + for mockProvisionerName := range plugin.Provisioners { + expectedProvisionerName := mockPluginName + "-" + mockProvisionerName + if !c.Provisioners.Has(expectedProvisionerName) { + t.Fatalf("expected to find builder %q", expectedProvisionerName) + } + } + for mockPostProcessorName := range plugin.PostProcessors { + expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName + if !c.PostProcessors.Has(expectedPostProcessorName) { + t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) + } + } + for mockDatasourceName := range plugin.Datasources { + expectedDatasourceName := mockPluginName + "-" + mockDatasourceName + if !c.DataSources.Has(expectedDatasourceName) { + t.Fatalf("expected to find datasource %q", expectedDatasourceName) + } + } + } +} + +func TestMultiPlugin_describe_installed(t *testing.T) { + createMockInstalledPlugins(t, mockInstalledPlugins, createMockChecksumFile) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s", err.Error()) + } + + for mockPluginName, plugin := range mockInstalledPlugins { + mockPluginName = strings.Split(mockPluginName, "_")[0] + for mockBuilderName := range plugin.Builders { + expectedBuilderName := mockPluginName + "-" + mockBuilderName + if !c.Builders.Has(expectedBuilderName) { + t.Fatalf("expected to find builder %q", expectedBuilderName) + } + } + for mockProvisionerName := range plugin.Provisioners { + expectedProvisionerName := mockPluginName + "-" + mockProvisionerName + if !c.Provisioners.Has(expectedProvisionerName) { + t.Fatalf("expected to find builder %q", expectedProvisionerName) + } + } + for mockPostProcessorName := range plugin.PostProcessors { + expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName + if !c.PostProcessors.Has(expectedPostProcessorName) { + t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) + } + } + for mockDatasourceName := range plugin.Datasources { + expectedDatasourceName := mockPluginName + "-" + mockDatasourceName + if !c.DataSources.Has(expectedDatasourceName) { + t.Fatalf("expected to find datasource %q", expectedDatasourceName) + } + } + } +} + +func TestMultiPlugin_describe_installed_for_invalid(t *testing.T) { + tc := []struct { + desc string + installedPluginsMock map[string]pluginsdk.Set + createMockFn func(*testing.T, map[string]pluginsdk.Set) + }{ + { + desc: "Incorrectly named plugins", + installedPluginsMock: invalidInstalledPluginsMock, + createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { + createMockInstalledPlugins(t, mocks, createMockChecksumFile) + }, + }, + { + desc: "Plugins missing checksums", + installedPluginsMock: mockInstalledPlugins, + createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { + createMockInstalledPlugins(t, mocks) + }, + }, + } + + for _, tt := range tc { + t.Run(tt.desc, func(t *testing.T) { + tt.createMockFn(t, tt.installedPluginsMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s", err.Error()) + } + if c.Builders.Has("feather") { + t.Fatalf("expected to not find builder %q", "feather") + } + for mockPluginName, plugin := range tt.installedPluginsMock { + mockPluginName = strings.Split(mockPluginName, "_")[0] + for mockBuilderName := range plugin.Builders { + expectedBuilderName := mockPluginName + "-" + mockBuilderName + if c.Builders.Has(expectedBuilderName) { + t.Fatalf("expected to not find builder %q", expectedBuilderName) + } + } + for mockProvisionerName := range plugin.Provisioners { + expectedProvisionerName := mockPluginName + "-" + mockProvisionerName + if c.Provisioners.Has(expectedProvisionerName) { + t.Fatalf("expected to not find builder %q", expectedProvisionerName) + } + } + for mockPostProcessorName := range plugin.PostProcessors { + expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName + if c.PostProcessors.Has(expectedPostProcessorName) { + t.Fatalf("expected to not find post-processor %q", expectedPostProcessorName) + } + } + for mockDatasourceName := range plugin.Datasources { + expectedDatasourceName := mockPluginName + "-" + mockDatasourceName + if c.DataSources.Has(expectedDatasourceName) { + t.Fatalf("expected to not find datasource %q", expectedDatasourceName) + } + } + } + }) + } +} + +func TestMultiPlugin_defaultName(t *testing.T) { + createMockPlugins(t, defaultNameMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + } + + expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} + for _, mockBuilderName := range expectedBuilderNames { + if !c.Builders.Has(mockBuilderName) { + t.Fatalf("expected to find builder %q; builders is %#v", mockBuilderName, c.Builders) + } + } +} + +// no T.Parallel using os.Chdir +func TestMultiPlugin_CWD(t *testing.T) { + createMockPlugins(t, defaultNameMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + // Unset PACKER_PLUGIN_PATH to test CWD loading + os.Unsetenv("PACKER_PLUGIN_PATH") + if err := os.Chdir(pluginDir); err != nil { + t.Fatalf("failed to change directory to test loading from CWD: %s", err) + } + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + } + expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} + for _, mockBuilderName := range expectedBuilderNames { + if !c.Builders.Has(mockBuilderName) { + t.Fatalf("expected to find builder %q; builders is %#v", mockBuilderName, c.Builders) + } + } +} + +func TestMultiPlugin_IgnoreChecksumFile(t *testing.T) { + createMockPlugins(t, defaultNameMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + + csFile, err := generateMockChecksumFile(filepath.Join(pluginDir, "packer-plugin-foo")) + if err != nil { + t.Fatal(err.Error()) + } + // Copy plugin contents into checksum file to validate that it is not only skipped but that it never gets loaded + if err := os.Rename(filepath.Join(pluginDir, "packer-plugin-foo"), csFile); err != nil { + t.Fatalf("failed to rename plugin bin file to checkfum file needed for test: %s", err) + } + + c := PluginConfig{} + err = c.Discover() + if err != nil { + t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + } + expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} + for _, mockBuilderName := range expectedBuilderNames { + if c.Builders.Has(mockBuilderName) { + t.Fatalf("expected to not find builder %q; builders is %#v", mockBuilderName, c.Builders) + } + } +} + +func TestMultiPlugin_defaultName_each_plugin_type(t *testing.T) { + createMockPlugins(t, doubleDefaultMock) + pluginDir := os.Getenv("PACKER_PLUGIN_PATH") + defer os.RemoveAll(pluginDir) + + c := PluginConfig{} + err := c.Discover() + if err != nil { + t.Fatal("Should not have error because pluginsdk.DEFAULT_NAME is used twice but only once per plugin type.") + } +} + func generateFakePlugins(dirname string, pluginNames []string) (string, []string, func(), error) { dir, err := os.MkdirTemp("", dirname) if err != nil { @@ -296,6 +523,15 @@ func createMockPlugins(t *testing.T, plugins map[string]pluginsdk.Set) { } func createMockChecksumFile(t testing.TB, filePath string) { + t.Helper() + cs, err := generateMockChecksumFile(filePath) + if err != nil { + t.Fatalf(err.Error()) + } + t.Logf("created fake plugin checksum file %s", cs) +} + +func generateMockChecksumFile(filePath string) (string, error) { cs := plugingetter.Checksummer{ Type: "sha256", Hash: sha256.New(), @@ -303,19 +539,20 @@ func createMockChecksumFile(t testing.TB, filePath string) { f, err := os.Open(filePath) if err != nil { - t.Fatalf("failed to open fake plugin binary: %v", err) + return "", fmt.Errorf("failed to open fake plugin binary: %v", err) } defer f.Close() sum, err := cs.Sum(f) if err != nil { - t.Fatalf("failed to checksum fake plugin binary: %v", err) + return "", fmt.Errorf("failed to checksum fake plugin binary: %v", err) } - t.Logf("creating fake plugin checksum file %s with contents %x", filePath+cs.FileExt(), string(sum)) - if err := os.WriteFile(filePath+cs.FileExt(), []byte(fmt.Sprintf("%x", sum)), os.ModePerm); err != nil { - t.Fatalf("failed to write checksum fake plugin binary: %v", err) + sumfile := filePath + cs.FileExt() + if err := os.WriteFile(sumfile, []byte(fmt.Sprintf("%x", sum)), os.ModePerm); err != nil { + return "", fmt.Errorf("failed to write checksum fake plugin binary: %v", err) } + return sumfile, nil } func createMockInstalledPlugins(t *testing.T, plugins map[string]pluginsdk.Set, opts ...func(tb testing.TB, filePath string)) { @@ -461,180 +698,3 @@ var ( }, } ) - -func Test_multiplugin_describe(t *testing.T) { - createMockPlugins(t, mockPlugins) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) - } - - for mockPluginName, plugin := range mockPlugins { - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName - - if !c.Builders.Has(expectedBuilderName) { - t.Fatalf("expected to find builder %q", expectedBuilderName) - } - } - for mockProvisionerName := range plugin.Provisioners { - expectedProvisionerName := mockPluginName + "-" + mockProvisionerName - if !c.Provisioners.Has(expectedProvisionerName) { - t.Fatalf("expected to find builder %q", expectedProvisionerName) - } - } - for mockPostProcessorName := range plugin.PostProcessors { - expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName - if !c.PostProcessors.Has(expectedPostProcessorName) { - t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) - } - } - for mockDatasourceName := range plugin.Datasources { - expectedDatasourceName := mockPluginName + "-" + mockDatasourceName - if !c.DataSources.Has(expectedDatasourceName) { - t.Fatalf("expected to find datasource %q", expectedDatasourceName) - } - } - } -} - -func Test_multiplugin_describe_installed(t *testing.T) { - createMockInstalledPlugins(t, mockInstalledPlugins, createMockChecksumFile) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) - } - - for mockPluginName, plugin := range mockInstalledPlugins { - mockPluginName = strings.Split(mockPluginName, "_")[0] - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName - if !c.Builders.Has(expectedBuilderName) { - t.Fatalf("expected to find builder %q", expectedBuilderName) - } - } - for mockProvisionerName := range plugin.Provisioners { - expectedProvisionerName := mockPluginName + "-" + mockProvisionerName - if !c.Provisioners.Has(expectedProvisionerName) { - t.Fatalf("expected to find builder %q", expectedProvisionerName) - } - } - for mockPostProcessorName := range plugin.PostProcessors { - expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName - if !c.PostProcessors.Has(expectedPostProcessorName) { - t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) - } - } - for mockDatasourceName := range plugin.Datasources { - expectedDatasourceName := mockPluginName + "-" + mockDatasourceName - if !c.DataSources.Has(expectedDatasourceName) { - t.Fatalf("expected to find datasource %q", expectedDatasourceName) - } - } - } -} - -func Test_multiplugin_describe_installed_for_invalid(t *testing.T) { - tc := []struct { - desc string - installedPluginsMock map[string]pluginsdk.Set - createMockFn func(*testing.T, map[string]pluginsdk.Set) - }{ - { - desc: "Incorrectly named plugins", - installedPluginsMock: invalidInstalledPluginsMock, - createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { - createMockInstalledPlugins(t, mocks, createMockChecksumFile) - }, - }, - { - desc: "Plugins missing checksums", - installedPluginsMock: mockInstalledPlugins, - createMockFn: func(t *testing.T, mocks map[string]pluginsdk.Set) { - createMockInstalledPlugins(t, mocks) - }, - }, - } - - for _, tt := range tc { - t.Run(tt.desc, func(t *testing.T) { - tt.createMockFn(t, tt.installedPluginsMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) - } - if c.Builders.Has("feather") { - t.Fatalf("expected to not find builder %q", "feather") - } - for mockPluginName, plugin := range tt.installedPluginsMock { - mockPluginName = strings.Split(mockPluginName, "_")[0] - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName - if c.Builders.Has(expectedBuilderName) { - t.Fatalf("expected to not find builder %q", expectedBuilderName) - } - } - for mockProvisionerName := range plugin.Provisioners { - expectedProvisionerName := mockPluginName + "-" + mockProvisionerName - if c.Provisioners.Has(expectedProvisionerName) { - t.Fatalf("expected to not find builder %q", expectedProvisionerName) - } - } - for mockPostProcessorName := range plugin.PostProcessors { - expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName - if c.PostProcessors.Has(expectedPostProcessorName) { - t.Fatalf("expected to not find post-processor %q", expectedPostProcessorName) - } - } - for mockDatasourceName := range plugin.Datasources { - expectedDatasourceName := mockPluginName + "-" + mockDatasourceName - if c.DataSources.Has(expectedDatasourceName) { - t.Fatalf("expected to not find datasource %q", expectedDatasourceName) - } - } - } - }) - } -} - -func Test_multiplugin_defaultName(t *testing.T) { - createMockPlugins(t, defaultNameMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) - } - - expectedBuilderNames := []string{"foo-bar", "foo-baz", "foo"} - for _, mockBuilderName := range expectedBuilderNames { - if !c.Builders.Has(mockBuilderName) { - t.Fatalf("expected to find builder %q; builders is %#v", mockBuilderName, c.Builders) - } - } -} - -func Test_only_one_multiplugin_defaultName_each_plugin_type(t *testing.T) { - createMockPlugins(t, doubleDefaultMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() - if err != nil { - t.Fatal("Should not have error because pluginsdk.DEFAULT_NAME is used twice but only once per plugin type.") - } -} From 99c79ecbd6b0fa25ead81a0693429b1b4c764263 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 2 Aug 2023 15:34:06 -0400 Subject: [PATCH 50/92] Add build tags to skip amd64 tests on darwin/arm64 (#12549) --- command/init_test.go | 2 ++ command/plugins_install_test.go | 2 ++ command/plugins_remove_test.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/command/init_test.go b/command/init_test.go index 7f35d3f4cc5..8a10cbb0c73 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -1,6 +1,8 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +//go:build amd64 && (darwin || windows || linux) + package command import ( diff --git a/command/plugins_install_test.go b/command/plugins_install_test.go index 577d8b3f776..7f34cb5dddd 100644 --- a/command/plugins_install_test.go +++ b/command/plugins_install_test.go @@ -1,6 +1,8 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +//go:build amd64 && (darwin || windows || linux) + package command import ( diff --git a/command/plugins_remove_test.go b/command/plugins_remove_test.go index 41104db7146..83b2463bc02 100644 --- a/command/plugins_remove_test.go +++ b/command/plugins_remove_test.go @@ -1,6 +1,8 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +//go:build amd64 && (darwin || windows || linux) + package command import ( From b29abbcd8c9364a721fab8be6aac331e26d4b744 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 20 Jul 2023 15:53:52 -0400 Subject: [PATCH 51/92] Dockerfile: remove trailing whitespaces --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 75acdcd3450..5724076b480 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,13 @@ # SPDX-License-Identifier: MPL-2.0 # ======================================================================== -# +# # This Dockerfile contains multiple targets. # Use 'docker build --target= .' to build one. # e.g. `docker build --target=release-light .` # -# All non-dev targets have a PRODUCT_VERSION argument that must be provided -# via --build-arg=PRODUCT_VERSION= when building. +# All non-dev targets have a PRODUCT_VERSION argument that must be provided +# via --build-arg=PRODUCT_VERSION= when building. # e.g. --build-arg PRODUCT_VERSION=1.11.2 # # For local dev and testing purposes, please build and use the `dev` docker image. @@ -28,7 +28,7 @@ COPY bin/packer /bin/packer ENTRYPOINT ["/bin/packer"] -# Official docker image that includes binaries from releases.hashicorp.com. +# Official docker image that includes binaries from releases.hashicorp.com. # This downloads the release from releases.hashicorp.com and therefore requires that # the release is published before building the Docker image. FROM docker.mirror.hashicorp.services/alpine:latest as official @@ -79,7 +79,7 @@ ENTRYPOINT ["/bin/packer"] # Light docker image which can be used to run the binary from a container. -# This image builds from the locally generated binary in ./bin/, and from CI-built binaries within CI. +# This image builds from the locally generated binary in ./bin/, and from CI-built binaries within CI. # To generate the local binary, run `make dev`. # This image is published to DockerHub under the `light`, `light-$VERSION`, and `latest` tags. FROM docker.mirror.hashicorp.services/alpine:latest as release-light From ffe277677063c1d5e3711e693ad3baeb80f43c7d Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 21 Jul 2023 11:38:29 -0400 Subject: [PATCH 52/92] README: fix link to CONTRIBUTING Since the main branch is not called master anymore, and the anchor was renamed, we fix both these changes in the link to that page from the README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af75e1ed95b..c6a6703d72a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ key points. First, [download a pre-built Packer binary](https://www.packer.io/downloads.html) for your operating system or [compile Packer -yourself](https://github.com/hashicorp/packer/blob/master/.github/CONTRIBUTING.md#setting-up-go-to-work-on-packer). +yourself](https://github.com/hashicorp/packer/blob/main/.github/CONTRIBUTING.md#setting-up-go). After Packer is installed, create your first template, which tells Packer what platforms to build images for and how you want to build them. In our From 838736982c6248bd47c631f01f16e8f57ee716d6 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 21 Jul 2023 11:39:25 -0400 Subject: [PATCH 53/92] Dockerfile: add release-full target In addition to the `release-light' target, we add a `release_full' target to the Dockerfile, so that we can ship an image of Packer with the official plugins pre-bundled in their latest version. --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5724076b480..d50c96ebcf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -104,6 +104,24 @@ COPY dist/$TARGETOS/$TARGETARCH/$BIN_NAME /bin/ ENTRYPOINT ["/bin/packer"] +# Full docker image which can be used to run the binary from a container. +# This image is essentially the same as the `release-light` one, but embeds +# the official plugins in it. +FROM release-light as release-full + +# Install the latest version of the official plugins +RUN /bin/packer plugins install "github.com/hashicorp/amazon" && \ + /bin/packer plugins install "github.com/hashicorp/ansible" && \ + /bin/packer plugins install "github.com/hashicorp/azure" && \ + /bin/packer plugins install "github.com/hashicorp/docker" && \ + /bin/packer plugins install "github.com/hashicorp/googlecompute" && \ + /bin/packer plugins install "github.com/hashicorp/qemu" && \ + /bin/packer plugins install "github.com/hashicorp/vagrant" && \ + /bin/packer plugins install "github.com/hashicorp/virtualbox" && \ + /bin/packer plugins install "github.com/hashicorp/vmware" && \ + /bin/packer plugins install "github.com/hashicorp/vsphere" + +ENTRYPOINT ["/bin/packer"] # Set default target to 'dev'. FROM dev From c6da7777150b7751b8f4a968180dfe71305093d7 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 21 Jul 2023 11:43:39 -0400 Subject: [PATCH 54/92] workflows: add docker-full to build workflow --- .github/workflows/build.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b713ef62393..a756fc56013 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -222,7 +222,7 @@ jobs: instructions: |- go build -o "$BIN_PATH" -ldflags="$LD_FLAGS" -tags netcgo -trimpath -buildvcs=false - build-docker: + build-docker-light: name: Docker light ${{ matrix.arch }} build needs: - set-product-version @@ -251,3 +251,31 @@ jobs: dev_tags: | docker.io/hashicorppreview/${{ env.REPO_NAME }}:${{ env.version }} docker.io/hashicorppreview/${{ env.REPO_NAME }}:${{ env.version }}-${{ github.sha }} + + build-docker-full: + name: Docker full ${{ matrix.arch }} build + needs: + - set-product-version + - build-linux + runs-on: ubuntu-latest + strategy: + matrix: + arch: [ "arm", "arm64", "386", "amd64" ] + env: + version: ${{ needs.set-product-version.outputs.product-version }} + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - name: Docker Build (Action) + uses: hashicorp/actions-docker-build@v1 + with: + version: ${{ env.version }} + target: release-full + arch: ${{ matrix.arch }} + tags: | + docker.io/hashicorp/${{ env.REPO_NAME }}:full + docker.io/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} + public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full + public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} + dev_tags: | + docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }} + docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }}-${{ github.sha }} From 55854f55377872adddb9d017a800fe33a8a0fb0e Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 25 Jul 2023 11:40:46 -0400 Subject: [PATCH 55/92] Makefile: only build dev version of binary/docker The Docker images release-light and release-full are not to be built locally from a dev build, but from a release, and the commands to build those images are only referenced in CI, so we don't need to ship them as part of the makefile. In addition, those images are not straightforward to build from the Makefile, as they require quite a few things from the environment, as well as the binary installed in a specific location, which is never setup by the rest of the Makefile. Therefore, we opted to simplify the Makefile so that it only builds docker-dev for local use. --- Dockerfile | 51 --------------------------------------------------- Makefile | 35 ++++++++--------------------------- 2 files changed, 8 insertions(+), 78 deletions(-) diff --git a/Dockerfile b/Dockerfile index d50c96ebcf0..1b5ae54e942 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,57 +27,6 @@ COPY bin/packer /bin/packer ENTRYPOINT ["/bin/packer"] - -# Official docker image that includes binaries from releases.hashicorp.com. -# This downloads the release from releases.hashicorp.com and therefore requires that -# the release is published before building the Docker image. -FROM docker.mirror.hashicorp.services/alpine:latest as official - -# This is the release of Packer to pull in. -ARG PRODUCT_VERSION - -LABEL name="Packer" \ - maintainer="HashiCorp Packer Team " \ - vendor="HashiCorp" \ - version=$PRODUCT_VERSION \ - release=$PRODUCT_VERSION \ - summary="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration." \ - description="Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. Please submit issues to https://github.com/hashicorp/packer/issues" - -# This is the location of the releases. -ENV HASHICORP_RELEASES=https://releases.hashicorp.com - -RUN set -eux && \ - apk add --no-cache git bash wget openssl gnupg xorriso && \ - gpg --keyserver keyserver.ubuntu.com --recv-keys C874011F0AB405110D02105534365D9472D7468F && \ - mkdir -p /tmp/build && \ - cd /tmp/build && \ - apkArch="$(apk --print-arch)" && \ - case "${apkArch}" in \ - aarch64) packerArch='arm64' ;; \ - armhf) packerArch='arm' ;; \ - x86) packerArch='386' ;; \ - x86_64) packerArch='amd64' ;; \ - *) echo >&2 "error: unsupported architecture: ${apkArch} (see ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/)" && exit 1 ;; \ - esac && \ - wget ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/packer_${PRODUCT_VERSION}_linux_${packerArch}.zip && \ - wget ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/packer_${PRODUCT_VERSION}_SHA256SUMS && \ - wget ${HASHICORP_RELEASES}/packer/${PRODUCT_VERSION}/packer_${PRODUCT_VERSION}_SHA256SUMS.sig && \ - gpg --batch --verify packer_${PRODUCT_VERSION}_SHA256SUMS.sig packer_${PRODUCT_VERSION}_SHA256SUMS && \ - grep packer_${PRODUCT_VERSION}_linux_${packerArch}.zip packer_${PRODUCT_VERSION}_SHA256SUMS | sha256sum -c && \ - unzip -d /tmp/build packer_${PRODUCT_VERSION}_linux_${packerArch}.zip && \ - cp /tmp/build/packer /bin/packer && \ - cd /tmp && \ - rm -rf /tmp/build && \ - gpgconf --kill all && \ - apk del gnupg openssl && \ - rm -rf /root/.gnupg && \ - # Tiny smoke test to ensure the binary we downloaded runs - packer version - -ENTRYPOINT ["/bin/packer"] - - # Light docker image which can be used to run the binary from a container. # This image builds from the locally generated binary in ./bin/, and from CI-built binaries within CI. # To generate the local binary, run `make dev`. diff --git a/Makefile b/Makefile index 01d62f0053c..ed46303684f 100644 --- a/Makefile +++ b/Makefile @@ -71,41 +71,22 @@ dev: ## Build and install a development build # Docker build variables and targets REGISTRY_NAME?=docker.io/hashicorp IMAGE_NAME=packer -VERSION?=1.7.10 -IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(VERSION) -IMAGE_TAG_DEV=$(REGISTRY_NAME)/$(IMAGE_NAME):latest-$(shell git rev-parse --short HEAD) - -docker: docker-official -docker-light: docker-official - -# Builds from the releases.hashicorp.com official binary -docker-official: - docker build \ - --tag $(IMAGE_TAG) \ - --tag hashicorp/packer:latest \ - --target=official \ - --build-arg VERSION=$(VERSION) \ - . +IMAGE_TAG_DEV=$(REGISTRY_NAME)/$(IMAGE_NAME):latest-$(GIT_COMMIT) -# Builds multiarch from the releases.hashicorp.com official binary -docker-multiarch-official: - docker buildx build \ - --tag $(IMAGE_TAG) \ - --tag hashicorp/packer:latest \ - --target=official \ - --build-arg VERSION=$(VERSION) \ - --platform linux/amd64,linux/arm64 \ - . +docker: docker-dev # Builds from the locally generated binary in ./bin/ # To generate the local binary, run `make dev` -docker-dev: export GOOS=linux -docker-dev: export GOARCH=amd64 -docker-dev: dev +docker-dev: + @GOOS=linux \ + GOARCH=amd64 \ + CGO_ENABLED=0 \ + go build -ldflags '$(GOLDFLAGS)' -o bin/packer . @docker build \ --tag $(IMAGE_TAG_DEV) \ --target=dev \ . + @rm -f bin/packer # Clean up the Linux/amd64 binary to avoid conficts on other OS/archs lint: install-lint-deps ## Lint Go code @if [ ! -z $(PKG_NAME) ]; then \ From 376f0e9991c63d742dd8c93a89a7aec5e4dd838e Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 3 Aug 2023 09:39:47 -0400 Subject: [PATCH 56/92] docker: remove trailing spaces for Docker README --- .release/docker/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.release/docker/README.md b/.release/docker/README.md index 4fdf9272958..ac1181da263 100644 --- a/.release/docker/README.md +++ b/.release/docker/README.md @@ -1,6 +1,6 @@ # Packer Docker Container -The root of this repository contains the officially supported HashiCorp Dockerfile to build the hashicorp/packer docker image. The `dev` docker image should be built for local dev and testing, while the production docker image, `release`, is built in CI and makes use of CI-built binaries. The `official` docker image is built using the official binaries from releases.hashicorp.com. +The root of this repository contains the officially supported HashiCorp Dockerfile to build the hashicorp/packer docker image. The `dev` docker image should be built for local dev and testing, while the production docker image, `release`, is built in CI and makes use of CI-built binaries. The `official` docker image is built using the official binaries from releases.hashicorp.com. ## Build @@ -17,14 +17,14 @@ development or release modes: This repository automatically builds containers for using the [`packer`](https://packer.io) command line program. It contains two distinct varieties of build, an `official` version, aka `light`, which just contains the binary. -It also contains a `dev` version, aka `full`, which compiles the binary from source +It also contains a `dev` version, aka `full`, which compiles the binary from source inside the container before exposing it for use. ##### `official` The `official` version of this container will copy the current stable version of the binary, taken from releases.hashicorp.com, into the container. It will also -set it for use as the default entrypoint. This will be the best option for most uses, +set it for use as the default entrypoint. This will be the best option for most uses, especially if you are just looking to run the binary from a container. This image is tagged as both `official` and `light`. The `latest` tag on DockerHub also points to this version. @@ -64,8 +64,8 @@ docker run \ ~> **Note**: packer init is available from Packer v1.7.0 and later -The command will mount the working directory (`pwd`) to `workspace`, which is the working directory (`-w`) inside the container. -Any plugin installed with `packer init` will be installed under the directory specified under the `PACKER_PLUGIN_PATH` environment variable. `PACKER_PLUGIN_PATH` must be set to a path inside the volume mount so that plugins can become available at `packer build`. +The command will mount the working directory (`pwd`) to `workspace`, which is the working directory (`-w`) inside the container. +Any plugin installed with `packer init` will be installed under the directory specified under the `PACKER_PLUGIN_PATH` environment variable. `PACKER_PLUGIN_PATH` must be set to a path inside the volume mount so that plugins can become available at `packer build`. Running `packer build` ```shell From 168e464ee455e91d952eca4a634b598a0c656c8d Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 3 Aug 2023 10:06:01 -0400 Subject: [PATCH 57/92] docker: add full image to docker README --- .release/docker/README.md | 43 +++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.release/docker/README.md b/.release/docker/README.md index ac1181da263..f733efbeaf9 100644 --- a/.release/docker/README.md +++ b/.release/docker/README.md @@ -1,37 +1,46 @@ # Packer Docker Container -The root of this repository contains the officially supported HashiCorp Dockerfile to build the hashicorp/packer docker image. The `dev` docker image should be built for local dev and testing, while the production docker image, `release`, is built in CI and makes use of CI-built binaries. The `official` docker image is built using the official binaries from releases.hashicorp.com. +The root of this repository contains the officially supported HashiCorp Dockerfile to build the hashicorp/packer docker image. The `dev` docker image should be built for local dev and testing, while the production docker image, `release`, is built in CI and makes use of CI-built binaries. The `light` and `full` docker images are built using the official binaries from releases.hashicorp.com. ## Build -See the Makefile targets in the root of this repository for building Packer images in either -development or release modes: - - - `make docker-dev` - - `make docker-official` - - `make docker-multiarch-official` - - `make docker` +Refer to the Makefile of this repository, especially the `docker` and `docker-dev` targets to build a local version of the dev image based on the sources available. ### Usage This repository automatically builds containers for using the -[`packer`](https://packer.io) command line program. It contains two distinct -varieties of build, an `official` version, aka `light`, which just contains the binary. -It also contains a `dev` version, aka `full`, which compiles the binary from source +[`packer`](https://developer.hashicorp.com/packer) command line program. It contains three distinct +varieties of build: a `light` version, which just contains the binary, +a `full` build, which contains the Packer binary with pre-installed plugins, +and a `dev` version, which compiles the binary from source inside the container before exposing it for use. -##### `official` +##### `light` -The `official` version of this container will copy the current stable version of +The `light` version of this container will copy the current stable version of the binary, taken from releases.hashicorp.com, into the container. It will also set it for use as the default entrypoint. This will be the best option for most uses, -especially if you are just looking to run the binary from a container. This image -is tagged as both `official` and `light`. +especially if you are just looking to run the binary from a container. The `latest` tag on DockerHub also points to this version. You can use this version with the following: ```shell -docker run hashicorp/packer:official +docker run hashicorp/packer:light +``` + +##### `full` + +The `full` version of the container builds upon `light` and pre-installs +the plugins officially maintained by HashiCorp. + +You can use this version with the following: +```shell +docker run hashicorp/packer:full +``` + +You can view the list of pre-installed plugins with the following: +```shell +docker run hashicorp/packer:full plugins installed ``` ##### `dev` @@ -41,7 +50,7 @@ the current ref of this [repository](https://github.com/hashicorp/packer). Using official `golang` image](https://hub.docker.com/_/golang/) as a base, this container will copy the source from the current branch, build the binary, and expose it for running. Because all build artifacts are included, it should be quite a bit larger than -the `official` image. This version of the container is most useful for development or +the `light` image. This version of the container is most useful for development or debugging. You can use this version with the following: From 9ccec0d4d501d02dd6f6e521c9b0d7efd3e07872 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Mon, 7 Aug 2023 20:54:19 -0400 Subject: [PATCH 58/92] Removed repetitive statement from HCP debug logs (#12552) * Remove repetitive log statement The log being removed is duplicated each time evalContext is called, which seems like an unneeded debug log. --- hcl2template/types.packer_config.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 84d1fe8de7d..003db57753c 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -123,8 +123,6 @@ func (cfg *PackerConfig) EvalContext(ctx BlockContext, variables map[string]cty. iterID, ok := cfg.HCPVars["iterationID"] if ok { - log.Printf("iterationID set: %q", iterID) - ectx.Variables[packerAccessor] = cty.ObjectVal(map[string]cty.Value{ "version": cty.StringVal(cfg.CorePackerVersionString), "iterationID": iterID, From 4d0a51c1892ea91f5eb2d5f56fabe66d729b31d2 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 8 Aug 2023 09:24:53 -0400 Subject: [PATCH 59/92] go.mod: bump golang.org/x/net to v0.13.0 The version of the golang.org/x/net we used (v0.8.0), is vulnerable to a rendering issue, potentially escaping text that should not be, which can enable other attacks then. Packer itself is not vulnerable to the CVE as we don't render web pages, but security checks do point it as an issue, so we fix it by updating the dependencies. CVE refrerence: GO-2023-1988 --- go.mod | 10 +++++----- go.sum | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index fa48d7d58da..ab2d8edd000 100644 --- a/go.mod +++ b/go.mod @@ -45,14 +45,14 @@ require ( github.com/ulikunitz/xz v0.5.10 github.com/zclconf/go-cty v1.10.0 github.com/zclconf/go-cty-yaml v1.0.1 - golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect + golang.org/x/crypto v0.11.0 // indirect golang.org/x/mod v0.8.0 - golang.org/x/net v0.8.0 + golang.org/x/net v0.13.0 golang.org/x/oauth2 v0.1.0 golang.org/x/sync v0.1.0 - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/tools v0.6.0 google.golang.org/api v0.101.0 // indirect google.golang.org/grpc v1.50.1 diff --git a/go.sum b/go.sum index 96c6e63f953..81a0347bf5c 100644 --- a/go.sum +++ b/go.sum @@ -793,8 +793,9 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= @@ -842,8 +843,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= +golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.1.0 h1:isLCZuhj4v+tYv7eskaN4v/TM+A1begWWgyVJDdl1+Y= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= @@ -903,21 +904,22 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= From 19055df3ec612ab556aa48e8eac2cb2d401fbab5 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:53:29 -0700 Subject: [PATCH 60/92] [COMPLIANCE] License changes (#12568) * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at https://hashi.co/license-faq, and details of the license at www.hashicorp.com/bsl. * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/labeler-issue-triage.yml | 2 +- .golangci.yml | 2 +- .release/ci.hcl | 2 +- .release/release-metadata.hcl | 2 +- .release/security-scan.hcl | 2 +- Dockerfile | 2 +- LICENSE | 436 +++--------------- acctest/plugin/bundled_plugin_test.go | 2 +- acctest/plugin/component_acc_test.go | 2 +- acctest/plugin/plugin_acc_test.go | 2 +- acctest/testing.go | 2 +- acctest/testing_test.go | 2 +- background_check.go | 2 +- background_check_openbsd.go | 2 +- builder/file/artifact.go | 2 +- builder/file/artifact_test.go | 2 +- builder/file/builder.go | 2 +- builder/file/builder_test.go | 2 +- builder/file/config.go | 2 +- builder/file/config_test.go | 2 +- builder/file/version/version.go | 2 +- builder/null/artifact_export.go | 2 +- builder/null/artifact_export_test.go | 2 +- builder/null/builder.go | 2 +- builder/null/builder_test.go | 2 +- builder/null/config.go | 2 +- builder/null/config_test.go | 2 +- builder/null/ssh.go | 2 +- builder/null/version/version.go | 2 +- checkpoint.go | 2 +- cmd/generate-fixer-deprecations/main.go | 2 +- cmd/ssh-keygen/main.go | 2 +- command/build.go | 2 +- command/build_cancellation_test.go | 2 +- command/build_cleanup_script_test.go | 2 +- command/build_parallel_test.go | 2 +- command/build_test.go | 2 +- command/build_timeout_test.go | 2 +- command/build_windows_test.go | 2 +- command/cli.go | 2 +- command/command_test.go | 2 +- command/config_file_unix.go | 2 +- command/config_file_windows.go | 2 +- command/console.go | 2 +- command/console_test.go | 2 +- command/enumflag/flag.go | 2 +- command/exec_test.go | 2 +- command/fix.go | 2 +- command/fix_test.go | 2 +- command/flag-kv/flag.go | 2 +- command/flag-kv/flag_json.go | 2 +- command/flag-kv/flag_json_test.go | 2 +- command/flag-kv/flag_strings.go | 2 +- command/flag-kv/flag_strings_test.go | 2 +- command/flag-kv/flag_test.go | 2 +- command/flag-slice/flag.go | 2 +- command/flag-slice/flag_test.go | 2 +- command/fmt.go | 2 +- command/fmt_test.go | 2 +- command/hcl2_upgrade.go | 2 +- command/hcl2_upgrade_test.go | 2 +- command/init.go | 2 +- command/init_test.go | 2 +- command/inspect.go | 2 +- command/inspect_test.go | 2 +- command/meta.go | 2 +- command/plugins.go | 2 +- command/plugins_install.go | 2 +- command/plugins_install_test.go | 2 +- command/plugins_installed.go | 2 +- command/plugins_remove.go | 2 +- command/plugins_remove_test.go | 2 +- command/plugins_required.go | 2 +- command/signal.go | 2 +- command/test_utils.go | 2 +- command/utils.go | 2 +- command/utils_test.go | 2 +- command/validate.go | 2 +- command/validate_test.go | 2 +- command/vendored_plugins.go | 2 +- command/version.go | 2 +- command/version_test.go | 2 +- commands.go | 2 +- config.go | 2 +- config_test.go | 2 +- datasource/hcp-packer-image/data.go | 2 +- datasource/hcp-packer-iteration/data.go | 2 +- .../hcp-packer-iteration/data_acc_test.go | 2 +- datasource/http/data.go | 2 +- datasource/http/data_acc_test.go | 2 +- datasource/null/data.go | 2 +- fix/fixer.go | 2 +- fix/fixer_amazon_enhanced_networking.go | 2 +- fix/fixer_amazon_enhanced_networking_test.go | 2 +- fix/fixer_amazon_private_ip.go | 2 +- fix/fixer_amazon_private_ip_test.go | 2 +- fix/fixer_amazon_shutdown_behavior.go | 2 +- fix/fixer_amazon_shutdown_behavior_test.go | 2 +- fix/fixer_amazon_spot_price_product.go | 2 +- ...r_amazon_temporary_security_group_cidrs.go | 2 +- ...zon_temporary_security_group_cidrs_test.go | 2 +- fix/fixer_azure_exclude_from_latest.go | 2 +- fix/fixer_azure_exclude_from_latest_test.go | 2 +- fix/fixer_clean_image_name.go | 2 +- fix/fixer_clean_image_name_test.go | 2 +- fix/fixer_comm_config.go | 2 +- fix/fixer_comm_config_test.go | 2 +- fix/fixer_createtime.go | 2 +- fix/fixer_createtime_test.go | 2 +- fix/fixer_docker_email.go | 2 +- fix/fixer_galaxy_command.go | 2 +- fix/fixer_galaxy_command_test.go | 2 +- fix/fixer_hyperv_cpu_and_ram_naming.go | 2 +- fix/fixer_hyperv_deprecations.go | 2 +- fix/fixer_hyperv_deprecations_test.go | 2 +- fix/fixer_hyperv_vmxc_typo.go | 2 +- fix/fixer_hyperv_vmxc_typo_test.go | 2 +- fix/fixer_iso_checksum_type_and_url.go | 2 +- fix/fixer_iso_checksum_type_and_url_test.go | 2 +- fix/fixer_iso_md5.go | 2 +- fix/fixer_iso_md5_test.go | 2 +- fix/fixer_parallels_deprecations.go | 2 +- fix/fixer_parallels_deprecations_test.go | 2 +- fix/fixer_parallels_headless.go | 2 +- fix/fixer_parallels_headless_test.go | 2 +- fix/fixer_powershell_escapes.go | 2 +- fix/fixer_pp_docker_tag_tags.go | 2 +- fix/fixer_pp_docker_tag_tags_test.go | 2 +- fix/fixer_pp_manifest_filename.go | 2 +- fix/fixer_pp_manifest_filename_test.go | 2 +- fix/fixer_pp_vagrant_override.go | 2 +- fix/fixer_pp_vagrant_override_test.go | 2 +- fix/fixer_proxmox_type.go | 2 +- fix/fixer_proxmox_type_test.go | 2 +- fix/fixer_qemu_disk_size.go | 2 +- fix/fixer_qemu_disk_size_test.go | 2 +- fix/fixer_qemu_host_port.go | 2 +- fix/fixer_qemu_host_port_test.go | 2 +- fix/fixer_scaleway_access_key.go | 2 +- fix/fixer_scaleway_access_key_test.go | 2 +- fix/fixer_ssh_timeout.go | 2 +- fix/fixer_ssh_timeout_test.go | 2 +- fix/fixer_sshdisableagent.go | 2 +- fix/fixer_sshdisableagent_test.go | 2 +- fix/fixer_sshkeypath.go | 2 +- fix/fixer_sshkeypath_test.go | 2 +- fix/fixer_test.go | 2 +- fix/fixer_virtualbox_gaattach.go | 2 +- fix/fixer_virtualbox_gaattach_test.go | 2 +- fix/fixer_virtualbox_rename.go | 2 +- fix/fixer_virtualbox_rename_test.go | 2 +- fix/fixer_vmware_compaction.go | 2 +- fix/fixer_vmware_compaction_test.go | 2 +- fix/fixer_vmware_rename.go | 2 +- fix/fixer_vmware_rename_test.go | 2 +- fix/fixer_vsphere_network_storage.go | 2 +- fix/fixer_vsphere_network_storage_test.go | 2 +- fix/helpers.go | 2 +- hcl2template/addrs/doc.go | 2 +- hcl2template/addrs/input_variable.go | 2 +- hcl2template/addrs/parse_ref.go | 2 +- hcl2template/addrs/plugin.go | 2 +- hcl2template/addrs/plugin_test.go | 2 +- hcl2template/addrs/referenceable.go | 2 +- hcl2template/common_test.go | 2 +- hcl2template/components.go | 2 +- hcl2template/decode.go | 2 +- hcl2template/docs.go | 2 +- hcl2template/formatter.go | 2 +- hcl2template/formatter_test.go | 2 +- hcl2template/function/Consul.go | 2 +- hcl2template/function/aws_secretetkey.go | 2 +- hcl2template/function/datetime.go | 2 +- hcl2template/function/datetime_test.go | 2 +- hcl2template/function/env.go | 2 +- hcl2template/function/index.go | 2 +- hcl2template/function/index_test.go | 2 +- hcl2template/function/length.go | 2 +- hcl2template/function/length_test.go | 2 +- hcl2template/function/templatefile.go | 2 +- hcl2template/function/templatefile_test.go | 2 +- hcl2template/function/vault.go | 2 +- hcl2template/functions.go | 2 +- hcl2template/internal/mock.go | 2 +- hcl2template/parser.go | 2 +- hcl2template/plugin.go | 2 +- hcl2template/repl/format.go | 2 +- hcl2template/repl/repl.go | 2 +- hcl2template/shim/mock.go | 2 +- hcl2template/shim/values.go | 2 +- hcl2template/shim/values_test.go | 2 +- hcl2template/types.build.from.go | 2 +- hcl2template/types.build.go | 2 +- .../types.build.hcp_packer_registry.go | 2 +- .../types.build.hcp_packer_registry_test.go | 2 +- hcl2template/types.build.post-processor.go | 2 +- hcl2template/types.build.provisioners.go | 2 +- hcl2template/types.build.provisioners_test.go | 2 +- hcl2template/types.build_test.go | 2 +- hcl2template/types.datasource.go | 2 +- hcl2template/types.datasource_test.go | 2 +- hcl2template/types.hcl_post-processor.go | 2 +- hcl2template/types.hcl_provisioner.go | 2 +- hcl2template/types.hcl_ref.go | 2 +- hcl2template/types.packer_config.go | 2 +- hcl2template/types.packer_config_test.go | 2 +- hcl2template/types.required_plugins.go | 2 +- hcl2template/types.required_plugins_test.go | 2 +- hcl2template/types.source.go | 2 +- hcl2template/types.source_test.go | 2 +- hcl2template/types.variables.go | 2 +- hcl2template/types.variables_test.go | 2 +- hcl2template/utils.go | 2 +- hcl2template/version.go | 2 +- hcl2template/version_required.go | 2 +- helper/wrappedreadline/wrappedreadline.go | 2 +- .../wrappedreadline_solaris.go | 2 +- .../wrappedreadline/wrappedreadline_unix.go | 2 +- .../wrappedreadline_windows.go | 2 +- helper/wrappedstreams/streams.go | 2 +- helper/wrappedstreams/streams_other.go | 2 +- helper/wrappedstreams/streams_windows.go | 2 +- internal/hcp/api/client.go | 2 +- internal/hcp/api/client_test.go | 2 +- internal/hcp/api/errors.go | 2 +- internal/hcp/api/mock_service.go | 2 +- internal/hcp/api/service.go | 2 +- internal/hcp/env/env.go | 2 +- internal/hcp/env/env_test.go | 2 +- internal/hcp/env/variables.go | 2 +- internal/hcp/registry/artifact.go | 2 +- internal/hcp/registry/errors.go | 2 +- internal/hcp/registry/hcl.go | 2 +- internal/hcp/registry/hcp.go | 2 +- internal/hcp/registry/json.go | 2 +- internal/hcp/registry/null_registry.go | 2 +- internal/hcp/registry/registry.go | 2 +- internal/hcp/registry/types.bucket.go | 2 +- .../hcp/registry/types.bucket_service_test.go | 2 +- internal/hcp/registry/types.bucket_test.go | 2 +- internal/hcp/registry/types.builds.go | 2 +- internal/hcp/registry/types.iterations.go | 2 +- .../hcp/registry/types.iterations_test.go | 2 +- log.go | 2 +- main.go | 2 +- main_test.go | 2 +- packer/build.go | 2 +- packer/build_test.go | 2 +- packer/builder_test.go | 2 +- packer/client_test.go | 2 +- packer/cmd_builder.go | 2 +- packer/cmd_builder_test.go | 2 +- packer/cmd_datasource.go | 2 +- packer/cmd_datasource_test.go | 2 +- packer/cmd_hook.go | 2 +- packer/cmd_hook_test.go | 2 +- packer/cmd_post_processor.go | 2 +- packer/cmd_post_processor_test.go | 2 +- packer/cmd_provisioner.go | 2 +- packer/cmd_provisioner_test.go | 2 +- packer/core.go | 2 +- packer/core_test.go | 2 +- packer/maps.go | 2 +- packer/packer_test.go | 2 +- packer/plugin-getter/checksum.go | 2 +- packer/plugin-getter/docs.go | 2 +- packer/plugin-getter/github/docs.go | 2 +- packer/plugin-getter/github/getter.go | 2 +- packer/plugin-getter/plugins.go | 2 +- packer/plugin-getter/plugins_test.go | 2 +- packer/plugin.go | 2 +- packer/plugin_client.go | 2 +- packer/plugin_discover_test.go | 2 +- packer/plugin_folders.go | 2 +- packer/plugin_test.go | 2 +- packer/post_processor_mock.go | 2 +- packer/progressbar.go | 2 +- packer/progressbar_solaris.go | 2 +- packer/progressbar_test.go | 2 +- packer/provisioner.go | 2 +- packer/provisioner_test.go | 2 +- packer/provisioner_timeout.go | 2 +- packer/run_interfaces.go | 2 +- packer/telemetry.go | 2 +- packer/telemetry_test.go | 2 +- packer/testing.go | 2 +- packer/ui.go | 2 +- packer/ui_test.go | 2 +- panic.go | 2 +- post-processor/artifice/artifact.go | 2 +- post-processor/artifice/post-processor.go | 2 +- post-processor/artifice/version/version.go | 2 +- post-processor/checksum/artifact.go | 2 +- post-processor/checksum/post-processor.go | 2 +- .../checksum/post-processor_test.go | 2 +- post-processor/checksum/version/version.go | 2 +- post-processor/compress/artifact.go | 2 +- post-processor/compress/artifact_test.go | 2 +- post-processor/compress/benchmark.go | 2 +- post-processor/compress/post-processor.go | 2 +- .../compress/post-processor_test.go | 2 +- post-processor/compress/tar_fix.go | 2 +- post-processor/compress/tar_fix_go110.go | 2 +- post-processor/compress/version/version.go | 2 +- post-processor/manifest/artifact.go | 2 +- post-processor/manifest/post-processor.go | 2 +- post-processor/manifest/version/version.go | 2 +- post-processor/shell-local/post-processor.go | 2 +- .../shell-local/post-processor_test.go | 2 +- post-processor/shell-local/version/version.go | 2 +- provisioner/breakpoint/provisioner.go | 2 +- provisioner/breakpoint/version/version.go | 2 +- provisioner/file/provisioner.go | 2 +- provisioner/file/provisioner_test.go | 2 +- provisioner/file/version/version.go | 2 +- provisioner/powershell/execution_policy.go | 2 +- .../powershell/execution_policy_test.go | 2 +- provisioner/powershell/provisioner.go | 2 +- .../powershell/provisioner_acc_test.go | 2 +- provisioner/powershell/provisioner_test.go | 2 +- provisioner/powershell/version/version.go | 2 +- provisioner/shell-local/provisioner.go | 2 +- .../shell-local/provisioner_acc_test.go | 2 +- provisioner/shell-local/provisioner_test.go | 2 +- provisioner/shell-local/version/version.go | 2 +- provisioner/shell/provisioner.go | 2 +- provisioner/shell/provisioner_acc_test.go | 2 +- provisioner/shell/provisioner_test.go | 2 +- provisioner/shell/unix_reader.go | 2 +- provisioner/shell/unix_reader_test.go | 2 +- provisioner/shell/version/version.go | 2 +- provisioner/sleep/provisioner.go | 2 +- provisioner/sleep/provisioner_test.go | 2 +- provisioner/sleep/version/version.go | 2 +- provisioner/windows-restart/provisioner.go | 2 +- .../windows-restart/provisioner_test.go | 2 +- .../windows-restart/version/version.go | 2 +- provisioner/windows-shell/provisioner.go | 2 +- provisioner/windows-shell/provisioner_test.go | 2 +- provisioner/windows-shell/version/version.go | 2 +- scripts/build.ps1 | 2 +- scripts/build.sh | 2 +- scripts/codesign_example.sh | 2 +- scripts/dist.sh | 2 +- scripts/generate-plugins.go | 2 +- scripts/off_gopath.sh | 2 +- scripts/prepare_changelog.sh | 2 +- scripts/sign.sh | 2 +- scripts/sort-md-list.py | 2 +- scripts/upgrade_plugins.sh | 2 +- scripts/vagrant-freebsd-priv-config.sh | 2 +- scripts/vagrant-freebsd-unpriv-bootstrap.sh | 2 +- scripts/vagrant-linux-priv-config.sh | 2 +- scripts/vagrant-linux-priv-go.sh | 2 +- scripts/vagrant-linux-unpriv-bootstrap.sh | 2 +- tty.go | 2 +- tty_solaris.go | 2 +- version/version.go | 2 +- 359 files changed, 419 insertions(+), 733 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index eae8012b936..b79897d5954 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 blank_issues_enabled: false contact_links: diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 1737a33b92c..6d9ef6d547c 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 bug: - 'panic:' diff --git a/.golangci.yml b/.golangci.yml index ccd990c0040..656b0373ac5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 issues: # List of regexps of issue texts to exclude, empty list by default. diff --git a/.release/ci.hcl b/.release/ci.hcl index 6ca7eb0de23..14dab1591d9 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 schema = "1" diff --git a/.release/release-metadata.hcl b/.release/release-metadata.hcl index 0fb2456679e..05d0b9f3a81 100644 --- a/.release/release-metadata.hcl +++ b/.release/release-metadata.hcl @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 url_docker_registry_dockerhub = "https://hub.docker.com/r/hashicorp/packer" url_docker_registry_ecr = "https://gallery.ecr.aws/hashicorp/packer" diff --git a/.release/security-scan.hcl b/.release/security-scan.hcl index 7d3258126bc..12ef1d53388 100644 --- a/.release/security-scan.hcl +++ b/.release/security-scan.hcl @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 container { dependencies = false diff --git a/Dockerfile b/Dockerfile index 1b5ae54e942..12c38fde6af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 # ======================================================================== # diff --git a/LICENSE b/LICENSE index c96665ef71f..2ecf202e305 100644 --- a/LICENSE +++ b/LICENSE @@ -1,375 +1,61 @@ -Copyright (c) 2013 HashiCorp, Inc. - -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. +License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. +“Business Source License” is a trademark of MariaDB Corporation Ab. + +Parameters + +Licensor: HashiCorp, Inc. +Licensed Work: The Licensed Work is (c) 2023 HashiCorp, Inc. +Additional Use Grant: You may make production use of the Licensed Work, + provided such use does not include offering the Licensed Work + to third parties on a hosted or embedded basis which is + competitive with HashiCorp's products. +Change Date: Four years from the date the Licensed Work is published. +Change License: MPL 2.0 + +For information about alternative licensing arrangements for the Licensed Work, +please contact licensing@hashicorp.com. + +Notice + +Business Source License 1.1 + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +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, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. diff --git a/acctest/plugin/bundled_plugin_test.go b/acctest/plugin/bundled_plugin_test.go index 9f21dfac626..c6652610955 100644 --- a/acctest/plugin/bundled_plugin_test.go +++ b/acctest/plugin/bundled_plugin_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package plugin diff --git a/acctest/plugin/component_acc_test.go b/acctest/plugin/component_acc_test.go index ff77adf636f..110d8d3765a 100644 --- a/acctest/plugin/component_acc_test.go +++ b/acctest/plugin/component_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // component_acc_test.go should contain acceptance tests for plugin components // to make sure all component types can be discovered and started. diff --git a/acctest/plugin/plugin_acc_test.go b/acctest/plugin/plugin_acc_test.go index 9e69afe3774..137fb394db4 100644 --- a/acctest/plugin/plugin_acc_test.go +++ b/acctest/plugin/plugin_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // plugin_acc_test.go should contain acceptance tests for features related to // installing, discovering and running plugins. diff --git a/acctest/testing.go b/acctest/testing.go index e716ec97b39..dbd877fb3d3 100644 --- a/acctest/testing.go +++ b/acctest/testing.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package acctest diff --git a/acctest/testing_test.go b/acctest/testing_test.go index 71247d4cef7..85364bd1154 100644 --- a/acctest/testing_test.go +++ b/acctest/testing_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package acctest diff --git a/background_check.go b/background_check.go index 3eaf7ee2348..30a0a65e2d5 100644 --- a/background_check.go +++ b/background_check.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build !openbsd // +build !openbsd diff --git a/background_check_openbsd.go b/background_check_openbsd.go index ff2ef4b0ef2..0fc5574ba9c 100644 --- a/background_check_openbsd.go +++ b/background_check_openbsd.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/builder/file/artifact.go b/builder/file/artifact.go index 9b9ed8ef949..4c33f6d45a3 100644 --- a/builder/file/artifact.go +++ b/builder/file/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package file diff --git a/builder/file/artifact_test.go b/builder/file/artifact_test.go index ea799e12f5f..02df6c2ae4e 100644 --- a/builder/file/artifact_test.go +++ b/builder/file/artifact_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package file diff --git a/builder/file/builder.go b/builder/file/builder.go index e6df9b54008..e9d9d8f9ebd 100644 --- a/builder/file/builder.go +++ b/builder/file/builder.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package file diff --git a/builder/file/builder_test.go b/builder/file/builder_test.go index dfa87277e2b..80fc326bdf4 100644 --- a/builder/file/builder_test.go +++ b/builder/file/builder_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package file diff --git a/builder/file/config.go b/builder/file/config.go index 017355ee6c7..244490a36da 100644 --- a/builder/file/config.go +++ b/builder/file/config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/builder/file/config_test.go b/builder/file/config_test.go index 60d3553a1f9..b6692495b9d 100644 --- a/builder/file/config_test.go +++ b/builder/file/config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package file diff --git a/builder/file/version/version.go b/builder/file/version/version.go index 3cb6b9ec19e..2136829ae88 100644 --- a/builder/file/version/version.go +++ b/builder/file/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/builder/null/artifact_export.go b/builder/null/artifact_export.go index ae6e46f2756..8b12610f81b 100644 --- a/builder/null/artifact_export.go +++ b/builder/null/artifact_export.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package null diff --git a/builder/null/artifact_export_test.go b/builder/null/artifact_export_test.go index ffa668865ec..265b8d36781 100644 --- a/builder/null/artifact_export_test.go +++ b/builder/null/artifact_export_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package null diff --git a/builder/null/builder.go b/builder/null/builder.go index 9b660bd24f9..a9a53dbd7e8 100644 --- a/builder/null/builder.go +++ b/builder/null/builder.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package null diff --git a/builder/null/builder_test.go b/builder/null/builder_test.go index b50d1484ff9..fdb52031d7a 100644 --- a/builder/null/builder_test.go +++ b/builder/null/builder_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package null diff --git a/builder/null/config.go b/builder/null/config.go index b240d57d98d..24ee61ed6fb 100644 --- a/builder/null/config.go +++ b/builder/null/config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/builder/null/config_test.go b/builder/null/config_test.go index 1123d470e09..67d35f66972 100644 --- a/builder/null/config_test.go +++ b/builder/null/config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package null diff --git a/builder/null/ssh.go b/builder/null/ssh.go index f79bdd1eed4..fbffbb13a3c 100644 --- a/builder/null/ssh.go +++ b/builder/null/ssh.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package null diff --git a/builder/null/version/version.go b/builder/null/version/version.go index f3b8cb444e1..27e53e312d1 100644 --- a/builder/null/version/version.go +++ b/builder/null/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/checkpoint.go b/checkpoint.go index 5ca534ea8d4..380cdd6bf29 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/cmd/generate-fixer-deprecations/main.go b/cmd/generate-fixer-deprecations/main.go index a3e76547428..4316a1605a0 100644 --- a/cmd/generate-fixer-deprecations/main.go +++ b/cmd/generate-fixer-deprecations/main.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/cmd/ssh-keygen/main.go b/cmd/ssh-keygen/main.go index a15797ea811..f47eca5791f 100644 --- a/cmd/ssh-keygen/main.go +++ b/cmd/ssh-keygen/main.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/command/build.go b/command/build.go index 842938adcb9..c77687c3586 100644 --- a/command/build.go +++ b/command/build.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/build_cancellation_test.go b/command/build_cancellation_test.go index 348b1d9180e..0ada639074a 100644 --- a/command/build_cancellation_test.go +++ b/command/build_cancellation_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/build_cleanup_script_test.go b/command/build_cleanup_script_test.go index 82f7fdd94e4..35639a4f4a9 100644 --- a/command/build_cleanup_script_test.go +++ b/command/build_cleanup_script_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/build_parallel_test.go b/command/build_parallel_test.go index 959134fd539..4758505241b 100644 --- a/command/build_parallel_test.go +++ b/command/build_parallel_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/build_test.go b/command/build_test.go index 8dac9b8e0aa..00685e98dc7 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/build_timeout_test.go b/command/build_timeout_test.go index 9896894ec2b..d97485b3490 100644 --- a/command/build_timeout_test.go +++ b/command/build_timeout_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/build_windows_test.go b/command/build_windows_test.go index 5c99cd95786..b18f4e3153a 100644 --- a/command/build_windows_test.go +++ b/command/build_windows_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/cli.go b/command/cli.go index de47a735c22..4ad80440f0e 100644 --- a/command/cli.go +++ b/command/cli.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/command_test.go b/command/command_test.go index 4666a4109b8..fcbec5fb0a7 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/config_file_unix.go b/command/config_file_unix.go index 31a8db0ee44..ec3932f9e0b 100644 --- a/command/config_file_unix.go +++ b/command/config_file_unix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build darwin || freebsd || linux || netbsd || openbsd || solaris // +build darwin freebsd linux netbsd openbsd solaris diff --git a/command/config_file_windows.go b/command/config_file_windows.go index 52cdf420c7c..ede0a618687 100644 --- a/command/config_file_windows.go +++ b/command/config_file_windows.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build windows // +build windows diff --git a/command/console.go b/command/console.go index 54281fdd6ed..f942ec4bd4f 100644 --- a/command/console.go +++ b/command/console.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/console_test.go b/command/console_test.go index b8c4989ff99..7b4bbc7d7b8 100644 --- a/command/console_test.go +++ b/command/console_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/enumflag/flag.go b/command/enumflag/flag.go index cbb58769190..c50e70b0714 100644 --- a/command/enumflag/flag.go +++ b/command/enumflag/flag.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package enumflag diff --git a/command/exec_test.go b/command/exec_test.go index cfdbda66c3a..c4bf24ab157 100644 --- a/command/exec_test.go +++ b/command/exec_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/fix.go b/command/fix.go index 893c788ef8d..708be59717d 100644 --- a/command/fix.go +++ b/command/fix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/fix_test.go b/command/fix_test.go index d092a8091c4..1c916b56b2a 100644 --- a/command/fix_test.go +++ b/command/fix_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/flag-kv/flag.go b/command/flag-kv/flag.go index 96cda3120ce..4361545ab2f 100644 --- a/command/flag-kv/flag.go +++ b/command/flag-kv/flag.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package kvflag diff --git a/command/flag-kv/flag_json.go b/command/flag-kv/flag_json.go index 25d34ef5de5..290bb4aa837 100644 --- a/command/flag-kv/flag_json.go +++ b/command/flag-kv/flag_json.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package kvflag diff --git a/command/flag-kv/flag_json_test.go b/command/flag-kv/flag_json_test.go index ab8a67e0ba3..d22f3545fd5 100644 --- a/command/flag-kv/flag_json_test.go +++ b/command/flag-kv/flag_json_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package kvflag diff --git a/command/flag-kv/flag_strings.go b/command/flag-kv/flag_strings.go index d639bde6abb..f99122ec971 100644 --- a/command/flag-kv/flag_strings.go +++ b/command/flag-kv/flag_strings.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package kvflag diff --git a/command/flag-kv/flag_strings_test.go b/command/flag-kv/flag_strings_test.go index 070e95c0d48..721265d1e52 100644 --- a/command/flag-kv/flag_strings_test.go +++ b/command/flag-kv/flag_strings_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package kvflag diff --git a/command/flag-kv/flag_test.go b/command/flag-kv/flag_test.go index 28644119578..5aed4ef33db 100644 --- a/command/flag-kv/flag_test.go +++ b/command/flag-kv/flag_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package kvflag diff --git a/command/flag-slice/flag.go b/command/flag-slice/flag.go index b75580ec227..7f8b9db269c 100644 --- a/command/flag-slice/flag.go +++ b/command/flag-slice/flag.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package sliceflag diff --git a/command/flag-slice/flag_test.go b/command/flag-slice/flag_test.go index d70b270b53b..fd225889284 100644 --- a/command/flag-slice/flag_test.go +++ b/command/flag-slice/flag_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package sliceflag diff --git a/command/fmt.go b/command/fmt.go index 9cfaa46b8d4..095a6fc8c69 100644 --- a/command/fmt.go +++ b/command/fmt.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/fmt_test.go b/command/fmt_test.go index b642cdef5ad..8fd058b379b 100644 --- a/command/fmt_test.go +++ b/command/fmt_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index 08b7d2ad745..7802d409875 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index afa8575aa8e..f0ffc7676f2 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/init.go b/command/init.go index b95eb86992b..5a066d96276 100644 --- a/command/init.go +++ b/command/init.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/init_test.go b/command/init_test.go index 8a10cbb0c73..07246d50081 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build amd64 && (darwin || windows || linux) diff --git a/command/inspect.go b/command/inspect.go index 827d61f70b1..7a77ab76bb8 100644 --- a/command/inspect.go +++ b/command/inspect.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/inspect_test.go b/command/inspect_test.go index 0d87ee71a71..f417b4cdc09 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/meta.go b/command/meta.go index fb3d9efb2a7..1989027499b 100644 --- a/command/meta.go +++ b/command/meta.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/plugins.go b/command/plugins.go index 0b415d8f5c0..6bc286dd19c 100644 --- a/command/plugins.go +++ b/command/plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/plugins_install.go b/command/plugins_install.go index d40bb46bd80..7082f134a8f 100644 --- a/command/plugins_install.go +++ b/command/plugins_install.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/plugins_install_test.go b/command/plugins_install_test.go index 7f34cb5dddd..105b9b00067 100644 --- a/command/plugins_install_test.go +++ b/command/plugins_install_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build amd64 && (darwin || windows || linux) diff --git a/command/plugins_installed.go b/command/plugins_installed.go index 58b4381a985..114c25b55a9 100644 --- a/command/plugins_installed.go +++ b/command/plugins_installed.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/plugins_remove.go b/command/plugins_remove.go index 32d77749c08..ac8c0882b8f 100644 --- a/command/plugins_remove.go +++ b/command/plugins_remove.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/plugins_remove_test.go b/command/plugins_remove_test.go index 83b2463bc02..61273487632 100644 --- a/command/plugins_remove_test.go +++ b/command/plugins_remove_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build amd64 && (darwin || windows || linux) diff --git a/command/plugins_required.go b/command/plugins_required.go index d484322291c..04f86b3628c 100644 --- a/command/plugins_required.go +++ b/command/plugins_required.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/signal.go b/command/signal.go index 5980192baf4..a47ac58aa22 100644 --- a/command/signal.go +++ b/command/signal.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/test_utils.go b/command/test_utils.go index 41e02dbcb7b..852343085cc 100644 --- a/command/test_utils.go +++ b/command/test_utils.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/utils.go b/command/utils.go index 9fee02d419c..359a96b9726 100644 --- a/command/utils.go +++ b/command/utils.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/utils_test.go b/command/utils_test.go index 426ea653eea..6af1f2c4881 100644 --- a/command/utils_test.go +++ b/command/utils_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/validate.go b/command/validate.go index 2b7e2107b0d..60199bdbf71 100644 --- a/command/validate.go +++ b/command/validate.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/validate_test.go b/command/validate_test.go index 5b51f378158..5b9da04d78b 100644 --- a/command/validate_test.go +++ b/command/validate_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go index d6e5f836338..d412db98bf6 100644 --- a/command/vendored_plugins.go +++ b/command/vendored_plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/version.go b/command/version.go index 3a6db86d712..976221efed5 100644 --- a/command/version.go +++ b/command/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/command/version_test.go b/command/version_test.go index cd2b67e5c6d..60f97f4f38e 100644 --- a/command/version_test.go +++ b/command/version_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package command diff --git a/commands.go b/commands.go index 01e3bf56e73..9b2d3ebdf35 100644 --- a/commands.go +++ b/commands.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/config.go b/config.go index af679dd8e0b..6688d6a74a5 100644 --- a/config.go +++ b/config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/config_test.go b/config_test.go index 772fea4fe3b..1a583a8c3a7 100644 --- a/config_test.go +++ b/config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/datasource/hcp-packer-image/data.go b/datasource/hcp-packer-image/data.go index 3e473e145e4..aba7a6d19bf 100644 --- a/datasource/hcp-packer-image/data.go +++ b/datasource/hcp-packer-image/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/datasource/hcp-packer-iteration/data.go b/datasource/hcp-packer-iteration/data.go index 7a7be3e4979..ff0bbd46f34 100644 --- a/datasource/hcp-packer-iteration/data.go +++ b/datasource/hcp-packer-iteration/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/datasource/hcp-packer-iteration/data_acc_test.go b/datasource/hcp-packer-iteration/data_acc_test.go index bf91e870d7e..82e3b78e5f7 100644 --- a/datasource/hcp-packer-iteration/data_acc_test.go +++ b/datasource/hcp-packer-iteration/data_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcp_packer_iteration diff --git a/datasource/http/data.go b/datasource/http/data.go index ec7a1b3e55c..ef77adca2ba 100644 --- a/datasource/http/data.go +++ b/datasource/http/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/datasource/http/data_acc_test.go b/datasource/http/data_acc_test.go index ffad0219048..c5a92718e67 100644 --- a/datasource/http/data_acc_test.go +++ b/datasource/http/data_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package http diff --git a/datasource/null/data.go b/datasource/null/data.go index 308e06217d7..90c8064aefd 100644 --- a/datasource/null/data.go +++ b/datasource/null/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/fix/fixer.go b/fix/fixer.go index 3de4bc1f814..3fd30cacf11 100644 --- a/fix/fixer.go +++ b/fix/fixer.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_enhanced_networking.go b/fix/fixer_amazon_enhanced_networking.go index 708d2f5bc30..f5c0aa15ed0 100644 --- a/fix/fixer_amazon_enhanced_networking.go +++ b/fix/fixer_amazon_enhanced_networking.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_enhanced_networking_test.go b/fix/fixer_amazon_enhanced_networking_test.go index 4abdcc5f4d1..c92293d96dd 100644 --- a/fix/fixer_amazon_enhanced_networking_test.go +++ b/fix/fixer_amazon_enhanced_networking_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_private_ip.go b/fix/fixer_amazon_private_ip.go index ee18770b40a..f2ca9a26948 100644 --- a/fix/fixer_amazon_private_ip.go +++ b/fix/fixer_amazon_private_ip.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_private_ip_test.go b/fix/fixer_amazon_private_ip_test.go index 554e2e7ee3b..7d78e396b7b 100644 --- a/fix/fixer_amazon_private_ip_test.go +++ b/fix/fixer_amazon_private_ip_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_shutdown_behavior.go b/fix/fixer_amazon_shutdown_behavior.go index c7e2db0d315..b779fc10766 100644 --- a/fix/fixer_amazon_shutdown_behavior.go +++ b/fix/fixer_amazon_shutdown_behavior.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_shutdown_behavior_test.go b/fix/fixer_amazon_shutdown_behavior_test.go index 87058ea9054..5af1f59c5cd 100644 --- a/fix/fixer_amazon_shutdown_behavior_test.go +++ b/fix/fixer_amazon_shutdown_behavior_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_spot_price_product.go b/fix/fixer_amazon_spot_price_product.go index b701e1d9f59..7c49afeb9ce 100644 --- a/fix/fixer_amazon_spot_price_product.go +++ b/fix/fixer_amazon_spot_price_product.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_temporary_security_group_cidrs.go b/fix/fixer_amazon_temporary_security_group_cidrs.go index ffd75eb364d..bd9a9b019b8 100644 --- a/fix/fixer_amazon_temporary_security_group_cidrs.go +++ b/fix/fixer_amazon_temporary_security_group_cidrs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_amazon_temporary_security_group_cidrs_test.go b/fix/fixer_amazon_temporary_security_group_cidrs_test.go index 2ed9f4bb261..28dac694904 100644 --- a/fix/fixer_amazon_temporary_security_group_cidrs_test.go +++ b/fix/fixer_amazon_temporary_security_group_cidrs_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_azure_exclude_from_latest.go b/fix/fixer_azure_exclude_from_latest.go index 210b59f46ac..b85f1da6d67 100644 --- a/fix/fixer_azure_exclude_from_latest.go +++ b/fix/fixer_azure_exclude_from_latest.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_azure_exclude_from_latest_test.go b/fix/fixer_azure_exclude_from_latest_test.go index a3cd70d538d..e7e16e9bde8 100644 --- a/fix/fixer_azure_exclude_from_latest_test.go +++ b/fix/fixer_azure_exclude_from_latest_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_clean_image_name.go b/fix/fixer_clean_image_name.go index 423d2e34035..981e2e36f41 100644 --- a/fix/fixer_clean_image_name.go +++ b/fix/fixer_clean_image_name.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_clean_image_name_test.go b/fix/fixer_clean_image_name_test.go index 385e6f113df..7a95ac2a0f1 100644 --- a/fix/fixer_clean_image_name_test.go +++ b/fix/fixer_clean_image_name_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_comm_config.go b/fix/fixer_comm_config.go index 6f2c49af8e7..3d02fcdac33 100644 --- a/fix/fixer_comm_config.go +++ b/fix/fixer_comm_config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_comm_config_test.go b/fix/fixer_comm_config_test.go index 52beb052de1..c0e22bb7e06 100644 --- a/fix/fixer_comm_config_test.go +++ b/fix/fixer_comm_config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_createtime.go b/fix/fixer_createtime.go index 0412c4d9afb..345ec750242 100644 --- a/fix/fixer_createtime.go +++ b/fix/fixer_createtime.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_createtime_test.go b/fix/fixer_createtime_test.go index a7350966812..9c78b525ac0 100644 --- a/fix/fixer_createtime_test.go +++ b/fix/fixer_createtime_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_docker_email.go b/fix/fixer_docker_email.go index 3a5883f2b9b..6a644210cef 100644 --- a/fix/fixer_docker_email.go +++ b/fix/fixer_docker_email.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_galaxy_command.go b/fix/fixer_galaxy_command.go index f5988d9bc27..df36558275b 100644 --- a/fix/fixer_galaxy_command.go +++ b/fix/fixer_galaxy_command.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_galaxy_command_test.go b/fix/fixer_galaxy_command_test.go index ee067b174fa..125039240c8 100644 --- a/fix/fixer_galaxy_command_test.go +++ b/fix/fixer_galaxy_command_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_hyperv_cpu_and_ram_naming.go b/fix/fixer_hyperv_cpu_and_ram_naming.go index 4983b5cb4fc..3c655bb2ecd 100644 --- a/fix/fixer_hyperv_cpu_and_ram_naming.go +++ b/fix/fixer_hyperv_cpu_and_ram_naming.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_hyperv_deprecations.go b/fix/fixer_hyperv_deprecations.go index 12714d9d71b..191a8f0d8df 100644 --- a/fix/fixer_hyperv_deprecations.go +++ b/fix/fixer_hyperv_deprecations.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_hyperv_deprecations_test.go b/fix/fixer_hyperv_deprecations_test.go index 00154e2b9a4..1f9672d42ed 100644 --- a/fix/fixer_hyperv_deprecations_test.go +++ b/fix/fixer_hyperv_deprecations_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_hyperv_vmxc_typo.go b/fix/fixer_hyperv_vmxc_typo.go index f9c5d63d969..c2c57fe8071 100644 --- a/fix/fixer_hyperv_vmxc_typo.go +++ b/fix/fixer_hyperv_vmxc_typo.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_hyperv_vmxc_typo_test.go b/fix/fixer_hyperv_vmxc_typo_test.go index 1f7ac625a0b..c88a1d40d8b 100644 --- a/fix/fixer_hyperv_vmxc_typo_test.go +++ b/fix/fixer_hyperv_vmxc_typo_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_iso_checksum_type_and_url.go b/fix/fixer_iso_checksum_type_and_url.go index fc50055ac7e..df61844fa61 100644 --- a/fix/fixer_iso_checksum_type_and_url.go +++ b/fix/fixer_iso_checksum_type_and_url.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_iso_checksum_type_and_url_test.go b/fix/fixer_iso_checksum_type_and_url_test.go index f3492dc50cb..556ab966391 100644 --- a/fix/fixer_iso_checksum_type_and_url_test.go +++ b/fix/fixer_iso_checksum_type_and_url_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_iso_md5.go b/fix/fixer_iso_md5.go index 074a0b2bab3..3d6acb86aa5 100644 --- a/fix/fixer_iso_md5.go +++ b/fix/fixer_iso_md5.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_iso_md5_test.go b/fix/fixer_iso_md5_test.go index fc396507977..106fff6096c 100644 --- a/fix/fixer_iso_md5_test.go +++ b/fix/fixer_iso_md5_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_parallels_deprecations.go b/fix/fixer_parallels_deprecations.go index 36ad9a708eb..b287f58f003 100644 --- a/fix/fixer_parallels_deprecations.go +++ b/fix/fixer_parallels_deprecations.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_parallels_deprecations_test.go b/fix/fixer_parallels_deprecations_test.go index a5fd425385d..584129693d5 100644 --- a/fix/fixer_parallels_deprecations_test.go +++ b/fix/fixer_parallels_deprecations_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_parallels_headless.go b/fix/fixer_parallels_headless.go index 164deff3ea0..cd645df1181 100644 --- a/fix/fixer_parallels_headless.go +++ b/fix/fixer_parallels_headless.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_parallels_headless_test.go b/fix/fixer_parallels_headless_test.go index bc3efbcc0e7..62f5654bb27 100644 --- a/fix/fixer_parallels_headless_test.go +++ b/fix/fixer_parallels_headless_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_powershell_escapes.go b/fix/fixer_powershell_escapes.go index d33d046d628..a96bc35fd99 100644 --- a/fix/fixer_powershell_escapes.go +++ b/fix/fixer_powershell_escapes.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_pp_docker_tag_tags.go b/fix/fixer_pp_docker_tag_tags.go index 49e33ebee91..e21a9c26dfb 100644 --- a/fix/fixer_pp_docker_tag_tags.go +++ b/fix/fixer_pp_docker_tag_tags.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_pp_docker_tag_tags_test.go b/fix/fixer_pp_docker_tag_tags_test.go index 908c0768efb..97b600bbc3a 100644 --- a/fix/fixer_pp_docker_tag_tags_test.go +++ b/fix/fixer_pp_docker_tag_tags_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_pp_manifest_filename.go b/fix/fixer_pp_manifest_filename.go index 9f66bc7ad2e..a9447d74050 100644 --- a/fix/fixer_pp_manifest_filename.go +++ b/fix/fixer_pp_manifest_filename.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_pp_manifest_filename_test.go b/fix/fixer_pp_manifest_filename_test.go index ab86324e906..95eaeae68a3 100644 --- a/fix/fixer_pp_manifest_filename_test.go +++ b/fix/fixer_pp_manifest_filename_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_pp_vagrant_override.go b/fix/fixer_pp_vagrant_override.go index eee262212c8..c70ab1f5929 100644 --- a/fix/fixer_pp_vagrant_override.go +++ b/fix/fixer_pp_vagrant_override.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_pp_vagrant_override_test.go b/fix/fixer_pp_vagrant_override_test.go index 1ba56eb6821..29f7edba658 100644 --- a/fix/fixer_pp_vagrant_override_test.go +++ b/fix/fixer_pp_vagrant_override_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_proxmox_type.go b/fix/fixer_proxmox_type.go index 602e82a9435..5c08a35631b 100644 --- a/fix/fixer_proxmox_type.go +++ b/fix/fixer_proxmox_type.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_proxmox_type_test.go b/fix/fixer_proxmox_type_test.go index e0ea378d572..53b9d855c8e 100644 --- a/fix/fixer_proxmox_type_test.go +++ b/fix/fixer_proxmox_type_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_qemu_disk_size.go b/fix/fixer_qemu_disk_size.go index 7cd53800393..5fd4184e571 100644 --- a/fix/fixer_qemu_disk_size.go +++ b/fix/fixer_qemu_disk_size.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_qemu_disk_size_test.go b/fix/fixer_qemu_disk_size_test.go index 3d141a5195c..a05e6f75239 100644 --- a/fix/fixer_qemu_disk_size_test.go +++ b/fix/fixer_qemu_disk_size_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_qemu_host_port.go b/fix/fixer_qemu_host_port.go index 4cd96b53ac1..1b92b04b316 100644 --- a/fix/fixer_qemu_host_port.go +++ b/fix/fixer_qemu_host_port.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_qemu_host_port_test.go b/fix/fixer_qemu_host_port_test.go index 64aaeddcbb7..7a9bf529c00 100644 --- a/fix/fixer_qemu_host_port_test.go +++ b/fix/fixer_qemu_host_port_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_scaleway_access_key.go b/fix/fixer_scaleway_access_key.go index c7e45484fab..cf9e173928a 100644 --- a/fix/fixer_scaleway_access_key.go +++ b/fix/fixer_scaleway_access_key.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_scaleway_access_key_test.go b/fix/fixer_scaleway_access_key_test.go index 365bb467533..a91f1886cad 100644 --- a/fix/fixer_scaleway_access_key_test.go +++ b/fix/fixer_scaleway_access_key_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_ssh_timeout.go b/fix/fixer_ssh_timeout.go index fc675199912..d73b47d66e8 100644 --- a/fix/fixer_ssh_timeout.go +++ b/fix/fixer_ssh_timeout.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_ssh_timeout_test.go b/fix/fixer_ssh_timeout_test.go index 558a94d9e23..0c89b7cf7b3 100644 --- a/fix/fixer_ssh_timeout_test.go +++ b/fix/fixer_ssh_timeout_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_sshdisableagent.go b/fix/fixer_sshdisableagent.go index 1ed262f225c..aa36504f010 100644 --- a/fix/fixer_sshdisableagent.go +++ b/fix/fixer_sshdisableagent.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_sshdisableagent_test.go b/fix/fixer_sshdisableagent_test.go index 9fc67bd763e..1c5ecc38c87 100644 --- a/fix/fixer_sshdisableagent_test.go +++ b/fix/fixer_sshdisableagent_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_sshkeypath.go b/fix/fixer_sshkeypath.go index 48bc8eee198..6c2f8ee0367 100644 --- a/fix/fixer_sshkeypath.go +++ b/fix/fixer_sshkeypath.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_sshkeypath_test.go b/fix/fixer_sshkeypath_test.go index c95917902a1..561db0ef788 100644 --- a/fix/fixer_sshkeypath_test.go +++ b/fix/fixer_sshkeypath_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_test.go b/fix/fixer_test.go index 091084ac794..2b09611521b 100644 --- a/fix/fixer_test.go +++ b/fix/fixer_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_virtualbox_gaattach.go b/fix/fixer_virtualbox_gaattach.go index 23e8c7fdff2..5fc0834c72b 100644 --- a/fix/fixer_virtualbox_gaattach.go +++ b/fix/fixer_virtualbox_gaattach.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_virtualbox_gaattach_test.go b/fix/fixer_virtualbox_gaattach_test.go index 83fa00b59e7..62aa5b159a8 100644 --- a/fix/fixer_virtualbox_gaattach_test.go +++ b/fix/fixer_virtualbox_gaattach_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_virtualbox_rename.go b/fix/fixer_virtualbox_rename.go index a3723f2ed27..86d53fd1ff4 100644 --- a/fix/fixer_virtualbox_rename.go +++ b/fix/fixer_virtualbox_rename.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_virtualbox_rename_test.go b/fix/fixer_virtualbox_rename_test.go index fc570f3095b..932975bd0a6 100644 --- a/fix/fixer_virtualbox_rename_test.go +++ b/fix/fixer_virtualbox_rename_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_vmware_compaction.go b/fix/fixer_vmware_compaction.go index 906ff4d197d..cc833186dd1 100644 --- a/fix/fixer_vmware_compaction.go +++ b/fix/fixer_vmware_compaction.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_vmware_compaction_test.go b/fix/fixer_vmware_compaction_test.go index bd107705544..eb5494a3159 100644 --- a/fix/fixer_vmware_compaction_test.go +++ b/fix/fixer_vmware_compaction_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_vmware_rename.go b/fix/fixer_vmware_rename.go index 5e7db8a6ed8..c81e01b8577 100644 --- a/fix/fixer_vmware_rename.go +++ b/fix/fixer_vmware_rename.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_vmware_rename_test.go b/fix/fixer_vmware_rename_test.go index 6d8710cfb74..4c2cb095dc3 100644 --- a/fix/fixer_vmware_rename_test.go +++ b/fix/fixer_vmware_rename_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_vsphere_network_storage.go b/fix/fixer_vsphere_network_storage.go index 87723a9e9fc..f82bc20463e 100644 --- a/fix/fixer_vsphere_network_storage.go +++ b/fix/fixer_vsphere_network_storage.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/fixer_vsphere_network_storage_test.go b/fix/fixer_vsphere_network_storage_test.go index 54ebb8015e1..59e4bbf1c62 100644 --- a/fix/fixer_vsphere_network_storage_test.go +++ b/fix/fixer_vsphere_network_storage_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/fix/helpers.go b/fix/helpers.go index f3812674e3c..d4d01b22123 100644 --- a/fix/helpers.go +++ b/fix/helpers.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package fix diff --git a/hcl2template/addrs/doc.go b/hcl2template/addrs/doc.go index 9768f453d12..783284822ba 100644 --- a/hcl2template/addrs/doc.go +++ b/hcl2template/addrs/doc.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package addrs contains types that represent "addresses", which are // references to specific objects within a Packer configuration. diff --git a/hcl2template/addrs/input_variable.go b/hcl2template/addrs/input_variable.go index e2821e7e5b1..9ffbf6fb0a4 100644 --- a/hcl2template/addrs/input_variable.go +++ b/hcl2template/addrs/input_variable.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package addrs diff --git a/hcl2template/addrs/parse_ref.go b/hcl2template/addrs/parse_ref.go index 866ced8f459..3f6c7320179 100644 --- a/hcl2template/addrs/parse_ref.go +++ b/hcl2template/addrs/parse_ref.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package addrs diff --git a/hcl2template/addrs/plugin.go b/hcl2template/addrs/plugin.go index 8b4891044fc..9db29b31717 100644 --- a/hcl2template/addrs/plugin.go +++ b/hcl2template/addrs/plugin.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package addrs diff --git a/hcl2template/addrs/plugin_test.go b/hcl2template/addrs/plugin_test.go index 491d2221a1c..e99a72416b8 100644 --- a/hcl2template/addrs/plugin_test.go +++ b/hcl2template/addrs/plugin_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package addrs diff --git a/hcl2template/addrs/referenceable.go b/hcl2template/addrs/referenceable.go index 9b54c5bac49..2b11d6008bc 100644 --- a/hcl2template/addrs/referenceable.go +++ b/hcl2template/addrs/referenceable.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package addrs diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index cb37a7bf996..831ce5d3596 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/components.go b/hcl2template/components.go index 956a753f38b..e83f8b3768d 100644 --- a/hcl2template/components.go +++ b/hcl2template/components.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/decode.go b/hcl2template/decode.go index 137e54eec05..1dcd34c55ce 100644 --- a/hcl2template/decode.go +++ b/hcl2template/decode.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/docs.go b/hcl2template/docs.go index 2b19f42b029..cf970f2e8e1 100644 --- a/hcl2template/docs.go +++ b/hcl2template/docs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package hcl2template defines code to parse hcl2 template files. // diff --git a/hcl2template/formatter.go b/hcl2template/formatter.go index 7e1cab56aa3..5505cde4052 100644 --- a/hcl2template/formatter.go +++ b/hcl2template/formatter.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/formatter_test.go b/hcl2template/formatter_test.go index 42051c0a8d3..07febb6f439 100644 --- a/hcl2template/formatter_test.go +++ b/hcl2template/formatter_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/function/Consul.go b/hcl2template/function/Consul.go index 4f51ca41d15..e1e51b2299b 100644 --- a/hcl2template/function/Consul.go +++ b/hcl2template/function/Consul.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/aws_secretetkey.go b/hcl2template/function/aws_secretetkey.go index 50b4fe9ee53..4684c9bf2d2 100644 --- a/hcl2template/function/aws_secretetkey.go +++ b/hcl2template/function/aws_secretetkey.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/datetime.go b/hcl2template/function/datetime.go index 1d807e407d3..066db18db39 100644 --- a/hcl2template/function/datetime.go +++ b/hcl2template/function/datetime.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/datetime_test.go b/hcl2template/function/datetime_test.go index 686564803cc..416b6fa23f3 100644 --- a/hcl2template/function/datetime_test.go +++ b/hcl2template/function/datetime_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/env.go b/hcl2template/function/env.go index aeb632aba75..34c09a8b921 100644 --- a/hcl2template/function/env.go +++ b/hcl2template/function/env.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/index.go b/hcl2template/function/index.go index 3c5f73ccda9..cb4f0c51921 100644 --- a/hcl2template/function/index.go +++ b/hcl2template/function/index.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/index_test.go b/hcl2template/function/index_test.go index d70511ad516..0a46da34ce8 100644 --- a/hcl2template/function/index_test.go +++ b/hcl2template/function/index_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/length.go b/hcl2template/function/length.go index 90ab7997ec9..23b5969af10 100644 --- a/hcl2template/function/length.go +++ b/hcl2template/function/length.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/length_test.go b/hcl2template/function/length_test.go index 2c6f10c49d6..0a68c126c51 100644 --- a/hcl2template/function/length_test.go +++ b/hcl2template/function/length_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/templatefile.go b/hcl2template/function/templatefile.go index eee0092197c..0b927cf834a 100644 --- a/hcl2template/function/templatefile.go +++ b/hcl2template/function/templatefile.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/templatefile_test.go b/hcl2template/function/templatefile_test.go index a4536b59ca5..f12967dd3c5 100644 --- a/hcl2template/function/templatefile_test.go +++ b/hcl2template/function/templatefile_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/function/vault.go b/hcl2template/function/vault.go index 4aa49da6753..3b9c092442e 100644 --- a/hcl2template/function/vault.go +++ b/hcl2template/function/vault.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package function diff --git a/hcl2template/functions.go b/hcl2template/functions.go index cc144940cf6..c74754bdf90 100644 --- a/hcl2template/functions.go +++ b/hcl2template/functions.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/internal/mock.go b/hcl2template/internal/mock.go index 86d5b0e0e06..4d3adb14ae5 100644 --- a/hcl2template/internal/mock.go +++ b/hcl2template/internal/mock.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag diff --git a/hcl2template/parser.go b/hcl2template/parser.go index a724bb807bd..43b43bcd6f0 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/plugin.go b/hcl2template/plugin.go index 4a5c0186647..92b9cf2f30b 100644 --- a/hcl2template/plugin.go +++ b/hcl2template/plugin.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/repl/format.go b/hcl2template/repl/format.go index 8e596e4be9d..8d99a4392d0 100644 --- a/hcl2template/repl/format.go +++ b/hcl2template/repl/format.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package repl diff --git a/hcl2template/repl/repl.go b/hcl2template/repl/repl.go index 7a698f87f5b..eb13353eed0 100644 --- a/hcl2template/repl/repl.go +++ b/hcl2template/repl/repl.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package repl provides the structs and functions necessary to run REPL for // HCL2. The REPL allows experimentation of HCL2 interpolations without having diff --git a/hcl2template/shim/mock.go b/hcl2template/shim/mock.go index adeda84dd39..40fdbca4d32 100644 --- a/hcl2template/shim/mock.go +++ b/hcl2template/shim/mock.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag diff --git a/hcl2template/shim/values.go b/hcl2template/shim/values.go index 88580f1f2c1..096c8c23d56 100644 --- a/hcl2template/shim/values.go +++ b/hcl2template/shim/values.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2shim diff --git a/hcl2template/shim/values_test.go b/hcl2template/shim/values_test.go index 46e154002cd..4449e711bc9 100644 --- a/hcl2template/shim/values_test.go +++ b/hcl2template/shim/values_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2shim diff --git a/hcl2template/types.build.from.go b/hcl2template/types.build.from.go index 9661fa167b0..fb1544ef53a 100644 --- a/hcl2template/types.build.from.go +++ b/hcl2template/types.build.from.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build.go b/hcl2template/types.build.go index 2ab6aa718fe..648305ee202 100644 --- a/hcl2template/types.build.go +++ b/hcl2template/types.build.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build.hcp_packer_registry.go b/hcl2template/types.build.hcp_packer_registry.go index 6d1b99f2ec9..b64b3ff4e55 100644 --- a/hcl2template/types.build.hcp_packer_registry.go +++ b/hcl2template/types.build.hcp_packer_registry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build.hcp_packer_registry_test.go b/hcl2template/types.build.hcp_packer_registry_test.go index 18c8ca3fa34..3ada389c29d 100644 --- a/hcl2template/types.build.hcp_packer_registry_test.go +++ b/hcl2template/types.build.hcp_packer_registry_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index 1216f32ebfd..8844eadff11 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index 8459f1be921..b08eca59f63 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build.provisioners_test.go b/hcl2template/types.build.provisioners_test.go index e19570dff29..284651f2cbd 100644 --- a/hcl2template/types.build.provisioners_test.go +++ b/hcl2template/types.build.provisioners_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.build_test.go b/hcl2template/types.build_test.go index 376646c6376..8647821dd18 100644 --- a/hcl2template/types.build_test.go +++ b/hcl2template/types.build_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.datasource.go b/hcl2template/types.datasource.go index 9ae5e995ecc..8ac2c160827 100644 --- a/hcl2template/types.datasource.go +++ b/hcl2template/types.datasource.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.datasource_test.go b/hcl2template/types.datasource_test.go index b22f438d64b..d12fcafd076 100644 --- a/hcl2template/types.datasource_test.go +++ b/hcl2template/types.datasource_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go index 26974aacedf..b9d200758de 100644 --- a/hcl2template/types.hcl_post-processor.go +++ b/hcl2template/types.hcl_post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go index 022a2fd58d1..b607a0092a2 100644 --- a/hcl2template/types.hcl_provisioner.go +++ b/hcl2template/types.hcl_provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.hcl_ref.go b/hcl2template/types.hcl_ref.go index 091a2043610..f3e6176dbf1 100644 --- a/hcl2template/types.hcl_ref.go +++ b/hcl2template/types.hcl_ref.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 003db57753c..819107e86b3 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.packer_config_test.go b/hcl2template/types.packer_config_test.go index d8881c18415..5eae6a2f21f 100644 --- a/hcl2template/types.packer_config_test.go +++ b/hcl2template/types.packer_config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.required_plugins.go b/hcl2template/types.required_plugins.go index 01c090428f8..94dfd4669b3 100644 --- a/hcl2template/types.required_plugins.go +++ b/hcl2template/types.required_plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.required_plugins_test.go b/hcl2template/types.required_plugins_test.go index 3a1fabd4bf7..5e2b4a90c96 100644 --- a/hcl2template/types.required_plugins_test.go +++ b/hcl2template/types.required_plugins_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.source.go b/hcl2template/types.source.go index 1ea939d015f..46b9caac98e 100644 --- a/hcl2template/types.source.go +++ b/hcl2template/types.source.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.source_test.go b/hcl2template/types.source_test.go index efdddea5abe..47caeec5a75 100644 --- a/hcl2template/types.source_test.go +++ b/hcl2template/types.source_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.variables.go b/hcl2template/types.variables.go index 9111ced9a44..33df28a84ee 100644 --- a/hcl2template/types.variables.go +++ b/hcl2template/types.variables.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/types.variables_test.go b/hcl2template/types.variables_test.go index d0691a0910c..a19b80bd990 100644 --- a/hcl2template/types.variables_test.go +++ b/hcl2template/types.variables_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/utils.go b/hcl2template/utils.go index b74093b23fe..dc2399a1034 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/version.go b/hcl2template/version.go index 920cff51031..f6f584a69a5 100644 --- a/hcl2template/version.go +++ b/hcl2template/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/hcl2template/version_required.go b/hcl2template/version_required.go index c418eda550a..f8c67228bfb 100644 --- a/hcl2template/version_required.go +++ b/hcl2template/version_required.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package hcl2template diff --git a/helper/wrappedreadline/wrappedreadline.go b/helper/wrappedreadline/wrappedreadline.go index 6641cb8960b..9d4bd7fcf25 100644 --- a/helper/wrappedreadline/wrappedreadline.go +++ b/helper/wrappedreadline/wrappedreadline.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. diff --git a/helper/wrappedreadline/wrappedreadline_solaris.go b/helper/wrappedreadline/wrappedreadline_solaris.go index fb2a9388e00..55eac364548 100644 --- a/helper/wrappedreadline/wrappedreadline_solaris.go +++ b/helper/wrappedreadline/wrappedreadline_solaris.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package wrappedreadline diff --git a/helper/wrappedreadline/wrappedreadline_unix.go b/helper/wrappedreadline/wrappedreadline_unix.go index ff621e7da9e..7d01bb3a99e 100644 --- a/helper/wrappedreadline/wrappedreadline_unix.go +++ b/helper/wrappedreadline/wrappedreadline_unix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build darwin || dragonfly || freebsd || (linux && !appengine) || netbsd || openbsd // +build darwin dragonfly freebsd linux,!appengine netbsd openbsd diff --git a/helper/wrappedreadline/wrappedreadline_windows.go b/helper/wrappedreadline/wrappedreadline_windows.go index d3d361579f1..88d04a06ab8 100644 --- a/helper/wrappedreadline/wrappedreadline_windows.go +++ b/helper/wrappedreadline/wrappedreadline_windows.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build windows // +build windows diff --git a/helper/wrappedstreams/streams.go b/helper/wrappedstreams/streams.go index 80d1e66b259..1b18abf1958 100644 --- a/helper/wrappedstreams/streams.go +++ b/helper/wrappedstreams/streams.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. diff --git a/helper/wrappedstreams/streams_other.go b/helper/wrappedstreams/streams_other.go index 34ecf76d06a..98045b535da 100644 --- a/helper/wrappedstreams/streams_other.go +++ b/helper/wrappedstreams/streams_other.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build !windows // +build !windows diff --git a/helper/wrappedstreams/streams_windows.go b/helper/wrappedstreams/streams_windows.go index 18489fdc268..5a0d01de4fc 100644 --- a/helper/wrappedstreams/streams_windows.go +++ b/helper/wrappedstreams/streams_windows.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build windows // +build windows diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index f28999d57b6..5c8c851ae40 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package api provides access to the HCP Packer Registry API. package api diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go index 16d321beb77..bb952375bf9 100644 --- a/internal/hcp/api/client_test.go +++ b/internal/hcp/api/client_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package api diff --git a/internal/hcp/api/errors.go b/internal/hcp/api/errors.go index 32a5708cc14..cff55fc9e09 100644 --- a/internal/hcp/api/errors.go +++ b/internal/hcp/api/errors.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package api diff --git a/internal/hcp/api/mock_service.go b/internal/hcp/api/mock_service.go index 9a126346e06..f9b427cbf29 100644 --- a/internal/hcp/api/mock_service.go +++ b/internal/hcp/api/mock_service.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package api diff --git a/internal/hcp/api/service.go b/internal/hcp/api/service.go index a0ee9f8ce4c..df56bdbd58c 100644 --- a/internal/hcp/api/service.go +++ b/internal/hcp/api/service.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package api diff --git a/internal/hcp/env/env.go b/internal/hcp/env/env.go index 0186be1671f..972fd68f77e 100644 --- a/internal/hcp/env/env.go +++ b/internal/hcp/env/env.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package env provides HCP Packer environment variables. package env diff --git a/internal/hcp/env/env_test.go b/internal/hcp/env/env_test.go index 1de73f5913d..a773b41c928 100644 --- a/internal/hcp/env/env_test.go +++ b/internal/hcp/env/env_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package env diff --git a/internal/hcp/env/variables.go b/internal/hcp/env/variables.go index 8c74b600d47..a8c1a493e13 100644 --- a/internal/hcp/env/variables.go +++ b/internal/hcp/env/variables.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package env diff --git a/internal/hcp/registry/artifact.go b/internal/hcp/registry/artifact.go index a0b0049cc9f..7257d302f3d 100644 --- a/internal/hcp/registry/artifact.go +++ b/internal/hcp/registry/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/errors.go b/internal/hcp/registry/errors.go index a93f960f996..8bc458d241b 100644 --- a/internal/hcp/registry/errors.go +++ b/internal/hcp/registry/errors.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/hcl.go b/internal/hcp/registry/hcl.go index 64c57a51761..531fd648c7e 100644 --- a/internal/hcp/registry/hcl.go +++ b/internal/hcp/registry/hcl.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/hcp.go b/internal/hcp/registry/hcp.go index 838350b7641..c0d12726e2d 100644 --- a/internal/hcp/registry/hcp.go +++ b/internal/hcp/registry/hcp.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/json.go b/internal/hcp/registry/json.go index bb0bba14674..92aa6db904c 100644 --- a/internal/hcp/registry/json.go +++ b/internal/hcp/registry/json.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/null_registry.go b/internal/hcp/registry/null_registry.go index 5aee3e6bcd1..f7dbcdf0970 100644 --- a/internal/hcp/registry/null_registry.go +++ b/internal/hcp/registry/null_registry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/registry.go b/internal/hcp/registry/registry.go index b095e14ea2f..35485a8993e 100644 --- a/internal/hcp/registry/registry.go +++ b/internal/hcp/registry/registry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package registry provides access to the HCP registry. package registry diff --git a/internal/hcp/registry/types.bucket.go b/internal/hcp/registry/types.bucket.go index 7e548643a65..d4239f45005 100644 --- a/internal/hcp/registry/types.bucket.go +++ b/internal/hcp/registry/types.bucket.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/types.bucket_service_test.go b/internal/hcp/registry/types.bucket_service_test.go index 5fa28ac4e93..6503b95fb02 100644 --- a/internal/hcp/registry/types.bucket_service_test.go +++ b/internal/hcp/registry/types.bucket_service_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/types.bucket_test.go b/internal/hcp/registry/types.bucket_test.go index 30f73dec51c..9c1467ad714 100644 --- a/internal/hcp/registry/types.bucket_test.go +++ b/internal/hcp/registry/types.bucket_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/types.builds.go b/internal/hcp/registry/types.builds.go index 9245a9d3141..991ef563a00 100644 --- a/internal/hcp/registry/types.builds.go +++ b/internal/hcp/registry/types.builds.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/types.iterations.go b/internal/hcp/registry/types.iterations.go index b9ffc232243..c186a2a256d 100644 --- a/internal/hcp/registry/types.iterations.go +++ b/internal/hcp/registry/types.iterations.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/internal/hcp/registry/types.iterations_test.go b/internal/hcp/registry/types.iterations_test.go index fe7132d6b36..27e87b5798f 100644 --- a/internal/hcp/registry/types.iterations_test.go +++ b/internal/hcp/registry/types.iterations_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package registry diff --git a/log.go b/log.go index 2c15a700a16..72744bc3dd5 100644 --- a/log.go +++ b/log.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/main.go b/main.go index 728f56860af..0d39d70d579 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // This is the main package for the `packer` application. diff --git a/main_test.go b/main_test.go index 69be0aca87e..b71319e9dea 100644 --- a/main_test.go +++ b/main_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/packer/build.go b/packer/build.go index 3309bb194d5..e51e71d00c9 100644 --- a/packer/build.go +++ b/packer/build.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/build_test.go b/packer/build_test.go index 86531d8ca4b..c15eec5b570 100644 --- a/packer/build_test.go +++ b/packer/build_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/builder_test.go b/packer/builder_test.go index 1276552788b..85b7eaf5f08 100644 --- a/packer/builder_test.go +++ b/packer/builder_test.go @@ -1,4 +1,4 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/client_test.go b/packer/client_test.go index f9a1483ff87..f0dc074e997 100644 --- a/packer/client_test.go +++ b/packer/client_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_builder.go b/packer/cmd_builder.go index 99a0bc6f913..8b472d1fb24 100644 --- a/packer/cmd_builder.go +++ b/packer/cmd_builder.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_builder_test.go b/packer/cmd_builder_test.go index dfc5d15fb99..a47bcea31b8 100644 --- a/packer/cmd_builder_test.go +++ b/packer/cmd_builder_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_datasource.go b/packer/cmd_datasource.go index 4e8b32561ed..0e2d6b79892 100644 --- a/packer/cmd_datasource.go +++ b/packer/cmd_datasource.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_datasource_test.go b/packer/cmd_datasource_test.go index c174c8ee02b..1616b218cf7 100644 --- a/packer/cmd_datasource_test.go +++ b/packer/cmd_datasource_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_hook.go b/packer/cmd_hook.go index ace3d2c032d..f3973a98a0d 100644 --- a/packer/cmd_hook.go +++ b/packer/cmd_hook.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_hook_test.go b/packer/cmd_hook_test.go index f2a1f4d9246..ed149c5af7c 100644 --- a/packer/cmd_hook_test.go +++ b/packer/cmd_hook_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_post_processor.go b/packer/cmd_post_processor.go index c686a3937ef..139c9133390 100644 --- a/packer/cmd_post_processor.go +++ b/packer/cmd_post_processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_post_processor_test.go b/packer/cmd_post_processor_test.go index ce70a8bf125..3c69d899f6b 100644 --- a/packer/cmd_post_processor_test.go +++ b/packer/cmd_post_processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_provisioner.go b/packer/cmd_provisioner.go index 965ad89587f..335b7bd97ec 100644 --- a/packer/cmd_provisioner.go +++ b/packer/cmd_provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/cmd_provisioner_test.go b/packer/cmd_provisioner_test.go index 5bb86942ace..6c2005b9354 100644 --- a/packer/cmd_provisioner_test.go +++ b/packer/cmd_provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/core.go b/packer/core.go index b711af080bc..732f026360f 100644 --- a/packer/core.go +++ b/packer/core.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/core_test.go b/packer/core_test.go index e46f62e6b0e..b1694cbf86c 100644 --- a/packer/core_test.go +++ b/packer/core_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/maps.go b/packer/maps.go index 6fec5c67950..1d99802dfef 100644 --- a/packer/maps.go +++ b/packer/maps.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/packer_test.go b/packer/packer_test.go index bc75903397b..2f52c5e76d2 100644 --- a/packer/packer_test.go +++ b/packer/packer_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/plugin-getter/checksum.go b/packer/plugin-getter/checksum.go index 507a17e6537..d7193ba3b7f 100644 --- a/packer/plugin-getter/checksum.go +++ b/packer/plugin-getter/checksum.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package plugingetter diff --git a/packer/plugin-getter/docs.go b/packer/plugin-getter/docs.go index 6c8cfba37cf..216a7781d2f 100644 --- a/packer/plugin-getter/docs.go +++ b/packer/plugin-getter/docs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package plugingetter defines means to download and install plugins. package plugingetter diff --git a/packer/plugin-getter/github/docs.go b/packer/plugin-getter/github/docs.go index 9c189dfd3a3..50fa13e30ae 100644 --- a/packer/plugin-getter/github/docs.go +++ b/packer/plugin-getter/github/docs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Package github defines a Github getter. diff --git a/packer/plugin-getter/github/getter.go b/packer/plugin-getter/github/getter.go index c094a33e332..bde61e51641 100644 --- a/packer/plugin-getter/github/getter.go +++ b/packer/plugin-getter/github/getter.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package github diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index 09acf7052c8..b16edcfade0 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package plugingetter diff --git a/packer/plugin-getter/plugins_test.go b/packer/plugin-getter/plugins_test.go index 3105fb1e667..7a1439de210 100644 --- a/packer/plugin-getter/plugins_test.go +++ b/packer/plugin-getter/plugins_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package plugingetter diff --git a/packer/plugin.go b/packer/plugin.go index dd3e6d31719..c88f54f86b3 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/plugin_client.go b/packer/plugin_client.go index f1d127497be..b788f68f7fb 100644 --- a/packer/plugin_client.go +++ b/packer/plugin_client.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index fec52607d83..901c3d42f1d 100644 --- a/packer/plugin_discover_test.go +++ b/packer/plugin_discover_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/plugin_folders.go b/packer/plugin_folders.go index 52d63aac4cc..e1d4dbea4a2 100644 --- a/packer/plugin_folders.go +++ b/packer/plugin_folders.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/plugin_test.go b/packer/plugin_test.go index 099d9cf6c8a..a912ca07a38 100644 --- a/packer/plugin_test.go +++ b/packer/plugin_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/post_processor_mock.go b/packer/post_processor_mock.go index b6156e28ceb..5a9bfc85ae2 100644 --- a/packer/post_processor_mock.go +++ b/packer/post_processor_mock.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type MockPostProcessor package packer diff --git a/packer/progressbar.go b/packer/progressbar.go index c7e68f7c2ba..0a9225047c3 100644 --- a/packer/progressbar.go +++ b/packer/progressbar.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build !solaris // +build !solaris diff --git a/packer/progressbar_solaris.go b/packer/progressbar_solaris.go index cfc0266f27a..7aa199339a7 100644 --- a/packer/progressbar_solaris.go +++ b/packer/progressbar_solaris.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/progressbar_test.go b/packer/progressbar_test.go index a50049cf908..96ff65d687b 100644 --- a/packer/progressbar_test.go +++ b/packer/progressbar_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/provisioner.go b/packer/provisioner.go index 66d61d9fb98..c7761adeb5f 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/provisioner_test.go b/packer/provisioner_test.go index d5e191038c9..bc646e5ca10 100644 --- a/packer/provisioner_test.go +++ b/packer/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/provisioner_timeout.go b/packer/provisioner_timeout.go index c7407130cb4..f1183744cdb 100644 --- a/packer/provisioner_timeout.go +++ b/packer/provisioner_timeout.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/run_interfaces.go b/packer/run_interfaces.go index 253998c20a4..07829e629e1 100644 --- a/packer/run_interfaces.go +++ b/packer/run_interfaces.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/telemetry.go b/packer/telemetry.go index b1f0347b2ba..9a7f569139e 100644 --- a/packer/telemetry.go +++ b/packer/telemetry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/telemetry_test.go b/packer/telemetry_test.go index 4d1dee3e7f5..ab304a55023 100644 --- a/packer/telemetry_test.go +++ b/packer/telemetry_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/testing.go b/packer/testing.go index 0b2449593c2..faa3c58283e 100644 --- a/packer/testing.go +++ b/packer/testing.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/ui.go b/packer/ui.go index dac5689205c..c01e9591a54 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/packer/ui_test.go b/packer/ui_test.go index 1d15cb4ea0f..44fa93c7f07 100644 --- a/packer/ui_test.go +++ b/packer/ui_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package packer diff --git a/panic.go b/panic.go index 6f609645345..6fdfc59af24 100644 --- a/panic.go +++ b/panic.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/post-processor/artifice/artifact.go b/post-processor/artifice/artifact.go index 4f481b2be29..859b05e6199 100644 --- a/post-processor/artifice/artifact.go +++ b/post-processor/artifice/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package artifice diff --git a/post-processor/artifice/post-processor.go b/post-processor/artifice/post-processor.go index 334d8531b6b..d1a4f422268 100644 --- a/post-processor/artifice/post-processor.go +++ b/post-processor/artifice/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/post-processor/artifice/version/version.go b/post-processor/artifice/version/version.go index b426efb501a..b329b365688 100644 --- a/post-processor/artifice/version/version.go +++ b/post-processor/artifice/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/post-processor/checksum/artifact.go b/post-processor/checksum/artifact.go index eb1eeeeec26..5468460d53a 100644 --- a/post-processor/checksum/artifact.go +++ b/post-processor/checksum/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package checksum diff --git a/post-processor/checksum/post-processor.go b/post-processor/checksum/post-processor.go index 28b107cd8e6..efd51b6a169 100644 --- a/post-processor/checksum/post-processor.go +++ b/post-processor/checksum/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/post-processor/checksum/post-processor_test.go b/post-processor/checksum/post-processor_test.go index 97ab201f7f8..62c2f2ae3e1 100644 --- a/post-processor/checksum/post-processor_test.go +++ b/post-processor/checksum/post-processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package checksum diff --git a/post-processor/checksum/version/version.go b/post-processor/checksum/version/version.go index 74332d82388..9e1eeb239d9 100644 --- a/post-processor/checksum/version/version.go +++ b/post-processor/checksum/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/post-processor/compress/artifact.go b/post-processor/compress/artifact.go index 20c7ef7d0b3..c56b2905daf 100644 --- a/post-processor/compress/artifact.go +++ b/post-processor/compress/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package compress diff --git a/post-processor/compress/artifact_test.go b/post-processor/compress/artifact_test.go index d0c1da8caeb..a30a803edf6 100644 --- a/post-processor/compress/artifact_test.go +++ b/post-processor/compress/artifact_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package compress diff --git a/post-processor/compress/benchmark.go b/post-processor/compress/benchmark.go index f853c85104f..5d06b7d6448 100644 --- a/post-processor/compress/benchmark.go +++ b/post-processor/compress/benchmark.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build ignore // +build ignore diff --git a/post-processor/compress/post-processor.go b/post-processor/compress/post-processor.go index 9d2a32e57d5..88b345a97d8 100644 --- a/post-processor/compress/post-processor.go +++ b/post-processor/compress/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/post-processor/compress/post-processor_test.go b/post-processor/compress/post-processor_test.go index f91a1178f2f..e85b2041062 100644 --- a/post-processor/compress/post-processor_test.go +++ b/post-processor/compress/post-processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package compress diff --git a/post-processor/compress/tar_fix.go b/post-processor/compress/tar_fix.go index ad58cb18fa9..0402f4e7075 100644 --- a/post-processor/compress/tar_fix.go +++ b/post-processor/compress/tar_fix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build !go1.10 // +build !go1.10 diff --git a/post-processor/compress/tar_fix_go110.go b/post-processor/compress/tar_fix_go110.go index 5eac3dea192..2e0eba8d8cf 100644 --- a/post-processor/compress/tar_fix_go110.go +++ b/post-processor/compress/tar_fix_go110.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build go1.10 // +build go1.10 diff --git a/post-processor/compress/version/version.go b/post-processor/compress/version/version.go index 639290a83ef..75bfb46f656 100644 --- a/post-processor/compress/version/version.go +++ b/post-processor/compress/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/post-processor/manifest/artifact.go b/post-processor/manifest/artifact.go index b70c7deceb0..ceef83f8123 100644 --- a/post-processor/manifest/artifact.go +++ b/post-processor/manifest/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package manifest diff --git a/post-processor/manifest/post-processor.go b/post-processor/manifest/post-processor.go index f911f734b5c..5fb90c45577 100644 --- a/post-processor/manifest/post-processor.go +++ b/post-processor/manifest/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config //go:generate packer-sdc struct-markdown diff --git a/post-processor/manifest/version/version.go b/post-processor/manifest/version/version.go index 20a5523154a..86f862f89fd 100644 --- a/post-processor/manifest/version/version.go +++ b/post-processor/manifest/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/post-processor/shell-local/post-processor.go b/post-processor/shell-local/post-processor.go index 334081e5927..801e8ac6567 100644 --- a/post-processor/shell-local/post-processor.go +++ b/post-processor/shell-local/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell_local diff --git a/post-processor/shell-local/post-processor_test.go b/post-processor/shell-local/post-processor_test.go index eb8481772d1..39fbec25ec3 100644 --- a/post-processor/shell-local/post-processor_test.go +++ b/post-processor/shell-local/post-processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell_local diff --git a/post-processor/shell-local/version/version.go b/post-processor/shell-local/version/version.go index 1d02737909d..1f602bc5f46 100644 --- a/post-processor/shell-local/version/version.go +++ b/post-processor/shell-local/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/breakpoint/provisioner.go b/provisioner/breakpoint/provisioner.go index fc833fb47bc..9675ddff0d3 100644 --- a/provisioner/breakpoint/provisioner.go +++ b/provisioner/breakpoint/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/breakpoint/version/version.go b/provisioner/breakpoint/version/version.go index 008af956575..2024c7e5a74 100644 --- a/provisioner/breakpoint/version/version.go +++ b/provisioner/breakpoint/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/file/provisioner.go b/provisioner/file/provisioner.go index 84e9c3744fa..586896611d9 100644 --- a/provisioner/file/provisioner.go +++ b/provisioner/file/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config //go:generate packer-sdc struct-markdown diff --git a/provisioner/file/provisioner_test.go b/provisioner/file/provisioner_test.go index e3ecd7294f7..17d55d75d2b 100644 --- a/provisioner/file/provisioner_test.go +++ b/provisioner/file/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package file diff --git a/provisioner/file/version/version.go b/provisioner/file/version/version.go index e5b7923463f..8451cf03227 100644 --- a/provisioner/file/version/version.go +++ b/provisioner/file/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/powershell/execution_policy.go b/provisioner/powershell/execution_policy.go index 94463db2b24..057f60a2ec7 100644 --- a/provisioner/powershell/execution_policy.go +++ b/provisioner/powershell/execution_policy.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate enumer -transform snake -trimprefix ExecutionPolicy -type ExecutionPolicy diff --git a/provisioner/powershell/execution_policy_test.go b/provisioner/powershell/execution_policy_test.go index 8b82c97f270..5631b78bdd1 100644 --- a/provisioner/powershell/execution_policy_test.go +++ b/provisioner/powershell/execution_policy_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package powershell diff --git a/provisioner/powershell/provisioner.go b/provisioner/powershell/provisioner.go index 65ed16d1bf2..aae71f9fb3e 100644 --- a/provisioner/powershell/provisioner.go +++ b/provisioner/powershell/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/powershell/provisioner_acc_test.go b/provisioner/powershell/provisioner_acc_test.go index 379b14f9b8f..8340b2a5a87 100644 --- a/provisioner/powershell/provisioner_acc_test.go +++ b/provisioner/powershell/provisioner_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package powershell_test diff --git a/provisioner/powershell/provisioner_test.go b/provisioner/powershell/provisioner_test.go index d94a56fa23b..0d8b4ca35cd 100644 --- a/provisioner/powershell/provisioner_test.go +++ b/provisioner/powershell/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package powershell diff --git a/provisioner/powershell/version/version.go b/provisioner/powershell/version/version.go index eb2cc7e0d33..b0350e51cbd 100644 --- a/provisioner/powershell/version/version.go +++ b/provisioner/powershell/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/shell-local/provisioner.go b/provisioner/shell-local/provisioner.go index d051b361239..3c62b28f9d5 100644 --- a/provisioner/shell-local/provisioner.go +++ b/provisioner/shell-local/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell diff --git a/provisioner/shell-local/provisioner_acc_test.go b/provisioner/shell-local/provisioner_acc_test.go index f53990d0d2f..b7b7c051a14 100644 --- a/provisioner/shell-local/provisioner_acc_test.go +++ b/provisioner/shell-local/provisioner_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell_test diff --git a/provisioner/shell-local/provisioner_test.go b/provisioner/shell-local/provisioner_test.go index ac7262b616a..c320ad4a1d1 100644 --- a/provisioner/shell-local/provisioner_test.go +++ b/provisioner/shell-local/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell diff --git a/provisioner/shell-local/version/version.go b/provisioner/shell-local/version/version.go index 205aea7ccf0..27e57fb5c0a 100644 --- a/provisioner/shell-local/version/version.go +++ b/provisioner/shell-local/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index cc1e399996a..593f898caf0 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/shell/provisioner_acc_test.go b/provisioner/shell/provisioner_acc_test.go index 8ffc58b8d14..4eefa19e78a 100644 --- a/provisioner/shell/provisioner_acc_test.go +++ b/provisioner/shell/provisioner_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell_test diff --git a/provisioner/shell/provisioner_test.go b/provisioner/shell/provisioner_test.go index 73a4ac248f5..5640c92425e 100644 --- a/provisioner/shell/provisioner_test.go +++ b/provisioner/shell/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell diff --git a/provisioner/shell/unix_reader.go b/provisioner/shell/unix_reader.go index dc74647b292..9e27a6de928 100644 --- a/provisioner/shell/unix_reader.go +++ b/provisioner/shell/unix_reader.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell diff --git a/provisioner/shell/unix_reader_test.go b/provisioner/shell/unix_reader_test.go index 96c470cc13c..869531653ad 100644 --- a/provisioner/shell/unix_reader_test.go +++ b/provisioner/shell/unix_reader_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell diff --git a/provisioner/shell/version/version.go b/provisioner/shell/version/version.go index f192bb373db..bb0b798efe2 100644 --- a/provisioner/shell/version/version.go +++ b/provisioner/shell/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/sleep/provisioner.go b/provisioner/sleep/provisioner.go index 8dfb4ce1f7c..7c74c74b73d 100644 --- a/provisioner/sleep/provisioner.go +++ b/provisioner/sleep/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Provisioner diff --git a/provisioner/sleep/provisioner_test.go b/provisioner/sleep/provisioner_test.go index 315849e66dc..94acf5771ef 100644 --- a/provisioner/sleep/provisioner_test.go +++ b/provisioner/sleep/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package sleep diff --git a/provisioner/sleep/version/version.go b/provisioner/sleep/version/version.go index bdad4975ec3..3b0c4c2bf25 100644 --- a/provisioner/sleep/version/version.go +++ b/provisioner/sleep/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go index 8aaa3598ccd..4c1113a0df8 100644 --- a/provisioner/windows-restart/provisioner.go +++ b/provisioner/windows-restart/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/windows-restart/provisioner_test.go b/provisioner/windows-restart/provisioner_test.go index bc68f167398..c2d934ed539 100644 --- a/provisioner/windows-restart/provisioner_test.go +++ b/provisioner/windows-restart/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package restart diff --git a/provisioner/windows-restart/version/version.go b/provisioner/windows-restart/version/version.go index 5376f9e31a6..d178be5e559 100644 --- a/provisioner/windows-restart/version/version.go +++ b/provisioner/windows-restart/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/provisioner/windows-shell/provisioner.go b/provisioner/windows-shell/provisioner.go index c6f22a3e778..0002d85ba06 100644 --- a/provisioner/windows-shell/provisioner.go +++ b/provisioner/windows-shell/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/windows-shell/provisioner_test.go b/provisioner/windows-shell/provisioner_test.go index e01af9e7b06..5ef92c64ac0 100644 --- a/provisioner/windows-shell/provisioner_test.go +++ b/provisioner/windows-shell/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package shell diff --git a/provisioner/windows-shell/version/version.go b/provisioner/windows-shell/version/version.go index 18ad34fe08e..71885679439 100644 --- a/provisioner/windows-shell/version/version.go +++ b/provisioner/windows-shell/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 4f1abd3a1cb..3290347fe0f 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 <# .Synopsis diff --git a/scripts/build.sh b/scripts/build.sh index 8b65f50b773..491a1bbce4f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 # This script builds the application from source for multiple platforms. diff --git a/scripts/codesign_example.sh b/scripts/codesign_example.sh index 2e1a1698477..85303332049 100755 --- a/scripts/codesign_example.sh +++ b/scripts/codesign_example.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 set -euo pipefail diff --git a/scripts/dist.sh b/scripts/dist.sh index 113af57ba21..999be612a05 100755 --- a/scripts/dist.sh +++ b/scripts/dist.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 set -e diff --git a/scripts/generate-plugins.go b/scripts/generate-plugins.go index e52c063b3fe..bd303cb29ba 100755 --- a/scripts/generate-plugins.go +++ b/scripts/generate-plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 // Generate Plugins is a small program that updates the lists of plugins in // command/plugin.go so they will be compiled into the main packer binary. diff --git a/scripts/off_gopath.sh b/scripts/off_gopath.sh index beb1433e1bf..04e1ae709e5 100755 --- a/scripts/off_gopath.sh +++ b/scripts/off_gopath.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 set -eu -o pipefail diff --git a/scripts/prepare_changelog.sh b/scripts/prepare_changelog.sh index 3f776034b1d..be9049eca78 100755 --- a/scripts/prepare_changelog.sh +++ b/scripts/prepare_changelog.sh @@ -1,6 +1,6 @@ #!/bin/zsh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 LAST_RELEASE=$1 diff --git a/scripts/sign.sh b/scripts/sign.sh index f7d18acd764..494347ef677 100755 --- a/scripts/sign.sh +++ b/scripts/sign.sh @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 #!/usr/bin/env bash diff --git a/scripts/sort-md-list.py b/scripts/sort-md-list.py index 9842977752e..c84ad663da2 100755 --- a/scripts/sort-md-list.py +++ b/scripts/sort-md-list.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 """ sort-md-list.py sorts markdown lists diff --git a/scripts/upgrade_plugins.sh b/scripts/upgrade_plugins.sh index 3ca2885f178..961f8ed804d 100755 --- a/scripts/upgrade_plugins.sh +++ b/scripts/upgrade_plugins.sh @@ -1,6 +1,6 @@ #!/bin/zsh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 ## This script is to be run before a Packer release in order to update diff --git a/scripts/vagrant-freebsd-priv-config.sh b/scripts/vagrant-freebsd-priv-config.sh index 9d5f0761ed5..89915370f36 100755 --- a/scripts/vagrant-freebsd-priv-config.sh +++ b/scripts/vagrant-freebsd-priv-config.sh @@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 chown vagrant:wheel \ diff --git a/scripts/vagrant-freebsd-unpriv-bootstrap.sh b/scripts/vagrant-freebsd-unpriv-bootstrap.sh index 89fc9fc87bb..809415ab6c8 100755 --- a/scripts/vagrant-freebsd-unpriv-bootstrap.sh +++ b/scripts/vagrant-freebsd-unpriv-bootstrap.sh @@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 export GOPATH=/opt/gopath diff --git a/scripts/vagrant-linux-priv-config.sh b/scripts/vagrant-linux-priv-config.sh index d89e10ecb0b..b658e719179 100755 --- a/scripts/vagrant-linux-priv-config.sh +++ b/scripts/vagrant-linux-priv-config.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 export DEBIAN_FRONTEND=noninteractive diff --git a/scripts/vagrant-linux-priv-go.sh b/scripts/vagrant-linux-priv-go.sh index 2d99bc1517b..e59ae7e145d 100755 --- a/scripts/vagrant-linux-priv-go.sh +++ b/scripts/vagrant-linux-priv-go.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 function install_go() { diff --git a/scripts/vagrant-linux-unpriv-bootstrap.sh b/scripts/vagrant-linux-unpriv-bootstrap.sh index ca7f004c9eb..ff6b8f8f90f 100755 --- a/scripts/vagrant-linux-unpriv-bootstrap.sh +++ b/scripts/vagrant-linux-unpriv-bootstrap.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: BUSL-1.1 cd /opt/gopath/src/github.com/hashicorp/packer && make dev diff --git a/tty.go b/tty.go index a6f16d122ac..62fa5203ffd 100644 --- a/tty.go +++ b/tty.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 //go:build !solaris // +build !solaris diff --git a/tty_solaris.go b/tty_solaris.go index 257db948865..ed40b7fdb82 100644 --- a/tty_solaris.go +++ b/tty_solaris.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package main diff --git a/version/version.go b/version/version.go index c474c80d650..2df08d2d71b 100644 --- a/version/version.go +++ b/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 +// SPDX-License-Identifier: BUSL-1.1 package version From 320fd8d6fbcdde6990db3efadff0f454acc48ab7 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 11 Aug 2023 15:19:13 -0400 Subject: [PATCH 61/92] Update licensing for product release pipeline (#12570) --- .copywrite.hcl | 4 ++-- .github/workflows/build.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.copywrite.hcl b/.copywrite.hcl index 2e86e1c3cc1..3cbd1daa501 100644 --- a/.copywrite.hcl +++ b/.copywrite.hcl @@ -1,6 +1,6 @@ project { - license = "MPL-2.0" - copyright_year = 2013 + license = "BUSL-1.1" + copyright_year = 2023 header_ignore = [ "*.hcl2spec.go", # generated code specs, since they'll be wiped out until we support adding the headers at generation-time "hcl2template/testdata/**", diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a756fc56013..c15c8c6acf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,7 @@ jobs: version: ${{ needs.set-product-version.outputs.product-version }} maintainer: "HashiCorp" homepage: "https://www.packer.io/docs" - license: "MPL-2.0" + license: "BUSL-1.1" binary: "dist/${{ env.REPO_NAME }}" deb_depends: "openssl" rpm_depends: "openssl" From c575946e4db49729913a78b7cc7db6091b142331 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 11 Aug 2023 15:20:50 -0400 Subject: [PATCH 62/92] Update terminology to reflect community editions of Packer (#12571) --- website/content/docs/commands/init.mdx | 2 +- website/content/docs/index.mdx | 2 +- website/content/docs/intro/index.mdx | 2 +- website/content/docs/partnerships.mdx | 2 +- website/content/guides/packer-on-cicd/trigger-tfe.mdx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/website/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index e6209d2c15e..7b61ecbf13f 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -70,7 +70,7 @@ packer { } ``` -HashiCorp does not officially verify third party Packer plugins, plugins not under the HashiCorp namespace `hashicorp/*`; as with all open source tools, please do your own due diligence when using a new tool. +HashiCorp does not officially verify third party Packer plugins, plugins not under the HashiCorp namespace `hashicorp/*`; as with all community tools, please do your own due diligence when using a new tool. ## Plugin Selection diff --git a/website/content/docs/index.mdx b/website/content/docs/index.mdx index ad32aa8a02c..5fd386e1dc7 100644 --- a/website/content/docs/index.mdx +++ b/website/content/docs/index.mdx @@ -6,7 +6,7 @@ page_title: Documentation # Packer Documentation -[Packer](https://www.packer.io/) is an open source tool that enables you to create identical machine images for multiple platforms from a single source template. A common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. +[Packer](https://www.packer.io/) is a community tool that enables you to create identical machine images for multiple platforms from a single source template. A common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. To install Packer and learn the standard Packer workflow, try the [Get Started tutorials](/packer/tutorials). diff --git a/website/content/docs/intro/index.mdx b/website/content/docs/intro/index.mdx index 99f8175943e..d6fb56902f6 100644 --- a/website/content/docs/intro/index.mdx +++ b/website/content/docs/intro/index.mdx @@ -17,7 +17,7 @@ features. ## What is Packer? -Packer is an open source tool for creating identical machine images for multiple +Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration diff --git a/website/content/docs/partnerships.mdx b/website/content/docs/partnerships.mdx index 2e87dfdb7c8..97d1ec526f6 100644 --- a/website/content/docs/partnerships.mdx +++ b/website/content/docs/partnerships.mdx @@ -15,7 +15,7 @@ This program is intended to be largely a self-service process with links and gui ### Types of Packer Integrations -Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. +Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image. A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc. To know more about use cases of Packer click ([Use Cases - Introduction | Packer by HashiCorp](/packer/docs/intro/use-cases)) diff --git a/website/content/guides/packer-on-cicd/trigger-tfe.mdx b/website/content/guides/packer-on-cicd/trigger-tfe.mdx index b43e282a6b2..14b2643bd1e 100644 --- a/website/content/guides/packer-on-cicd/trigger-tfe.mdx +++ b/website/content/guides/packer-on-cicd/trigger-tfe.mdx @@ -12,7 +12,7 @@ and used locally in development, like is often done with VirtualBox images with Vagrant. In most other cases, the new image will be used to provision new infrastructure. -[Terraform](https://www.terraform.io/) is an open source tool that is ideal for +[Terraform](https://www.terraform.io/) is a community tool that is ideal for provisioning new infrastructure with images generated by Packer, and [Terraform Enterprise](https://www.hashicorp.com/products/terraform/) is the best way to perform automated Terraform runs. From 2b32903fe388d78e9654b8362d0aafff97ad5fe3 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Wed, 16 Aug 2023 11:44:32 -0400 Subject: [PATCH 63/92] Document PLSP-related environment variables Since we added support for PLSPs recently, and it will be released as part of 1.9.3, we add some documentation regarding the environment variables we added, and a note regarding their relation to PLSP support. --- website/content/docs/hcp/index.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/content/docs/hcp/index.mdx b/website/content/docs/hcp/index.mdx index b7af158ee26..d908cca70cc 100644 --- a/website/content/docs/hcp/index.mdx +++ b/website/content/docs/hcp/index.mdx @@ -35,6 +35,12 @@ You can set these additional environment variables to control how metadata is pu - `HCP_PACKER_REGISTRY` - When set, Packer does not push image metadata to HCP Packer from an otherwise configured template. Allowed values are [0|OFF]. +- `HCP_ORGANIZATION_ID` - The ID of the HCP organization linked to your service principal. This is environment variable is not required and available for the sole purpose of keeping parity with the HCP SDK authentication options. Its use may change in a future release. + +- `HCP_PROJECT_ID` - The ID of the HCP project to use. This is useful if your service principal has access to multiple projects, as by default Packer will pick the one created first as target. + +-> **Note**: The HCP_PROJECT_ID environment variable must be set if you're authenticating with a project-level service principal, otherwise Packer will attempt to get the list of projects for an organization and error due to a lack of permissions for a project-level service principal. This is supported starting with Packer 1.9.3; older versions of Packer do not support using project-level service principals. + ### HCP Packer Registry Block The only metadata that Packer can infer from a template with the basic configuration are the build name and build fingerprint. For HCL2 templates, we recommend adding the `hcp_packer_registry` block to your template so that you can customize the metadata that Packer sends to the registry. From a961adfb7033f757a9d35124bb06e7e2a6165618 Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:44:09 -0400 Subject: [PATCH 64/92] Update BUSL LICENSE to include licensed product and version. (#12575) Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2ecf202e305..73957dc7d75 100644 --- a/LICENSE +++ b/LICENSE @@ -4,7 +4,7 @@ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. Parameters Licensor: HashiCorp, Inc. -Licensed Work: 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 such use does not include offering the Licensed Work to third parties on a hosted or embedded basis which is From 50e8f507ca3198eadf4d28105f5d22f7cef95496 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 16 Aug 2023 19:18:27 +0000 Subject: [PATCH 65/92] Update CHANGELOG for 1.9.3 --- CHANGELOG.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c693c7fd3e..67394c78ee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,38 @@ -## 1.9.3 (Upcoming) +## 1.9.3 (August 17, 2023) + +### NOTES: +* **New Docker Image**: As part of the bundled plugin removal effort, a new + Docker target called `release-full` has been added to the Packer release + artifacts. The release-full image includes Packer and all the official + plugins pre-installed in its environment. This image is being offered as an + alternative option for those users who may still be relying on the plugin + versions bundled into the Packer binary. + [GH-12532](https://github.com/hashicorp/packer/pull/12532) + +### IMPROVEMENTS: +* core/docs: Clarify the expected usage of the `packer init` command for HCL2 + template builds.[GH-12535](https://github.com/hashicorp/packer/pull/12535) +* core/hcp: Add support for project-level service principals. A user connecting + with a project level service principals must provide a valid HCP_PROJECT_ID + in order to connect. + [GH-12520](https://github.com/hashicorp/packer/pull/12520) + [GH-12576](https://github.com/hashicorp/packer/pull/12576) +* core: A new Docker image `packer:release-full` has been added for all + supported architectures. The release-full image includes Packer and all the + official plugins pre-installed in its environment. + [GH-12532](https://github.com/hashicorp/packer/pull/12532) +* core: Add enhanced support to Packer telemetry for bundle plugins usage. + [GH-12536](https://github.com/hashicorp/packer/pull/12536) + +### BUG FIXES: + +* core: Bump golang.org/x/net to v0.13.0 to address CVE GO-2023-1988. Packer + itself is not vulnerable to the CVE as we don't render web pages, but + security checks do point it as an issue that needs to be addressed. + [GH-12561](https://github.com/hashicorp/packer/pull/12561) +* core: Fix custom plugin loading in current working directory regression. + [GH-12544](https://github.com/hashicorp/packer/pull/12544) + ## 1.9.2 (July 19, 2023) From 999d751793324d368755000694ba82a5cecea509 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 17 Aug 2023 11:10:19 -0400 Subject: [PATCH 66/92] Rename duplicate ami name to fix failing test --- .../test-fixtures/basic_amazon_with_required_plugins.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl b/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl index f9ba5a55b2c..a30f85fa49e 100644 --- a/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic_amazon_with_required_plugins.pkr.hcl @@ -12,7 +12,7 @@ source "amazon-ebs" "basic-test" { instance_type = "m3.medium" source_ami = "ami-76b2a71e" ssh_username = "ubuntu" - ami_name = "packer-plugin-bundled-amazon-ebs-test" + ami_name = "packer-plugin-external-amazon-ebs-test" } build { From f961715161804650cb82fb701ff2c001c146a6ed Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 17 Aug 2023 17:08:04 +0000 Subject: [PATCH 67/92] Prepare for 1.9.4 dev mode --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67394c78ee2..f040eba0233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.9.4 (Upcoming) + ## 1.9.3 (August 17, 2023) ### NOTES: From eb9e1a479537f3786b9f5ad48a414fce6aa9cb2c Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 9 Aug 2023 14:42:38 -0400 Subject: [PATCH 68/92] packer: remove implicit required plugins Since this feature is no longer something we plan to activate later, as it contradicts with our efforts to remove bundled plugins, and encouraging users to move to either manually installing plugins, or managing them through `packer init', we clean-up the code for this feature. --- command/init.go | 48 +---- command/plugins_install.go | 1 - command/plugins_installed.go | 1 - command/plugins_remove.go | 1 - hcl2template/parser.go | 18 +- hcl2template/plugin.go | 1 - hcl2template/types.required_plugins.go | 138 ------------- hcl2template/types.required_plugins_test.go | 218 +------------------- main.go | 66 ------ packer/plugin-getter/plugins.go | 3 - packer/plugin.go | 17 -- website/content/docs/commands/init.mdx | 12 -- 12 files changed, 8 insertions(+), 516 deletions(-) diff --git a/command/init.go b/command/init.go index 5a066d96276..ad9a7bcdd98 100644 --- a/command/init.go +++ b/command/init.go @@ -124,55 +124,13 @@ func (c *InitCommand) RunContext(buildCtx context.Context, cla *InitArgs) int { Getters: getters, }) if err != nil { - if pluginRequirement.Implicit { - msg := fmt.Sprintf(` -Warning! At least one component used in your config file(s) has moved out of -Packer into the %q plugin. -For that reason, Packer init tried to install the latest version of the %s -plugin. Unfortunately, this failed : -%s`, - pluginRequirement.Identifier, - pluginRequirement.Identifier.Type, - err) - c.Ui.Say(msg) - } else { - c.Ui.Error(fmt.Sprintf("Failed getting the %q plugin:", pluginRequirement.Identifier)) - c.Ui.Error(err.Error()) - ret = 1 - } + c.Ui.Error(fmt.Sprintf("Failed getting the %q plugin:", pluginRequirement.Identifier)) + c.Ui.Error(err.Error()) + ret = 1 } if newInstall != nil { - if pluginRequirement.Implicit { - msg := fmt.Sprintf("Installed implicitly required plugin %s %s in %q", pluginRequirement.Identifier, newInstall.Version, newInstall.BinaryPath) - ui.Say(msg) - - warn := fmt.Sprintf(` -Warning, at least one component used in your config file(s) has moved out of -Packer into the %[2]q plugin and is now being implicitly required. -For more details on implicitly required plugins see https://packer.io/docs/commands/init#implicit-required-plugin - -To avoid any backward incompatible changes with your -config file you may want to lock the plugin version by pasting the following to your config: - -packer { - required_plugins { - %[1]s = { - source = "%[2]s" - version = "~> %[3]s" - } - } -} -`, - pluginRequirement.Identifier.Type, - pluginRequirement.Identifier, - newInstall.Version, - ) - ui.Error(warn) - continue - } msg := fmt.Sprintf("Installed plugin %s %s in %q", pluginRequirement.Identifier, newInstall.Version, newInstall.BinaryPath) ui.Say(msg) - } } return ret diff --git a/command/plugins_install.go b/command/plugins_install.go index 7082f134a8f..3037c0959d0 100644 --- a/command/plugins_install.go +++ b/command/plugins_install.go @@ -77,7 +77,6 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []stri // a plugin requirement that matches them all pluginRequirement := plugingetter.Requirement{ Identifier: plugin, - Implicit: false, } if len(args) > 1 { diff --git a/command/plugins_installed.go b/command/plugins_installed.go index 114c25b55a9..b19be4e5c33 100644 --- a/command/plugins_installed.go +++ b/command/plugins_installed.go @@ -64,7 +64,6 @@ func (c *PluginsInstalledCommand) RunContext(buildCtx context.Context) int { Accessor: "", VersionConstraints: nil, Identifier: nil, - Implicit: false, } installations, err := allPlugins.ListInstallations(opts) diff --git a/command/plugins_remove.go b/command/plugins_remove.go index ac8c0882b8f..07993f21a4e 100644 --- a/command/plugins_remove.go +++ b/command/plugins_remove.go @@ -74,7 +74,6 @@ func (c *PluginsRemoveCommand) RunContext(buildCtx context.Context, args []strin // a plugin requirement that matches them all pluginRequirement := plugingetter.Requirement{ Identifier: plugin, - Implicit: false, } if len(args) > 1 { diff --git a/hcl2template/parser.go b/hcl2template/parser.go index 43b43bcd6f0..fc9182bf04f 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -163,28 +163,14 @@ func (p *Parser) Parse(filename string, varFiles []string, argVars map[string]st return cfg, diags } - // Decode required_plugins blocks and create implicit required_plugins - // blocks. Implicit required_plugins blocks happen when a builder or another - // plugin cannot be found, for example if one uses : - // source "amazon-ebs" "example" { ... } - // And no `amazon-ebs` builder can be found. This will then be the - // equivalent of having : - // packer { - // required_plugins { - // amazon = { - // version = "latest" - // source = "github.com/hashicorp/amazon" - // } - // } + // Decode required_plugins blocks. + // // Note: using `latest` ( or actually an empty string ) in a config file // does not work and packer will ask you to pick a version { for _, file := range files { diags = append(diags, cfg.decodeRequiredPluginsBlock(file)...) } - for _, file := range files { - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlocks(file)...) - } } // Decode variable blocks so that they are available later on. Here locals diff --git a/hcl2template/plugin.go b/hcl2template/plugin.go index 92b9cf2f30b..323263596f8 100644 --- a/hcl2template/plugin.go +++ b/hcl2template/plugin.go @@ -45,7 +45,6 @@ func (cfg *PackerConfig) PluginRequirements() (plugingetter.Requirements, hcl.Di Accessor: name, Identifier: block.Type, VersionConstraints: block.Requirement.Required, - Implicit: block.PluginDependencyReason == PluginDependencyImplicit, }) uniq[name] = block } diff --git a/hcl2template/types.required_plugins.go b/hcl2template/types.required_plugins.go index 94dfd4669b3..d5e010345ea 100644 --- a/hcl2template/types.required_plugins.go +++ b/hcl2template/types.required_plugins.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/hcl2template/addrs" - "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -44,127 +43,6 @@ func (cfg *PackerConfig) decodeRequiredPluginsBlock(f *hcl.File) hcl.Diagnostics return diags } -func (cfg *PackerConfig) decodeImplicitRequiredPluginsBlocks(f *hcl.File) hcl.Diagnostics { - // when a plugin is used but not available it should be 'implicitly - // required'. Here we read common configuration blocks to try to guess - // plugin usages. - - // decodeRequiredPluginsBlock needs to be called before - // decodeImplicitRequiredPluginsBlocks; otherwise all required plugins will - // be implicitly required too. - - var diags hcl.Diagnostics - - content, moreDiags := f.Body.Content(configSchema) - diags = append(diags, moreDiags...) - - for _, block := range content.Blocks { - - switch block.Type { - case sourceLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(Builder, block)...) - case dataSourceLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(Datasource, block)...) - case buildLabel: - content, _, moreDiags := block.Body.PartialContent(buildSchema) - diags = append(diags, moreDiags...) - for _, block := range content.Blocks { - - switch block.Type { - case buildProvisionerLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(Provisioner, block)...) - case buildPostProcessorLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(PostProcessor, block)...) - case buildPostProcessorsLabel: - content, _, moreDiags := block.Body.PartialContent(postProcessorsSchema) - diags = append(diags, moreDiags...) - for _, block := range content.Blocks { - - switch block.Type { - case buildPostProcessorLabel: - diags = append(diags, cfg.decodeImplicitRequiredPluginsBlock(PostProcessor, block)...) - } - } - } - } - - } - } - return diags -} - -func (cfg *PackerConfig) decodeImplicitRequiredPluginsBlock(k ComponentKind, block *hcl.Block) hcl.Diagnostics { - if len(block.Labels) == 0 { - // malformed block ? Let's not panic :) - return nil - } - // Currently all block types are `type "component-kind" ["name"] {` - // this makes this simple. - componentName := block.Labels[0] - - store := map[ComponentKind]packer.BasicStore{ - Builder: cfg.parser.PluginConfig.Builders, - PostProcessor: cfg.parser.PluginConfig.PostProcessors, - Provisioner: cfg.parser.PluginConfig.Provisioners, - Datasource: cfg.parser.PluginConfig.DataSources, - }[k] - if store.Has(componentName) { - // If any core or pre-loaded plugin defines the `happycloud-uploader` - // pp, skip. This happens for core and manually installed plugins, as - // they will be listed in the PluginConfig before parsing any HCL. - return nil - } - - redirect := map[ComponentKind]map[string]string{ - Builder: cfg.parser.PluginConfig.BuilderRedirects, - PostProcessor: cfg.parser.PluginConfig.PostProcessorRedirects, - Provisioner: cfg.parser.PluginConfig.ProvisionerRedirects, - Datasource: cfg.parser.PluginConfig.DatasourceRedirects, - }[k][componentName] - - if redirect == "" { - // no known redirect for this component - return nil - } - - redirectAddr, diags := addrs.ParsePluginSourceString(redirect) - if diags.HasErrors() { - // This should never happen, since the map is manually filled. - return diags - } - - for _, req := range cfg.Packer.RequiredPlugins { - if _, found := req.RequiredPlugins[redirectAddr.Type]; found { - // This could happen if a plugin was forked. For example, I forked - // the github.com/hashicorp/happycloud plugin into - // github.com/azr/happycloud that is required in my config file; and - // am using the `happycloud-uploader` pp component from it. In that - // case - and to avoid miss-requires - we won't implicitly import - // any other `happycloud` plugin. - return nil - } - } - - cfg.implicitlyRequirePlugin(redirectAddr) - return nil -} - -func (cfg *PackerConfig) implicitlyRequirePlugin(plugin *addrs.Plugin) { - cfg.Packer.RequiredPlugins = append(cfg.Packer.RequiredPlugins, &RequiredPlugins{ - RequiredPlugins: map[string]*RequiredPlugin{ - plugin.Type: { - Name: plugin.Type, - Source: plugin.String(), - Type: plugin, - Requirement: VersionConstraint{ - Required: nil, // means latest - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }, - }) -} - // RequiredPlugin represents a declaration of a dependency on a particular // Plugin version or source. type RequiredPlugin struct { @@ -177,24 +55,8 @@ type RequiredPlugin struct { Type *addrs.Plugin Requirement VersionConstraint DeclRange hcl.Range - PluginDependencyReason } -// PluginDependencyReason is an enumeration of reasons why a dependency might be -// present. -type PluginDependencyReason int - -const ( - // PluginDependencyExplicit means that there is an explicit - // "required_plugin" block in the configuration. - PluginDependencyExplicit PluginDependencyReason = iota - - // PluginDependencyImplicit means that there is no explicit - // "required_plugin" block but there is at least one resource that uses this - // plugin. - PluginDependencyImplicit -) - type RequiredPlugins struct { RequiredPlugins map[string]*RequiredPlugin DeclRange hcl.Range diff --git a/hcl2template/types.required_plugins_test.go b/hcl2template/types.required_plugins_test.go index 5e2b4a90c96..0329d1505ff 100644 --- a/hcl2template/types.required_plugins_test.go +++ b/hcl2template/types.required_plugins_test.go @@ -46,7 +46,6 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, - PluginDependencyReason: PluginDependencyExplicit, }, }}, }, @@ -77,19 +76,13 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, - PluginDependencyReason: PluginDependencyExplicit, }, }}, }, }, }}, {"required_plugin_forked", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-chroot": "github.com/hashicorp/amazon", - } - }, - )}, ` + parser: getBasicParser(func(p *Parser) {})}, ` packer { required_plugins { amazon = { @@ -114,19 +107,13 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, - PluginDependencyReason: PluginDependencyExplicit, }, }}, }, }, }}, {"missing-required-plugin-for-pre-defined-builder", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-ebs": "github.com/hashicorp/amazon", - } - }, - )}, + parser: getBasicParser(func(p *Parser) {})}, ` packer { }`, ` @@ -143,202 +130,6 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { RequiredPlugins: nil, }, }}, - {"missing-required-plugin-for-builder", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-chroot": "github.com/hashicorp/amazon", - } - }, - )}, - ` - packer { - }`, ` - source "amazon-chroot" "example" { - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "amazon": { - Name: "amazon", - Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - {"missing-required-plugin-for-provisioner", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.ProvisionerRedirects = map[string]string{ - "ansible-local": "github.com/ansible/ansible", - } - }, - )}, - ` - packer { - }`, ` - build { - provisioner "ansible-local" {} - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "ansible": { - Name: "ansible", - Source: "github.com/ansible/ansible", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "ansible", Type: "ansible"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - {"missing-required-plugin-for-post-processor", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.PostProcessorRedirects = map[string]string{ - "docker-push": "github.com/hashicorp/docker", - } - }, - )}, - ` - packer { - }`, ` - build { - post-processor "docker-push" {} - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "docker": { - Name: "docker", - Source: "github.com/hashicorp/docker", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "docker"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - {"missing-required-plugin-for-nested-post-processor", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.PostProcessorRedirects = map[string]string{ - "docker-push": "github.com/hashicorp/docker", - } - }, - )}, - ` - packer { - }`, ` - build { - post-processors { - post-processor "docker-push" { - } - } - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "docker": { - Name: "docker", - Source: "github.com/hashicorp/docker", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "docker"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, - - {"required-plugin-renamed", PackerConfig{ - parser: getBasicParser(func(p *Parser) { - p.PluginConfig.BuilderRedirects = map[string]string{ - "amazon-chroot": "github.com/hashicorp/amazon", - } - }, - )}, - ` - packer { - required_plugins { - amazon-v1 = { - source = "github.com/hashicorp/amazon" - version = "~> v1.0" - } - } - }`, ` - source "amazon-v1-chroot" "example" { - } - source "amazon-chroot" "example" { - } - `, - false, - PackerConfig{ - Packer: struct { - VersionConstraints []VersionConstraint - RequiredPlugins []*RequiredPlugins - }{ - RequiredPlugins: []*RequiredPlugins{ - {RequiredPlugins: map[string]*RequiredPlugin{ - "amazon-v1": { - Name: "amazon-v1", - Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, - Requirement: VersionConstraint{ - Required: mustVersionConstraints(version.NewConstraint("~> v1.0")), - }, - PluginDependencyReason: PluginDependencyExplicit, - }, - }}, - {RequiredPlugins: map[string]*RequiredPlugin{ - "amazon": { - Name: "amazon", - Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, - Requirement: VersionConstraint{ - Required: nil, - }, - PluginDependencyReason: PluginDependencyImplicit, - }, - }}, - }, - }, - }}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -351,13 +142,10 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { t.Fatal(diags) } - rest, diags := cfg.parser.ParseHCL([]byte(tt.restOfTemplate), "rest.pkr.hcl") + _, diags = cfg.parser.ParseHCL([]byte(tt.restOfTemplate), "rest.pkr.hcl") if len(diags) > 0 { t.Fatal(diags) } - if gotDiags := cfg.decodeImplicitRequiredPluginsBlocks(rest); (len(gotDiags) > 0) != tt.wantDiags { - t.Fatal(gotDiags) - } if diff := cmp.Diff(tt.wantConfig, cfg, cmpOpts...); diff != "" { t.Errorf("PackerConfig.inferImplicitRequiredPluginFromBlocks() unexpected PackerConfig: %v", diff) } diff --git a/main.go b/main.go index 0d39d70d579..972f7170c68 100644 --- a/main.go +++ b/main.go @@ -325,72 +325,6 @@ func loadConfig() (*config, error) { PluginMinPort: 10000, PluginMaxPort: 25000, KnownPluginFolders: packer.PluginFolders("."), - - // BuilderRedirects - BuilderRedirects: map[string]string{ - - //"amazon-chroot": "github.com/hashicorp/amazon", - //"amazon-ebs": "github.com/hashicorp/amazon", - //"amazon-ebssurrogate": "github.com/hashicorp/amazon", - //"amazon-ebsvolume": "github.com/hashicorp/amazon", - //"amazon-instance": "github.com/hashicorp/amazon", - - //"azure-arm": "github.com/hashicorp/azure", - //"azure-chroot": "github.com/hashicorp/azure", - //"azure-dtl": "github.com/hashicorp/azure", - - //"docker": "github.com/hashicorp/docker", - - //"exoscale": "github.com/exoscale/exoscale", - - //"googlecompute": "github.com/hashicorp/googlecompute", - - //"parallels-iso": "github.com/hashicorp/parallels", - //"parallels-pvm": "github.com/hashicorp/parallels", - - //"qemu": "github.com/hashicorp/qemu", - - //"vagrant": "github.com/hashicorp/vagrant", - - //"virtualbox-iso": "github.com/hashicorp/virtualbox", - //"virtualbox-ovf": "github.com/hashicorp/virtualbox", - //"virtualbox-vm": "github.com/hashicorp/virtualbox", - - //"vmware-iso": "github.com/hashicorp/vmware", - //"vmware-vmx": "github.com/hashicorp/vmware", - - //"vsphere-iso": "github.com/hashicorp/vsphere", - //"vsphere-clone": "github.com/hashicorp/vsphere", - }, - DatasourceRedirects: map[string]string{ - //"amazon-ami": "github.com/hashicorp/amazon", - //"amazon-secretsmanager": "github.com/hashicorp/amazon", - }, - ProvisionerRedirects: map[string]string{ - //"ansible": "github.com/hashicorp/ansible", - //"ansible-local": "github.com/hashicorp/ansible", - - //"azure-dtlartifact": "github.com/hashicorp/azure", - }, - PostProcessorRedirects: map[string]string{ - //"amazon-import": "github.com/hashicorp/amazon", - - //"docker-import": "github.com/hashicorp/docker", - //"docker-push": "github.com/hashicorp/docker", - //"docker-save": "github.com/hashicorp/docker", - //"docker-tag": "github.com/hashicorp/docker", - - //"googlecompute-export": "github.com/hashicorp/googlecompute", - //"googlecompute-import": "github.com/hashicorp/googlecompute", - - //"exoscale-import": "github.com/exoscale/exoscale", - - //"vagrant": "github.com/hashicorp/vagrant", - //"vagrant-cloud": "github.com/hashicorp/vagrant", - - //"vsphere": "github.com/hashicorp/vsphere", - //"vsphere-template": "github.com/hashicorp/vsphere", - }, } if err := config.Plugins.Discover(); err != nil { return nil, err diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index b16edcfade0..92f7e28a8e7 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -43,9 +43,6 @@ type Requirement struct { // VersionConstraints as defined by user. Empty ( to be avoided ) means // highest found version. VersionConstraints version.Constraints - - // was this require implicitly guessed ? - Implicit bool } type BinaryInstallationOptions struct { diff --git a/packer/plugin.go b/packer/plugin.go index c88f54f86b3..313ef2db31e 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -34,23 +34,6 @@ type PluginConfig struct { Provisioners ProvisionerSet PostProcessors PostProcessorSet DataSources DatasourceSet - - // Redirects are only set when a plugin was completely moved out; they allow - // telling where a plugin has moved by checking if a known component of this - // plugin is used. For example implicitly require the - // github.com/hashicorp/amazon plugin if it was moved out and the - // "amazon-ebs" plugin is used, but not found. - // - // Redirects will be bypassed if the redirected components are already found - // in their corresponding sets (Builders, Provisioners, PostProcessors, - // DataSources). That is, for example, if you manually put a single - // component plugin in the plugins folder. - // - // Example BuilderRedirects: "amazon-ebs" => "github.com/hashicorp/amazon" - BuilderRedirects map[string]string - DatasourceRedirects map[string]string - ProvisionerRedirects map[string]string - PostProcessorRedirects map[string]string } // PACKERSPACE is used to represent the spaces that separate args for a command diff --git a/website/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index 7b61ecbf13f..940751c5b67 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -87,18 +87,6 @@ Directory](/packer/docs/configure#packer-s-plugin-directory). See [Installing Plugins](/packer/docs/plugins#installing-plugins) for more information on how plugin installation works. -### Implicit required plugin - -This is part of a set of breaking changes made to decouple Packer releases from -plugin releases. To make the transition easier, we will tag components of these -plugins as "moved out". If one of the components of a moved out plugin is used -in a config file, but there is no mention of that plugin in the -"required_plugin" block, then Packer init will automatically download and -install that plugin. Packer will then display a warning and suggest that you -add the plugin to your required_plugin block. We recommend you use the -required_plugin block even if you are only using official plugins, because it -allows you to set the plugin version to avoid surprises in the future. - ## Options - `-upgrade` - On top of installing missing plugins, update installed plugins to From f8ebf69c0de67c0a297d2d5c64dd962989ad59fd Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 18 Aug 2023 06:26:08 -0400 Subject: [PATCH 69/92] telemetry: Add nil check in SetBundledUsage Invoking Packer with the CHECKPOINT_DISABLE env. variable the telemetry reporter is left uninitialized in order to disable telemetry reporting. Any method calls on the nil reporter is expected to check if the reporter is active or in NOOP mode. This change fixes a crash when calling SetBundledUsage() on a nil CheckpointTelemetry type that occurs when using a bundled plugin with CHECKPOINT_DISABLE=1. --- packer/telemetry.go | 3 +++ packer/telemetry_test.go | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packer/telemetry.go b/packer/telemetry.go index 9a7f569139e..c3d0573ef5e 100644 --- a/packer/telemetry.go +++ b/packer/telemetry.go @@ -132,6 +132,9 @@ func (c *CheckpointTelemetry) SetTemplateType(t PackerTemplateType) { // SetBundledUsage marks the template as using bundled plugins func (c *CheckpointTelemetry) SetBundledUsage() { + if c == nil { + return + } c.useBundled = true } diff --git a/packer/telemetry_test.go b/packer/telemetry_test.go index ab304a55023..7abc600cda1 100644 --- a/packer/telemetry_test.go +++ b/packer/telemetry_test.go @@ -4,6 +4,7 @@ package packer import ( + "errors" "testing" "github.com/stretchr/testify/assert" @@ -33,3 +34,24 @@ func TestFlattenConfigKeys_nested(t *testing.T) { "Input didn't flatten correctly.", ) } + +func TestCheckpointTelemetry(t *testing.T) { + defer func() { + if r := recover(); r != nil { + t.Error("a noop CheckpointTelemetry should not to panic but it did\n", r) + } + }() + + // A null CheckpointTelemetry obtained in Packer when the CHECKPOINT_DISABLE env var is set results in a NOOP reporter + // The null reporter can be executable as a configured reporter but does not report any telemetry data. + var c *CheckpointTelemetry + c.SetTemplateType(HCL2Template) + c.SetBundledUsage() + c.AddSpan("mockprovisioner", "provisioner", nil) + if err := c.ReportPanic("Bogus Panic"); err != nil { + t.Errorf("calling ReportPanic on a nil checkpoint reporter should not error") + } + if err := c.Finalize("test", 1, errors.New("Bogus Error")); err != nil { + t.Errorf("calling Finalize on a nil checkpoint reporter should not error") + } +} From 42da69e2bd93881bf23a2e5600791c7edd00f7f9 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 18 Aug 2023 10:32:43 -0400 Subject: [PATCH 70/92] CHANGELOG: cut 1.9.4 release --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f040eba0233..1f484095466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ -## 1.9.4 (Upcoming) +## 1.9.4 (August 18, 2023) + +### BUG FIXES: + +* core: When invoking Packer with the CHECKPOINT_DISABLE environment variable the telemetry + reporter is left uninitialized in order to disable telemetry reporting. + Any method calls on the nil reporter is expected to check if the reporter is active or in + NOOP mode. The SetBundledUsage function, introduced in Packer 1.9.2, failed to perform a nil + check before attempting to modify an attribute, causing Packer to fail when telemetry is + disabled. This release fixes this issue by introducing such a check. ## 1.9.3 (August 17, 2023) From a0cb19927c3f1ac4c98e0770bcad1efdfbbb4475 Mon Sep 17 00:00:00 2001 From: Jamie Finnigan Date: Fri, 18 Aug 2023 10:18:53 -0700 Subject: [PATCH 71/92] .go-version: bump version of Go to 1.20.7 --- .go-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.go-version b/.go-version index 0bd54efd316..8909929f6e7 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.4 +1.20.7 From 3c6e3f52ceee74232fb3b65007443586cb616214 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 18 Aug 2023 15:24:28 -0400 Subject: [PATCH 72/92] CHANGELOG: preparing for 1.9.5 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f484095466..5810f01c34d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.9.5 (Upcoming) + ## 1.9.4 (August 18, 2023) ### BUG FIXES: From ebdee64c643ae5ad22c4853ec6c64731bae5f310 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 18 Aug 2023 15:48:22 -0400 Subject: [PATCH 73/92] Bump backport assistant to latest version --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index bb6e5b88158..8e4ebf5e0b2 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,7 +16,7 @@ jobs: contents: none if: github.event.pull_request.merged runs-on: ubuntu-latest - container: hashicorpdev/backport-assistant:0.2.3 + container: hashicorpdev/backport-assistant:0.3.4 steps: - name: Backport changes to stable-website run: | From fa663b47bfaac0eef5d836db407c6ca848a331ab Mon Sep 17 00:00:00 2001 From: cjlapao Date: Fri, 25 Aug 2023 10:31:06 +0100 Subject: [PATCH 74/92] Updating Community Tools webpage Adding Parallels Packer Example --- website/content/docs/community-tools.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/content/docs/community-tools.mdx b/website/content/docs/community-tools.mdx index ea75ef3df23..3a222f17a75 100644 --- a/website/content/docs/community-tools.mdx +++ b/website/content/docs/community-tools.mdx @@ -65,6 +65,9 @@ contribution here! to automate the creation of virtual machine images and their guest operating systems on VMware vSphere using HashiCorp Packer and the Packer Plugin for VMware vSphere (vsphere-iso). +- [Parallels/packer-examples](https://github.com/parallels/packer-examples) - Examples in how to use Packer with Parallels Desktop + to automate the creation of virtual machine images and their guest operating systems on macOS, windows and linux. + ## Wrappers - [packer-config](https://github.com/ianchesal/packer-config) - a Ruby model that lets you build Packer configurations in Ruby From 2325c7e9c7da938cd7b0c57fb30447fbcf0e1f67 Mon Sep 17 00:00:00 2001 From: Ilya Voronin Date: Fri, 18 Aug 2023 16:48:33 +0500 Subject: [PATCH 75/92] Set ivoronin/packer-plugin-sshkey version to 'latest' --- website/data/plugins-manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/data/plugins-manifest.json b/website/data/plugins-manifest.json index 675c8e7271d..2647475cb9e 100644 --- a/website/data/plugins-manifest.json +++ b/website/data/plugins-manifest.json @@ -287,7 +287,7 @@ "path": "sshkey", "repo": "ivoronin/packer-plugin-sshkey", "pluginTier": "community", - "version": "v1.0.1" + "version": "latest" }, { "title": "Tart", From 48e8c3e680549e4bce8a106ddc1c4c5d825aad6e Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 11 Aug 2023 14:46:03 +0000 Subject: [PATCH 76/92] Update version output for `-v` and `--version` flags The flags -v and --version are handled by the CLI runner, which outputs the raw version string. This change shortcuts the handling of the flags to force Packer to run the version subcommand. Closes: #12565 --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index 972f7170c68..834d040409a 100644 --- a/main.go +++ b/main.go @@ -252,6 +252,16 @@ func wrappedMain() int { Ui: ui, } + //versionCLIHelper shortcuts "--version" and "-v" to just show the version + versionCLIHelper := &cli.CLI{ + Args: args, + Version: version.Version, + } + if versionCLIHelper.IsVersion() && versionCLIHelper.Version != "" { + // by default version flags ignore all other args so there is no need to persist the original args. + args = []string{"version"} + } + cli := &cli.CLI{ Args: args, Autocomplete: true, From 318529f373e76b314b962874c3b6324e1238b7d1 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 6 Sep 2023 11:07:35 -0400 Subject: [PATCH 77/92] hcl2template: remove value validation for locals Local variables can't have a validation block in their definition, so this step in not useful and should be removed. Besides, since the validation was done on the local variables before evaluation, it did nothing at all, as the PackerConfig.LocalVariables collection gets populated during evaluation, so this is essentially a no-op, and can be safely removed. --- hcl2template/parser.go | 1 - 1 file changed, 1 deletion(-) diff --git a/hcl2template/parser.go b/hcl2template/parser.go index fc9182bf04f..c372a7733a9 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -295,7 +295,6 @@ func filterVarsFromLogs(inputOrLocal Variables) { func (cfg *PackerConfig) Initialize(opts packer.InitializeOptions) hcl.Diagnostics { diags := cfg.InputVariables.ValidateValues() - diags = append(diags, cfg.LocalVariables.ValidateValues()...) diags = append(diags, cfg.evaluateDatasources(opts.SkipDatasourcesExecution)...) diags = append(diags, checkForDuplicateLocalDefinition(cfg.LocalBlocks)...) diags = append(diags, cfg.evaluateLocalVariables(cfg.LocalBlocks)...) From 6fa0d25c5107b19c33e8e87a3314397def5b633f Mon Sep 17 00:00:00 2001 From: "Sk.Lv" Date: Fri, 4 Aug 2023 10:52:38 +0800 Subject: [PATCH 78/92] website: register ksyun docuement --- website/data/plugins-manifest.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/data/plugins-manifest.json b/website/data/plugins-manifest.json index 2647475cb9e..ae900b68e70 100644 --- a/website/data/plugins-manifest.json +++ b/website/data/plugins-manifest.json @@ -373,5 +373,12 @@ "repo": "hashicorp/packer-plugin-yandex", "version": "latest", "pluginTier": "community" + }, + { + "title": "Ksyun", + "path": "ksyun", + "repo": "kingsoftcloud/packer-plugin-ksyun", + "pluginTier": "community", + "version": "latest" } ] From 7f7567f68626a8a9752c77c04fcb4ec1b0b1bd83 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Fri, 15 Sep 2023 08:55:44 -0400 Subject: [PATCH 79/92] Remove plugins on the integration framework The active plugins that resided in a HashiCorp repository have been migrated to the integrations framework and no longer need to be listed within the plugins-manifest file. --- website/data/plugins-manifest.json | 234 ----------------------------- 1 file changed, 234 deletions(-) diff --git a/website/data/plugins-manifest.json b/website/data/plugins-manifest.json index ae900b68e70..63d9d26998b 100644 --- a/website/data/plugins-manifest.json +++ b/website/data/plugins-manifest.json @@ -1,18 +1,4 @@ [ - { - "title": "1&1", - "path": "oneandone", - "repo": "hashicorp/packer-plugin-oneandone", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Alibaba Cloud", - "path": "alicloud", - "repo": "hashicorp/packer-plugin-alicloud", - "pluginTier": "community", - "version": "latest" - }, { "title": "Anka", "path": "anka", @@ -21,49 +7,6 @@ "sourceBranch": "master", "version": "latest" }, - { - "title": "Ansible", - "path": "ansible", - "repo": "hashicorp/packer-plugin-ansible", - "version": "latest" - }, - { - "title": "Amazon EC2", - "path": "amazon", - "repo": "hashicorp/packer-plugin-amazon", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Azure", - "path": "azure", - "repo": "hashicorp/packer-plugin-azure", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "Chef", - "path": "chef", - "repo": "hashicorp/packer-plugin-chef", - "pluginTier": "community", - "version": "latest", - "archived": true - }, - { - "title": "CloudStack", - "path": "cloudstack", - "repo": "hashicorp/packer-plugin-cloudstack", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Converge", - "path": "converge", - "repo": "hashicorp/packer-plugin-converge", - "pluginTier": "community", - "version": "latest", - "archived": true - }, { "title": "DigitalOcean", "path": "digitalocean", @@ -72,13 +15,6 @@ "version": "latest", "isHcpPackerReady": true }, - { - "title": "Docker", - "path": "docker", - "repo": "hashicorp/packer-plugin-docker", - "version": "latest", - "isHcpPackerReady": true - }, { "title": "External", "path": "external", @@ -93,13 +29,6 @@ "version": "latest", "sourceBranch": "main" }, - { - "title": "Google Cloud Platform", - "path": "googlecompute", - "repo": "hashicorp/packer-plugin-googlecompute", - "version": "latest", - "isHcpPackerReady": true - }, { "title": "Gridscale", "path": "gridscale", @@ -108,49 +37,6 @@ "pluginTier": "verified", "isHcpPackerReady": false }, - { - "title": "HashiCups", - "path": "hashicups", - "repo": "hashicorp/packer-plugin-hashicups", - "version": "latest", - "isHcpPackerReady": false - }, - { - "title": "Hetzner Cloud", - "path": "hetzner-cloud", - "repo": "hashicorp/packer-plugin-hcloud", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "HyperOne", - "path": "hyperone", - "repo": "hashicorp/packer-plugin-hyperone", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "Hyper-V", - "path": "hyperv", - "repo": "hashicorp/packer-plugin-hyperv", - "version": "latest", - "pluginTier": "community" - }, - { - "title": "InSpec", - "path": "inspec", - "repo": "hashicorp/packer-plugin-inspec", - "pluginTier": "community", - "version": "latest", - "archived": true - }, - { - "title": "JD Cloud", - "path": "jdcloud", - "repo": "hashicorp/packer-plugin-jdcloud", - "pluginTier": "community", - "version": "latest" - }, { "title": "Kamatera", "path": "kamatera", @@ -173,20 +59,6 @@ "pluginTier": "community", "version": "latest" }, - { - "title": "LXC", - "path": "lxc", - "repo": "hashicorp/packer-plugin-lxc", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "LXD", - "path": "lxd", - "repo": "hashicorp/packer-plugin-lxd", - "pluginTier": "community", - "version": "latest" - }, { "title": "Mondoo", "path": "mondoo", @@ -194,13 +66,6 @@ "pluginTier": "verified", "version": "latest" }, - { - "title": "Naver Cloud", - "path": "ncloud", - "repo": "hashicorp/packer-plugin-ncloud", - "pluginTier": "community", - "version": "latest" - }, { "title": "Nutanix", "path": "nutanix", @@ -209,21 +74,6 @@ "pluginTier": "verified", "sourceBranch": "main" }, - { - "title": "OpenStack", - "path": "openstack", - "repo": "hashicorp/packer-plugin-openstack", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Oracle", - "path": "oracle", - "repo": "hashicorp/packer-plugin-oracle", - "pluginTier": "community", - "version": "latest", - "isHcpPackerReady": true - }, { "title": "Outscale", "path": "outscale", @@ -239,42 +89,6 @@ "version": "latest", "pluginTier": "verified" }, - { - "title": "Profitbricks", - "path": "profitbricks", - "repo": "hashicorp/packer-plugin-profitbricks", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Proxmox", - "path": "proxmox", - "repo": "hashicorp/packer-plugin-proxmox", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Puppet", - "path": "puppet", - "repo": "hashicorp/packer-plugin-puppet", - "version": "latest", - "pluginTier": "community", - "archived": true - }, - { - "title": "QEMU", - "path": "qemu", - "repo": "hashicorp/packer-plugin-qemu", - "version": "latest" - }, - { - "title": "Salt", - "path": "salt", - "repo": "hashicorp/packer-plugin-salt", - "pluginTier": "community", - "version": "latest", - "archived": true - }, { "title": "Scaleway", "path": "scaleway", @@ -296,20 +110,6 @@ "pluginTier": "community", "version": "latest" }, - { - "title": "Tencent Cloud", - "path": "tencentcloud", - "repo": "hashicorp/packer-plugin-tencentcloud", - "pluginTier": "community", - "version": "latest" - }, - { - "title": "Triton", - "path": "triton", - "repo": "hashicorp/packer-plugin-triton", - "pluginTier": "community", - "version": "latest" - }, { "title": "UCloud", "path": "ucloud", @@ -326,20 +126,6 @@ "sourceBranch": "master", "isHcpPackerReady": true }, - { - "title": "Vagrant", - "path": "vagrant", - "repo": "hashicorp/packer-plugin-vagrant", - "pluginTier": "official", - "version": "latest" - }, - { - "title": "VirtualBox", - "path": "virtualbox", - "repo": "hashicorp/packer-plugin-virtualbox", - "pluginTier": "official", - "version": "latest" - }, { "title": "Volcengine", "path": "volcengine", @@ -347,19 +133,6 @@ "pluginTier": "community", "version": "latest" }, - { - "title": "VMware vSphere", - "path": "vsphere", - "repo": "hashicorp/packer-plugin-vsphere", - "version": "latest", - "isHcpPackerReady": true - }, - { - "title": "VMware", - "path": "vmware", - "repo": "hashicorp/packer-plugin-vmware", - "version": "latest" - }, { "title": "Vultr", "path": "vultr", @@ -367,13 +140,6 @@ "pluginTier": "community", "version": "latest" }, - { - "title": "Yandex", - "path": "yandex", - "repo": "hashicorp/packer-plugin-yandex", - "version": "latest", - "pluginTier": "community" - }, { "title": "Ksyun", "path": "ksyun", From 324e628b86ef850bd12994586c1e2c850d986694 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 21 Sep 2023 13:14:19 +0800 Subject: [PATCH 80/92] chore: unnecessary use of fmt.Sprintf Signed-off-by: guoguangwu --- builder/null/artifact_export.go | 4 +--- command/build_parallel_test.go | 7 +++---- hcl2template/types.datasource.go | 4 ++-- provisioner/breakpoint/provisioner.go | 3 +-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/builder/null/artifact_export.go b/builder/null/artifact_export.go index 8b12610f81b..5a685629072 100644 --- a/builder/null/artifact_export.go +++ b/builder/null/artifact_export.go @@ -4,8 +4,6 @@ package null import ( - "fmt" - registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" ) @@ -26,7 +24,7 @@ func (*NullArtifact) Id() string { } func (a *NullArtifact) String() string { - return fmt.Sprintf("Did not export anything. This is the null builder") + return "Did not export anything. This is the null builder" } func (a *NullArtifact) State(name string) interface{} { diff --git a/command/build_parallel_test.go b/command/build_parallel_test.go index 4758505241b..4bebc65cee8 100644 --- a/command/build_parallel_test.go +++ b/command/build_parallel_test.go @@ -6,7 +6,6 @@ package command import ( "bytes" "context" - "fmt" "path/filepath" "sync" "testing" @@ -101,7 +100,7 @@ func TestBuildParallel_1(t *testing.T) { } args := []string{ - fmt.Sprintf("-parallel-builds=10"), + "-parallel-builds=10", filepath.Join(testFixture("parallel"), "1lock-5wg.json"), } @@ -130,7 +129,7 @@ func TestBuildParallel_2(t *testing.T) { } args := []string{ - fmt.Sprintf("-parallel-builds=3"), + "-parallel-builds=3", filepath.Join(testFixture("parallel"), "2lock-4wg.json"), } @@ -159,7 +158,7 @@ func TestBuildParallel_Timeout(t *testing.T) { } args := []string{ - fmt.Sprintf("-parallel-builds=3"), + "-parallel-builds=3", filepath.Join(testFixture("parallel"), "2lock-timeout.json"), } diff --git a/hcl2template/types.datasource.go b/hcl2template/types.datasource.go index 8ac2c160827..348d06f452c 100644 --- a/hcl2template/types.datasource.go +++ b/hcl2template/types.datasource.go @@ -45,7 +45,7 @@ func (ds *Datasources) Values() (map[string]cty.Value, hcl.Diagnostics) { for ref, datasource := range *ds { if datasource.value == (cty.Value{}) { diags = append(diags, &hcl.Diagnostic{ - Summary: fmt.Sprintf("empty value"), + Summary: "empty value", Subject: &datasource.block.DefRange, Severity: hcl.DiagError, }) @@ -73,7 +73,7 @@ func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, diags = append(diags, &hcl.Diagnostic{ Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, Subject: block.LabelRanges[0].Ptr(), - Detail: fmt.Sprintf("packer does not currently know any data source."), + Detail: "packer does not currently know any data source.", Severity: hcl.DiagError, }) return nil, diags diff --git a/provisioner/breakpoint/provisioner.go b/provisioner/breakpoint/provisioner.go index 9675ddff0d3..9ac6e340fb2 100644 --- a/provisioner/breakpoint/provisioner.go +++ b/provisioner/breakpoint/provisioner.go @@ -67,8 +67,7 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe ui.Say("Pausing at breakpoint provisioner.") } - message := fmt.Sprintf( - "Press enter to continue.") + message := "Press enter to continue." var g errgroup.Group result := make(chan string, 1) From 7eb6a45cd483af4236645f75ca83623aa127f929 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 22 Sep 2023 15:44:03 +0800 Subject: [PATCH 81/92] chore: remove refs to deprecated io/ioutil Signed-off-by: guoguangwu --- acctest/plugin/component_acc_test.go | 4 +-- acctest/plugin/plugin_acc_test.go | 4 +-- acctest/testing.go | 6 ++-- builder/file/builder.go | 3 +- builder/file/builder_test.go | 6 ++-- cmd/ssh-keygen/main.go | 5 ++-- command/build_test.go | 5 ++-- command/command_test.go | 4 +-- command/fmt_test.go | 3 +- command/hcl2_upgrade_test.go | 5 ++-- command/utils_test.go | 5 ++-- config_test.go | 5 ++-- datasource/http/data.go | 4 +-- datasource/http/data_acc_test.go | 4 +-- hcl2template/formatter.go | 11 ++++--- hcl2template/formatter_test.go | 9 +++--- hcl2template/utils.go | 3 +- main.go | 5 ++-- packer/client_test.go | 3 +- packer/plugin-getter/github/getter.go | 5 ++-- packer/plugin-getter/plugins.go | 3 +- packer/plugin-getter/plugins_test.go | 5 ++-- packer/plugin_client.go | 3 +- packer/progressbar_test.go | 10 +++---- packer/testing.go | 6 ++-- .../checksum/post-processor_test.go | 4 +-- .../compress/post-processor_test.go | 18 ++++++------ post-processor/manifest/post-processor.go | 5 ++-- .../shell-local/post-processor_test.go | 9 +++--- provisioner/file/provisioner_test.go | 29 +++++++++---------- .../powershell/provisioner_acc_test.go | 4 +-- provisioner/powershell/provisioner_test.go | 17 +++++------ .../shell-local/provisioner_acc_test.go | 4 +-- provisioner/shell/provisioner_acc_test.go | 4 +-- provisioner/shell/provisioner_test.go | 9 +++--- provisioner/windows-shell/provisioner_test.go | 15 +++++----- scripts/generate-plugins.go | 3 +- 37 files changed, 112 insertions(+), 135 deletions(-) diff --git a/acctest/plugin/component_acc_test.go b/acctest/plugin/component_acc_test.go index 110d8d3765a..e78c77284c0 100644 --- a/acctest/plugin/component_acc_test.go +++ b/acctest/plugin/component_acc_test.go @@ -8,7 +8,7 @@ package plugin import ( _ "embed" "fmt" - "io/ioutil" + "io" "os" "os/exec" "testing" @@ -54,7 +54,7 @@ func TestAccInitAndBuildBasicAmazonAmiDatasource(t *testing.T) { } defer logs.Close() - logsBytes, err := ioutil.ReadAll(logs) + logsBytes, err := io.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } diff --git a/acctest/plugin/plugin_acc_test.go b/acctest/plugin/plugin_acc_test.go index 137fb394db4..6549b2129a3 100644 --- a/acctest/plugin/plugin_acc_test.go +++ b/acctest/plugin/plugin_acc_test.go @@ -8,7 +8,7 @@ package plugin import ( _ "embed" "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -58,7 +58,7 @@ func TestAccInitAndBuildBasicAmazonEbs(t *testing.T) { } defer logs.Close() - logsBytes, err := ioutil.ReadAll(logs) + logsBytes, err := io.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } diff --git a/acctest/testing.go b/acctest/testing.go index dbd877fb3d3..dd18be1a365 100644 --- a/acctest/testing.go +++ b/acctest/testing.go @@ -6,7 +6,7 @@ package acctest import ( "context" "fmt" - "io/ioutil" + "io" "log" "os" "strings" @@ -182,8 +182,8 @@ func Test(t TestT, c TestCase) { log.Printf("[DEBUG] Running 'test' build") ui := &packersdk.BasicUi{ Reader: os.Stdin, - Writer: ioutil.Discard, - ErrorWriter: ioutil.Discard, + Writer: io.Discard, + ErrorWriter: io.Discard, PB: &packersdk.NoopProgressTracker{}, } artifacts, err := build.Run(context.Background(), ui) diff --git a/builder/file/builder.go b/builder/file/builder.go index e9d9d8f9ebd..0f79c958fe8 100644 --- a/builder/file/builder.go +++ b/builder/file/builder.go @@ -12,7 +12,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "path/filepath" @@ -77,7 +76,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) } else { // We're going to write Contents; if it's empty we'll just create an // empty file. - err := ioutil.WriteFile(b.config.Target, []byte(b.config.Content), 0600) + err := os.WriteFile(b.config.Target, []byte(b.config.Content), 0600) if err != nil { return nil, err } diff --git a/builder/file/builder_test.go b/builder/file/builder_test.go index 80fc326bdf4..5248318a4dc 100644 --- a/builder/file/builder_test.go +++ b/builder/file/builder_test.go @@ -5,7 +5,7 @@ package file import ( "fmt" - "io/ioutil" + "os" "testing" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" @@ -33,7 +33,7 @@ func TestBuilderFileAcc_copy(t *testing.T) { } func checkContent(artifacts []packersdk.Artifact) error { - content, err := ioutil.ReadFile("contentTest.txt") + content, err := os.ReadFile("contentTest.txt") if err != nil { return err } @@ -45,7 +45,7 @@ func checkContent(artifacts []packersdk.Artifact) error { } func checkCopy(artifacts []packersdk.Artifact) error { - content, err := ioutil.ReadFile("copyTest.txt") + content, err := os.ReadFile("copyTest.txt") if err != nil { return err } diff --git a/cmd/ssh-keygen/main.go b/cmd/ssh-keygen/main.go index f47eca5791f..c29edf76e7e 100644 --- a/cmd/ssh-keygen/main.go +++ b/cmd/ssh-keygen/main.go @@ -5,7 +5,6 @@ package main import ( "flag" - "io/ioutil" "log" "os" "os/user" @@ -74,12 +73,12 @@ func main() { log.Fatalf("%s already exists.", cla.Filename) } log.Printf("Saving private key to %s", cla.Filename) - if err := ioutil.WriteFile(cla.Filename, keypair.Private, 0600); err != nil { + if err := os.WriteFile(cla.Filename, keypair.Private, 0600); err != nil { log.Fatal(err) } publicFilename := cla.Filename + ".pub" log.Printf("Saving public key to %s", publicFilename) - if err := ioutil.WriteFile(publicFilename, keypair.Public, 0644); err != nil { + if err := os.WriteFile(publicFilename, keypair.Public, 0644); err != nil { log.Fatal(err) } } diff --git a/command/build_test.go b/command/build_test.go index 00685e98dc7..de476fdb0c4 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -5,7 +5,6 @@ package command import ( "fmt" - "io/ioutil" "math" "os" "path/filepath" @@ -1009,9 +1008,9 @@ func (fc fileCheck) verify(t *testing.T, dir string) { } } for file, expectedContent := range fc.expectedContent { - content, err := ioutil.ReadFile(filepath.Join(dir, file)) + content, err := os.ReadFile(filepath.Join(dir, file)) if err != nil { - t.Fatalf("ioutil.ReadFile: %v", err) + t.Fatalf("os.ReadFile: %v", err) } if diff := cmp.Diff(expectedContent, string(content)); diff != "" { t.Errorf("content of %s differs: %s", file, diff) diff --git a/command/command_test.go b/command/command_test.go index fcbec5fb0a7..712e9300496 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -5,7 +5,7 @@ package command import ( "bytes" - "io/ioutil" + "os" "path/filepath" "testing" @@ -27,7 +27,7 @@ func fatalCommand(t *testing.T, m Meta) { func testFixtureContent(n ...string) string { path := filepath.Join(append([]string{fixturesDir}, n...)...) - b, err := ioutil.ReadFile(path) + b, err := os.ReadFile(path) if err != nil { panic(err) } diff --git a/command/fmt_test.go b/command/fmt_test.go index 8fd058b379b..7d9f3b11979 100644 --- a/command/fmt_test.go +++ b/command/fmt_test.go @@ -6,7 +6,6 @@ package command import ( "bytes" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -128,7 +127,7 @@ func TestFmt_Recursive(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tempDirectory := mustString(ioutil.TempDir(testDir, "test-dir-*")) + tempDirectory := mustString(os.MkdirTemp(testDir, "test-dir-*")) defer os.RemoveAll(tempDirectory) createFiles(tempDirectory, tt.alreadyPresentContent) diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index f0ffc7676f2..487d99999cb 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -4,7 +4,6 @@ package command import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -64,8 +63,8 @@ func Test_hcl2_upgrade(t *testing.T) { if tc.exitEarly { return } - expected := string(mustBytes(ioutil.ReadFile(expectedPath))) - actual := string(mustBytes(ioutil.ReadFile(outputPath))) + expected := string(mustBytes(os.ReadFile(expectedPath))) + actual := string(mustBytes(os.ReadFile(outputPath))) if diff := cmp.Diff(expected, actual); diff != "" { t.Fatalf("unexpected output: %s", diff) diff --git a/command/utils_test.go b/command/utils_test.go index 6af1f2c4881..cf5e2dbe3e7 100644 --- a/command/utils_test.go +++ b/command/utils_test.go @@ -4,7 +4,6 @@ package command import ( - "io/ioutil" "log" "os" "path/filepath" @@ -23,7 +22,7 @@ func createFiles(dir string, content map[string]string) { if err := os.MkdirAll(filepath.Dir(contentPath), 0777); err != nil { panic(err) } - if err := ioutil.WriteFile(contentPath, []byte(content), 0666); err != nil { + if err := os.WriteFile(contentPath, []byte(content), 0666); err != nil { panic(err) } log.Printf("created tmp file: %s", contentPath) @@ -39,7 +38,7 @@ func (c *configDirSingleton) dir(key string) string { if v, exists := c.dirs[key]; exists { return v } - c.dirs[key] = mustString(ioutil.TempDir("", "pkr-test-cfg-dir-"+key)) + c.dirs[key] = mustString(os.MkdirTemp("", "pkr-test-cfg-dir-"+key)) return c.dirs[key] } diff --git a/config_test.go b/config_test.go index 1a583a8c3a7..ac101010c3c 100644 --- a/config_test.go +++ b/config_test.go @@ -6,7 +6,6 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" "reflect" @@ -122,7 +121,7 @@ func TestLoadExternalComponentsFromConfig_onlyProvisioner(t *testing.T) { func TestLoadSingleComponent(t *testing.T) { // .exe will work everyone for testing purpose, but mostly here to help Window's test runs. - tmpFile, err := ioutil.TempFile(".", "packer-builder-*.exe") + tmpFile, err := os.CreateTemp(".", "packer-builder-*.exe") if err != nil { t.Fatalf("failed to create test file with error: %s", err) } @@ -160,7 +159,7 @@ func TestLoadSingleComponent(t *testing.T) { } func generateFakePlugins(dirname string, pluginNames []string) (string, []string, func(), error) { - dir, err := ioutil.TempDir("", dirname) + dir, err := os.MkdirTemp("", dirname) if err != nil { return "", nil, nil, fmt.Errorf("failed to create temporary test directory: %v", err) } diff --git a/datasource/http/data.go b/datasource/http/data.go index ef77adca2ba..58dec04c35b 100644 --- a/datasource/http/data.go +++ b/datasource/http/data.go @@ -8,7 +8,7 @@ package http import ( "context" "fmt" - "io/ioutil" + "io" "mime" "net/http" "regexp" @@ -137,7 +137,7 @@ func (d *Datasource) Execute() (cty.Value, error) { fmt.Println("If the content is binary data, Packer may not properly handle the contents of the response.") } - bytes, err := ioutil.ReadAll(resp.Body) + bytes, err := io.ReadAll(resp.Body) // TODO: How to make test case for this? if err != nil { fmt.Println("Error processing response body of call") diff --git a/datasource/http/data_acc_test.go b/datasource/http/data_acc_test.go index c5a92718e67..fdf680b8298 100644 --- a/datasource/http/data_acc_test.go +++ b/datasource/http/data_acc_test.go @@ -6,7 +6,7 @@ package http import ( _ "embed" "fmt" - "io/ioutil" + "io" "os" "os/exec" "regexp" @@ -84,7 +84,7 @@ func TestHttpDataSource(t *testing.T) { } defer logs.Close() - logsBytes, err := ioutil.ReadAll(logs) + logsBytes, err := io.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } diff --git a/hcl2template/formatter.go b/hcl2template/formatter.go index 5505cde4052..c04bb114748 100644 --- a/hcl2template/formatter.go +++ b/hcl2template/formatter.go @@ -7,7 +7,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -76,7 +75,7 @@ func (f *HCL2Formatter) Format(path string) (int, hcl.Diagnostics) { return f.formatFile(path, diags, bytesModified) } - fileInfos, err := ioutil.ReadDir(path) + fileInfos, err := os.ReadDir(path) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -129,7 +128,7 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { } } - inSrc, err := ioutil.ReadAll(in) + inSrc, err := io.ReadAll(in) if err != nil { return nil, fmt.Errorf("failed to read %s: %s", filename, err) } @@ -158,7 +157,7 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { if filename == "-" { _, _ = f.Output.Write(outSrc) } else { - if err := ioutil.WriteFile(filename, outSrc, 0644); err != nil { + if err := os.WriteFile(filename, outSrc, 0644); err != nil { return nil, err } } @@ -178,14 +177,14 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { // bytesDiff returns the unified diff of b1 and b2 // Shamelessly copied from Terraform's fmt command. func bytesDiff(b1, b2 []byte, path string) (data []byte, err error) { - f1, err := ioutil.TempFile("", "") + f1, err := os.CreateTemp("", "") if err != nil { return } defer os.Remove(f1.Name()) defer f1.Close() - f2, err := ioutil.TempFile("", "") + f2, err := os.CreateTemp("", "") if err != nil { return } diff --git a/hcl2template/formatter_test.go b/hcl2template/formatter_test.go index 07febb6f439..8cb909292a9 100644 --- a/hcl2template/formatter_test.go +++ b/hcl2template/formatter_test.go @@ -5,7 +5,6 @@ package hcl2template import ( "bytes" - "io/ioutil" "os" "os/exec" "strings" @@ -48,12 +47,12 @@ func TestHCL2Formatter_Format_Write(t *testing.T) { f.Output = &buf f.Write = true - unformattedData, err := ioutil.ReadFile("testdata/format/unformatted.pkr.hcl") + unformattedData, err := os.ReadFile("testdata/format/unformatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the unformatted fixture %s", err) } - tf, err := ioutil.TempFile("", "*.pkr.hcl") + tf, err := os.CreateTemp("", "*.pkr.hcl") if err != nil { t.Fatalf("failed to create tempfile for test %s", err) } @@ -68,12 +67,12 @@ func TestHCL2Formatter_Format_Write(t *testing.T) { } //lets re-read the tempfile which should now be formatted - data, err := ioutil.ReadFile(tf.Name()) + data, err := os.ReadFile(tf.Name()) if err != nil { t.Fatalf("failed to open the newly formatted fixture %s", err) } - formattedData, err := ioutil.ReadFile("testdata/format/formatted.pkr.hcl") + formattedData, err := os.ReadFile("testdata/format/formatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the formatted fixture %s", err) } diff --git a/hcl2template/utils.go b/hcl2template/utils.go index dc2399a1034..98546a95456 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -5,7 +5,6 @@ package hcl2template import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -74,7 +73,7 @@ func GetHCL2Files(filename, hclSuffix, jsonSuffix string) (hclFiles, jsonFiles [ return nil, nil, diags } - fileInfos, err := ioutil.ReadDir(filename) + fileInfos, err := os.ReadDir(filename) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, diff --git a/main.go b/main.go index 834d040409a..fe902f5bdb3 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,6 @@ package main import ( "fmt" "io" - "io/ioutil" "log" "math/rand" "os" @@ -65,13 +64,13 @@ func realMain() int { return 1 } if logWriter == nil { - logWriter = ioutil.Discard + logWriter = io.Discard } packersdk.LogSecretFilter.SetOutput(logWriter) // Disable logging here - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) // We always send logs to a temporary file that we use in case // there is a panic. Otherwise, we delete it. diff --git a/packer/client_test.go b/packer/client_test.go index f0dc074e997..c914a3edaed 100644 --- a/packer/client_test.go +++ b/packer/client_test.go @@ -5,7 +5,6 @@ package packer import ( "bytes" - "io/ioutil" "os" "strings" "testing" @@ -102,7 +101,7 @@ func TestClient_Stderr(t *testing.T) { func TestClient_Stdin(t *testing.T) { // Overwrite stdin for this test with a temporary file - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("err: %s", err) } diff --git a/packer/plugin-getter/github/getter.go b/packer/plugin-getter/github/getter.go index bde61e51641..a4942a42163 100644 --- a/packer/plugin-getter/github/getter.go +++ b/packer/plugin-getter/github/getter.go @@ -11,7 +11,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "net/http" "os" @@ -71,7 +70,7 @@ func transformChecksumStream() func(in io.ReadCloser) (io.ReadCloser, error) { } } _, _ = buffer.WriteString("]") - return ioutil.NopCloser(buffer), nil + return io.NopCloser(buffer), nil } } @@ -103,7 +102,7 @@ func transformVersionStream(in io.ReadCloser) (io.ReadCloser, error) { return nil, err } - return ioutil.NopCloser(buf), nil + return io.NopCloser(buf), nil } // HostSpecificTokenAuthTransport makes sure the http roundtripper only sets an diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index 92f7e28a8e7..f6ca5c4abfe 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -9,7 +9,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -714,7 +713,7 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) log.Printf("[WARNING] %v, ignoring", err) } - if err := ioutil.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0555); err != nil { + if err := os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0555); err != nil { err := fmt.Errorf("failed to write local binary checksum file: %s", err) errs = multierror.Append(errs, err) log.Printf("[WARNING] %v, ignoring", err) diff --git a/packer/plugin-getter/plugins_test.go b/packer/plugin-getter/plugins_test.go index 7a1439de210..dfb28767067 100644 --- a/packer/plugin-getter/plugins_test.go +++ b/packer/plugin-getter/plugins_test.go @@ -10,7 +10,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -754,7 +753,7 @@ func (g *mockPluginGetter) Get(what string, options GetOptions) (io.ReadCloser, panic(err) } }() - return ioutil.NopCloser(read), nil + return io.NopCloser(read), nil } func zipFile(content map[string]string) io.ReadCloser { @@ -778,7 +777,7 @@ func zipFile(content map[string]string) io.ReadCloser { if err != nil { panic(err) } - return ioutil.NopCloser(buff) + return io.NopCloser(buff) } var _ Getter = &mockPluginGetter{} diff --git a/packer/plugin_client.go b/packer/plugin_client.go index b788f68f7fb..01e899e2813 100644 --- a/packer/plugin_client.go +++ b/packer/plugin_client.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "net" "os" @@ -114,7 +113,7 @@ func NewClient(config *PluginClientConfig) (c *PluginClient) { } if config.Stderr == nil { - config.Stderr = ioutil.Discard + config.Stderr = io.Discard } c = &PluginClient{config: config} diff --git a/packer/progressbar_test.go b/packer/progressbar_test.go index 96ff65d687b..20edc07c9b2 100644 --- a/packer/progressbar_test.go +++ b/packer/progressbar_test.go @@ -5,7 +5,7 @@ package packer import ( "bytes" - "io/ioutil" + "io" "testing" "golang.org/x/sync/errgroup" @@ -16,10 +16,10 @@ import ( func TestProgressTracking_open_close(t *testing.T) { var bar *UiProgressBar - tracker := bar.TrackProgress("1,", 1, 42, ioutil.NopCloser(nil)) + tracker := bar.TrackProgress("1,", 1, 42, io.NopCloser(nil)) tracker.Close() - tracker = bar.TrackProgress("2,", 1, 42, ioutil.NopCloser(nil)) + tracker = bar.TrackProgress("2,", 1, 42, io.NopCloser(nil)) tracker.Close() } @@ -29,7 +29,7 @@ func TestProgressTracking_multi_open_close(t *testing.T) { for i := 0; i < 100; i++ { g.Go(func() error { - tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(nil)) + tracker := bar.TrackProgress("file,", 1, 42, io.NopCloser(nil)) return tracker.Close() }) } @@ -46,7 +46,7 @@ func TestProgressTracking_races(t *testing.T) { g.Go(func() error { txt := []byte("foobarbaz dolores") b := bytes.NewReader(txt) - tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(b)) + tracker := bar.TrackProgress("file,", 1, 42, io.NopCloser(b)) for i := 0; i < 42; i++ { tracker.Read([]byte("i")) diff --git a/packer/testing.go b/packer/testing.go index faa3c58283e..b0ebc04b95f 100644 --- a/packer/testing.go +++ b/packer/testing.go @@ -5,7 +5,7 @@ package packer import ( "bytes" - "io/ioutil" + "io" "testing" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" @@ -40,8 +40,8 @@ func TestUi(t *testing.T) packersdk.Ui { var buf bytes.Buffer return &packersdk.BasicUi{ Reader: &buf, - Writer: ioutil.Discard, - ErrorWriter: ioutil.Discard, + Writer: io.Discard, + ErrorWriter: io.Discard, } } diff --git a/post-processor/checksum/post-processor_test.go b/post-processor/checksum/post-processor_test.go index 62c2f2ae3e1..6a08f029735 100644 --- a/post-processor/checksum/post-processor_test.go +++ b/post-processor/checksum/post-processor_test.go @@ -7,7 +7,7 @@ import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "os" "strings" "testing" @@ -38,7 +38,7 @@ func TestChecksumSHA1(t *testing.T) { if err != nil { t.Errorf("Unable to read checksum file: %s", err) } - if buf, _ := ioutil.ReadAll(f); !bytes.Equal(buf, []byte("d3486ae9136e7856bc42212385ea797094475802\tpackage.txt\n")) { + if buf, _ := io.ReadAll(f); !bytes.Equal(buf, []byte("d3486ae9136e7856bc42212385ea797094475802\tpackage.txt\n")) { t.Errorf("Failed to compute checksum: %s\n%s", buf, "d3486ae9136e7856bc42212385ea797094475802 package.txt") } diff --git a/post-processor/compress/post-processor_test.go b/post-processor/compress/post-processor_test.go index e85b2041062..885388c79e8 100644 --- a/post-processor/compress/post-processor_test.go +++ b/post-processor/compress/post-processor_test.go @@ -9,7 +9,7 @@ import ( "compress/gzip" "context" "fmt" - "io/ioutil" + "io" "os" "strings" "testing" @@ -84,7 +84,7 @@ func TestCompressOptions(t *testing.T) { filename := "package.gz" archive, _ := os.Open(filename) gzipReader, _ := gzip.NewReader(archive) - data, _ := ioutil.ReadAll(gzipReader) + data, _ := io.ReadAll(gzipReader) if string(data) != expectedFileContents { t.Errorf("Expected:\n%s\nFound:\n%s\n", expectedFileContents, data) @@ -115,7 +115,7 @@ func TestCompressInterpolation(t *testing.T) { } gzipReader, _ := gzip.NewReader(archive) - data, _ := ioutil.ReadAll(gzipReader) + data, _ := io.ReadAll(gzipReader) if string(data) != expectedFileContents { t.Errorf("Expected:\n%s\nFound:\n%s\n", expectedFileContents, data) @@ -194,7 +194,7 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(bzipReader) + return io.ReadAll(bzipReader) }, "zip": func(archive *os.File) ([]byte, error) { fi, _ := archive.Stat() @@ -206,7 +206,7 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(ctt) + return io.ReadAll(ctt) }, "tar": func(archive *os.File) ([]byte, error) { tarReader := tar.NewReader(archive) @@ -214,7 +214,7 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(tarReader) + return io.ReadAll(tarReader) }, "tar.gz": func(archive *os.File) ([]byte, error) { gzipReader, err := gzip.NewReader(archive) @@ -226,15 +226,15 @@ func TestArchive(t *testing.T) { if err != nil { return nil, err } - return ioutil.ReadAll(tarReader) + return io.ReadAll(tarReader) }, "gz": func(archive *os.File) ([]byte, error) { gzipReader, _ := gzip.NewReader(archive) - return ioutil.ReadAll(gzipReader) + return io.ReadAll(gzipReader) }, "lz4": func(archive *os.File) ([]byte, error) { lz4Reader := lz4.NewReader(archive) - return ioutil.ReadAll(lz4Reader) + return io.ReadAll(lz4Reader) }, } diff --git a/post-processor/manifest/post-processor.go b/post-processor/manifest/post-processor.go index 5fb90c45577..74f203525d9 100644 --- a/post-processor/manifest/post-processor.go +++ b/post-processor/manifest/post-processor.go @@ -10,7 +10,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "log" "os" "path/filepath" @@ -143,7 +142,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source // Read the current manifest file from disk contents := []byte{} - if contents, err = ioutil.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) { + if contents, err = os.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) { return source, true, true, fmt.Errorf("Unable to open %s for reading: %s", p.config.OutputPath, err) } @@ -167,7 +166,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source // Write JSON to disk if out, err := json.MarshalIndent(manifestFile, "", " "); err == nil { - if err = ioutil.WriteFile(p.config.OutputPath, out, 0664); err != nil { + if err = os.WriteFile(p.config.OutputPath, out, 0664); err != nil { return source, true, true, fmt.Errorf("Unable to write %s: %s", p.config.OutputPath, err) } } else { diff --git a/post-processor/shell-local/post-processor_test.go b/post-processor/shell-local/post-processor_test.go index 39fbec25ec3..13121658af2 100644 --- a/post-processor/shell-local/post-processor_test.go +++ b/post-processor/shell-local/post-processor_test.go @@ -4,7 +4,6 @@ package shell_local import ( - "io/ioutil" "os" "runtime" "testing" @@ -95,7 +94,7 @@ func TestPostProcessorPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -163,7 +162,7 @@ func TestPostProcessorPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -182,7 +181,7 @@ func TestPostProcessorPrepare_ScriptAndScripts(t *testing.T) { raws := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -208,7 +207,7 @@ func TestPostProcessorPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/provisioner/file/provisioner_test.go b/provisioner/file/provisioner_test.go index 17d55d75d2b..280afa0250a 100644 --- a/provisioner/file/provisioner_test.go +++ b/provisioner/file/provisioner_test.go @@ -6,7 +6,6 @@ package file import ( "bytes" "context" - "io/ioutil" "os" "path/filepath" "regexp" @@ -62,7 +61,7 @@ func TestProvisionerPrepare_InvalidSource(t *testing.T) { func TestProvisionerPrepare_ValidSource(t *testing.T) { var p Provisioner - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -107,7 +106,7 @@ func TestProvisionerPrepare_EmptyDestination(t *testing.T) { func TestProvisionerProvision_SendsFile(t *testing.T) { var p Provisioner - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -195,7 +194,7 @@ func TestProvisionerProvision_SendsContent(t *testing.T) { func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { var p Provisioner - tf1, err := ioutil.TempFile("", "packer") + tf1, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -205,7 +204,7 @@ func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := ioutil.TempFile("", "packer") + tf2, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -248,13 +247,13 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { var p Provisioner // Prepare the first directory - td1, err := ioutil.TempDir("", "packerdir") + td1, err := os.MkdirTemp("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td1) - tf1, err := ioutil.TempFile(td1, "packer") + tf1, err := os.CreateTemp(td1, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -264,13 +263,13 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { } // Prepare the second directory - td2, err := ioutil.TempDir("", "packerdir") + td2, err := os.MkdirTemp("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td2) - tf2, err := ioutil.TempFile(td2, "packer") + tf2, err := os.CreateTemp(td2, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -317,7 +316,7 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { var p Provisioner - tf1, err := ioutil.TempFile("", "packer") + tf1, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -327,7 +326,7 @@ func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := ioutil.TempFile("", "packer") + tf2, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -388,7 +387,7 @@ func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { var p Provisioner - tf1, err := ioutil.TempFile("", "packer") + tf1, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -398,7 +397,7 @@ func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := ioutil.TempFile("", "packer") + tf2, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -454,12 +453,12 @@ func TestProvisionDownloadMkdirAll(t *testing.T) { {"path/to/dir"}, {"path/to/dir/"}, } - tmpDir, err := ioutil.TempDir("", "packer-file") + tmpDir, err := os.MkdirTemp("", "packer-file") if err != nil { t.Fatalf("error tempdir: %s", err) } defer os.RemoveAll(tmpDir) - tf, err := ioutil.TempFile(tmpDir, "packer") + tf, err := os.CreateTemp(tmpDir, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/provisioner/powershell/provisioner_acc_test.go b/provisioner/powershell/provisioner_acc_test.go index 8340b2a5a87..8073d011334 100644 --- a/provisioner/powershell/provisioner_acc_test.go +++ b/provisioner/powershell/provisioner_acc_test.go @@ -5,7 +5,7 @@ package powershell_test import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -35,7 +35,7 @@ func LoadProvisionerFragment(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := ioutil.ReadAll(fragmentFile) + fragmentString, err := io.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } diff --git a/provisioner/powershell/provisioner_test.go b/provisioner/powershell/provisioner_test.go index 0d8b4ca35cd..024b0585fa2 100644 --- a/provisioner/powershell/provisioner_test.go +++ b/provisioner/powershell/provisioner_test.go @@ -7,7 +7,6 @@ import ( "bytes" "context" "fmt" - "io/ioutil" "os" "regexp" "strings" @@ -35,7 +34,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) { } // File contents should contain 2 lines concatenated by newlines: foo\nbar - readFile, err := ioutil.ReadFile(file) + readFile, err := os.ReadFile(file) expectedContents := "foo\nbar\n" if err != nil { t.Fatalf("Should not be error: %s", err) @@ -187,7 +186,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -214,7 +213,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -234,7 +233,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -261,7 +260,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -512,7 +511,7 @@ func TestProvisionerProvision_Inline(t *testing.T) { } func TestProvisionerProvision_Scripts(t *testing.T) { - tempFile, _ := ioutil.TempFile("", "packer") + tempFile, _ := os.CreateTemp("", "packer") defer os.Remove(tempFile.Name()) defer tempFile.Close() @@ -542,7 +541,7 @@ func TestProvisionerProvision_Scripts(t *testing.T) { } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { - tempFile, _ := ioutil.TempFile("", "packer") + tempFile, _ := os.CreateTemp("", "packer") ui := testUi() defer os.Remove(tempFile.Name()) defer tempFile.Close() @@ -579,7 +578,7 @@ func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { } func TestProvisionerProvision_SkipClean(t *testing.T) { - tempFile, _ := ioutil.TempFile("", "packer") + tempFile, _ := os.CreateTemp("", "packer") defer func() { tempFile.Close() os.Remove(tempFile.Name()) diff --git a/provisioner/shell-local/provisioner_acc_test.go b/provisioner/shell-local/provisioner_acc_test.go index b7b7c051a14..1f1b37a0cb8 100644 --- a/provisioner/shell-local/provisioner_acc_test.go +++ b/provisioner/shell-local/provisioner_acc_test.go @@ -5,7 +5,7 @@ package shell_test import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -31,7 +31,7 @@ func loadFile(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := ioutil.ReadAll(fragmentFile) + fragmentString, err := io.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } diff --git a/provisioner/shell/provisioner_acc_test.go b/provisioner/shell/provisioner_acc_test.go index 4eefa19e78a..167456d274a 100644 --- a/provisioner/shell/provisioner_acc_test.go +++ b/provisioner/shell/provisioner_acc_test.go @@ -5,7 +5,7 @@ package shell_test import ( "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -31,7 +31,7 @@ func loadFile(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := ioutil.ReadAll(fragmentFile) + fragmentString, err := io.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } diff --git a/provisioner/shell/provisioner_test.go b/provisioner/shell/provisioner_test.go index 5640c92425e..40da9b5ea2b 100644 --- a/provisioner/shell/provisioner_test.go +++ b/provisioner/shell/provisioner_test.go @@ -4,7 +4,6 @@ package shell import ( - "io/ioutil" "os" "regexp" "strings" @@ -123,7 +122,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -149,7 +148,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -168,7 +167,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -194,7 +193,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/provisioner/windows-shell/provisioner_test.go b/provisioner/windows-shell/provisioner_test.go index 5ef92c64ac0..08990b00ae7 100644 --- a/provisioner/windows-shell/provisioner_test.go +++ b/provisioner/windows-shell/provisioner_test.go @@ -6,7 +6,6 @@ package shell import ( "bytes" "context" - "io/ioutil" "log" "os" "strings" @@ -37,7 +36,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) { } // File contents should contain 2 lines concatenated by newlines: foo\nbar - readFile, err := ioutil.ReadFile(file) + readFile, err := os.ReadFile(file) if err != nil { t.Fatalf("Should not be error: %s", err) } @@ -102,7 +101,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -129,7 +128,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -149,7 +148,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -176,7 +175,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -325,7 +324,7 @@ func TestProvisionerProvision_Inline(t *testing.T) { } func TestProvisionerProvision_Scripts(t *testing.T) { - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -357,7 +356,7 @@ func TestProvisionerProvision_Scripts(t *testing.T) { } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { - tf, err := ioutil.TempFile("", "packer") + tf, err := os.CreateTemp("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } diff --git a/scripts/generate-plugins.go b/scripts/generate-plugins.go index bd303cb29ba..7390fafa070 100755 --- a/scripts/generate-plugins.go +++ b/scripts/generate-plugins.go @@ -12,7 +12,6 @@ import ( "go/ast" "go/parser" "go/token" - "io/ioutil" "log" "os" "path/filepath" @@ -142,7 +141,7 @@ func makeImports(builders, provisioners, postProcessors, Datasources []plugin) s // listDirectories recursively lists directories under the specified path func listDirectories(path string) ([]string, error) { names := []string{} - items, err := ioutil.ReadDir(path) + items, err := os.ReadDir(path) if err != nil { return names, err } From d56db70a577aa7f37e3225e2ae99629231d08128 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Sun, 30 Jul 2023 19:19:14 +0800 Subject: [PATCH 82/92] Bump github.com/pierrec/lz4 to v4.1.18 --- go.mod | 3 ++- go.sum | 2 ++ post-processor/compress/benchmark.go | 4 +-- post-processor/compress/post-processor.go | 25 ++++++++++++++++--- .../compress/post-processor_test.go | 2 +- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index ab2d8edd000..f0b2dcbaa54 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/mitchellh/panicwrap v1.0.0 github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db // indirect - github.com/pierrec/lz4 v2.6.1+incompatible + github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pkg/sftp v1.13.2 // indirect github.com/posener/complete v1.2.3 github.com/stretchr/testify v1.8.2 @@ -70,6 +70,7 @@ require ( github.com/hashicorp/packer-plugin-vmware v1.0.7 github.com/hashicorp/packer-plugin-vsphere v1.1.1 github.com/oklog/ulid v1.3.1 + github.com/pierrec/lz4/v4 v4.1.18 github.com/shirou/gopsutil/v3 v3.23.4 ) diff --git a/go.sum b/go.sum index 81a0347bf5c..34f7c200dc5 100644 --- a/go.sum +++ b/go.sum @@ -643,6 +643,8 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/post-processor/compress/benchmark.go b/post-processor/compress/benchmark.go index 5d06b7d6448..e315f3bcf2d 100644 --- a/post-processor/compress/benchmark.go +++ b/post-processor/compress/benchmark.go @@ -18,7 +18,7 @@ import ( "github.com/biogo/hts/bgzf" "github.com/klauspost/pgzip" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" "github.com/ulikunitz/xz" ) @@ -190,7 +190,7 @@ func (c *Compressor) BenchmarkPGZIPReader(b *testing.B) { func (c *Compressor) BenchmarkLZ4Writer(b *testing.B) { cw := lz4.NewWriter(c.w) // cw.Header.HighCompression = true - cw.Header.NoChecksum = true + cw.Apply(lz4.ChecksumOption(false)) b.ResetTimer() _, err := io.Copy(cw, c.r) diff --git a/post-processor/compress/post-processor.go b/post-processor/compress/post-processor.go index 88b345a97d8..07a74e813d0 100644 --- a/post-processor/compress/post-processor.go +++ b/post-processor/compress/post-processor.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/packer-plugin-sdk/template/config" "github.com/hashicorp/packer-plugin-sdk/template/interpolate" "github.com/klauspost/pgzip" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" "github.com/ulikunitz/xz" ) @@ -333,8 +333,27 @@ func makeBZIP2Writer(output io.Writer, compressionLevel int) (io.WriteCloser, er func makeLZ4Writer(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { lzwriter := lz4.NewWriter(output) - if compressionLevel > 0 { - lzwriter.Header.CompressionLevel = compressionLevel + if compressionLevel < 0 { + return lzwriter, nil + } + levels := map[int]lz4.CompressionLevel{ + 0: lz4.Fast, + 1: lz4.Level1, + 2: lz4.Level2, + 3: lz4.Level3, + 4: lz4.Level4, + 5: lz4.Level5, + 6: lz4.Level6, + 7: lz4.Level7, + 8: lz4.Level8, + 9: lz4.Level9, + } + level, ok := levels[compressionLevel] + if !ok { + return nil, ErrInvalidCompressionLevel + } + if err := lzwriter.Apply(lz4.CompressionLevelOption(level)); err != nil { + return nil, err } return lzwriter, nil } diff --git a/post-processor/compress/post-processor_test.go b/post-processor/compress/post-processor_test.go index 885388c79e8..00b8a1377ca 100644 --- a/post-processor/compress/post-processor_test.go +++ b/post-processor/compress/post-processor_test.go @@ -18,7 +18,7 @@ import ( packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/template" "github.com/hashicorp/packer/builder/file" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" ) func TestDetectFilename(t *testing.T) { From c0e594738be27695fba13f2ad817554497b11885 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Wed, 27 Sep 2023 10:47:34 -0400 Subject: [PATCH 83/92] init: warn if no requirements specified When users call `packer init' on a template that does not specify a `required_plugin' block, the command succeeds but does nothing, which is not helpful for users that may expect their plugins to install. To remedy that problem, we now output a message like what `packer plugins required' does on templates without such a block, so that users have an idea of what to change in order to get the command to work. --- command/init.go | 8 +++++++ command/init_test.go | 53 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/command/init.go b/command/init.go index ad9a7bcdd98..709e8ab0fdf 100644 --- a/command/init.go +++ b/command/init.go @@ -66,6 +66,14 @@ func (c *InitCommand) RunContext(buildCtx context.Context, cla *InitArgs) int { return ret } + if len(reqs) == 0 { + c.Ui.Message(` +No plugins requirement found, make sure you reference a Packer config +containing a packer.required_plugins block. See +https://www.packer.io/docs/templates/hcl_templates/blocks/packer +for more info.`) + } + opts := plugingetter.ListInstallationsOptions{ FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ diff --git a/command/init_test.go b/command/init_test.go index 07246d50081..57ab1781d04 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -13,6 +13,7 @@ import ( "path/filepath" "runtime" "sort" + "strings" "testing" "github.com/google/go-cmp/cmp" @@ -414,3 +415,55 @@ func (opts initTestGoGetPlugin) fn(t *testing.T, _ testCaseInit) { t.Fatalf("get: %v", err) } } + +// TestInitCmd aims to test the init command, with output validation +func TestInitCmd(t *testing.T) { + tests := []struct { + name string + args []string + expectedCode int + outputCheck func(string, string) error + }{ + { + name: "Ensure init warns on template without required_plugin blocks", + args: []string{ + testFixture("hcl", "build-var-in-pp.pkr.hcl"), + }, + expectedCode: 0, + outputCheck: func(stdout, stderr string) error { + if !strings.Contains(stdout, "No plugins requirement found") { + return fmt.Errorf("command should warn about plugin requirements not found, but did not") + } + return nil + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &InitCommand{ + Meta: TestMetaFile(t), + } + + exitCode := c.Run(tt.args) + if exitCode != tt.expectedCode { + t.Errorf("process exit code mismatch: expected %d, got %d", + tt.expectedCode, + exitCode) + } + + out, stderr := GetStdoutAndErrFromTestMeta(t, c.Meta) + err := tt.outputCheck(out, stderr) + if err != nil { + if len(out) != 0 { + t.Logf("command stdout: %q", out) + } + + if len(stderr) != 0 { + t.Logf("command stderr: %q", stderr) + } + t.Error(err.Error()) + } + }) + } +} From 8490333f557e8a23f866afef93995f91e5d0faea Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Mon, 2 Oct 2023 06:50:04 -0400 Subject: [PATCH 84/92] Fix broken acctest for Amazon data source This change updates the Ubuntu image being from 16.04 to something more recent. --- .../plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl index b3c4696024d..7ff2d3127da 100644 --- a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl @@ -9,7 +9,7 @@ packer { data "amazon-ami" "test" { filters = { - name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*" + name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" root-device-type = "ebs" virtualization-type = "hvm" } From 8dcc6b9fd9af8d4f47a758fb18324858cdfd9996 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 3 Oct 2023 10:32:42 -0400 Subject: [PATCH 85/92] Bump Go tooling version to 1.20.8 --- .go-version | 2 +- go | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 go diff --git a/.go-version b/.go-version index 8909929f6e7..95393fc7d4d 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.7 +1.20.8 diff --git a/go b/go new file mode 100644 index 00000000000..e69de29bb2d From 4dbfd67ea95e9eea9778da7d7062b53fecbfe668 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 24 Aug 2023 15:29:11 -0400 Subject: [PATCH 86/92] hcl2template: remove unused shouldContinue bool Not sure why this was defined and returned, but the value was set, but never used, as such this is not useful to keep in the code, so let's simplify this now. --- hcl2template/types.packer_config.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 819107e86b3..9ef8de242e4 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -380,7 +380,7 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics // Now that most of our data sources have been started and executed, we can // try to execute the ones that depend on other data sources. for ref := range dependencies { - _, moreDiags, _ := cfg.recursivelyEvaluateDatasources(ref, dependencies, skipExecution, 0) + _, moreDiags := cfg.recursivelyEvaluateDatasources(ref, dependencies, skipExecution, 0) // Deduplicate diagnostics to prevent recursion messes. cleanedDiags := map[string]*hcl.Diagnostic{} for _, diag := range moreDiags { @@ -395,10 +395,9 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics return diags } -func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, dependencies map[DatasourceRef][]DatasourceRef, skipExecution bool, depth int) (map[DatasourceRef][]DatasourceRef, hcl.Diagnostics, bool) { +func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, dependencies map[DatasourceRef][]DatasourceRef, skipExecution bool, depth int) (map[DatasourceRef][]DatasourceRef, hcl.Diagnostics) { var diags hcl.Diagnostics var moreDiags hcl.Diagnostics - shouldContinue := true if depth > 10 { // Add a comment about recursion. @@ -410,7 +409,7 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen "other data sources, or your data sources have a cyclic " + "dependency. Please simplify your config to continue. ", }) - return dependencies, diags, false + return dependencies, diags } ds := cfg.Datasources[ref] @@ -421,11 +420,11 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen // If this dependency is not in the map, it means we've already // launched and executed this datasource. Otherwise, it means // we still need to run it. RECURSION TIME!! - dependencies, moreDiags, shouldContinue = cfg.recursivelyEvaluateDatasources(dep, dependencies, skipExecution, depth) + dependencies, moreDiags = cfg.recursivelyEvaluateDatasources(dep, dependencies, skipExecution, depth) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { diags = append(diags, moreDiags...) - return dependencies, diags, shouldContinue + return dependencies, diags } } } @@ -435,14 +434,14 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen datasource, startDiags := cfg.startDatasource(cfg.parser.PluginConfig.DataSources, ref, true) if startDiags.HasErrors() { diags = append(diags, startDiags...) - return dependencies, diags, shouldContinue + return dependencies, diags } if skipExecution { placeholderValue := cty.UnknownVal(hcldec.ImpliedType(datasource.OutputSpec())) ds.value = placeholderValue cfg.Datasources[ref] = ds - return dependencies, diags, shouldContinue + return dependencies, diags } opts, _ := decodeHCL2Spec(ds.block.Body, cfg.EvalContext(DatasourceContext, nil), datasource) @@ -455,14 +454,14 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen Subject: &cfg.Datasources[ref].block.DefRange, Severity: hcl.DiagError, }) - return dependencies, diags, shouldContinue + return dependencies, diags } ds.value = realValue cfg.Datasources[ref] = ds // remove ref from the dependencies map. delete(dependencies, ref) - return dependencies, diags, shouldContinue + return dependencies, diags } // getCoreBuildProvisioners takes a list of provisioner block, starts according From be2424949e2dd51d76cb30b6f402e51b621ffa8f Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 24 Aug 2023 16:09:25 -0400 Subject: [PATCH 87/92] hcl2template: simplify datasource evaluation Since datasources are recursively evaluated depending on their dependencies, we don't need to pre-execute those that depend on nothing, as the recursive traversal of the datasources will take care of that for us. --- hcl2template/types.packer_config.go | 46 ++--------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 9ef8de242e4..39283e59075 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -311,8 +311,8 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics // source in any of its input expressions. If so, skip evaluating it for // now, and add it to a list of datasources to evaluate again, later, // with the datasources in its context. - // This is essentially creating a very primitive DAG just for data - // source interdependencies. + dependencies[ref] = []DatasourceRef{} + block := ds.block body := block.Body attrs, _ := body.JustAttributes() @@ -330,51 +330,11 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics Name: v[2].(hcl.TraverseAttr).Name, } log.Printf("The data source %#v depends on datasource %#v", ref, dependsOn) - if dependencies[ref] != nil { - dependencies[ref] = append(dependencies[ref], dependsOn) - } else { - dependencies[ref] = []DatasourceRef{dependsOn} - } + dependencies[ref] = append(dependencies[ref], dependsOn) skipFirstEval = true } } } - - // Now we have a list of data sources that depend on other data sources. - // Don't evaluate these; only evaluate data sources that we didn't - // mark as having dependencies. - if skipFirstEval { - continue - } - - datasource, startDiags := cfg.startDatasource(cfg.parser.PluginConfig.DataSources, ref, false) - diags = append(diags, startDiags...) - if diags.HasErrors() { - continue - } - - if skipExecution { - placeholderValue := cty.UnknownVal(hcldec.ImpliedType(datasource.OutputSpec())) - ds.value = placeholderValue - cfg.Datasources[ref] = ds - continue - } - - dsOpts, _ := decodeHCL2Spec(body, cfg.EvalContext(DatasourceContext, nil), datasource) - sp := packer.CheckpointReporter.AddSpan(ref.Type, "datasource", dsOpts) - realValue, err := datasource.Execute() - sp.End(err) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Summary: err.Error(), - Subject: &cfg.Datasources[ref].block.DefRange, - Severity: hcl.DiagError, - }) - continue - } - - ds.value = realValue - cfg.Datasources[ref] = ds } // Now that most of our data sources have been started and executed, we can From 0c3adbf9acc40212c0b27c69bbfed1b50b70ae6f Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 24 Aug 2023 16:10:51 -0400 Subject: [PATCH 88/92] hcl2template: report localtion for cycle detection When a datasource fails to be evaluated because a cycle has been detected, we point out one of the links of the chain now so that users have a better idea of what to look at. --- hcl2template/types.packer_config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 39283e59075..c9beb67bd0a 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -368,6 +368,7 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen "sources. Either your data source depends on more than ten " + "other data sources, or your data sources have a cyclic " + "dependency. Please simplify your config to continue. ", + Subject: &(cfg.Datasources[ref]).block.DefRange, }) return dependencies, diags } From f4dcae25308be3e718533a27edff792f2d4a6c73 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 24 Aug 2023 16:11:55 -0400 Subject: [PATCH 89/92] hcl2template: extract attr filter code from ds Datasources use their attribute's expressions to determine whether or not they depend on another datasource, in order to get the list of dependencies and execute them before executing a datasource. This code may be useful later on for figuring out the dependencies for any block, so we move this code to the utils.go file, and use this for datasources. --- hcl2template/types.packer_config.go | 31 ++++++++++------------------- hcl2template/utils.go | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index c9beb67bd0a..c344aa7b0b2 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -5,7 +5,6 @@ package hcl2template import ( "fmt" - "log" "sort" "strings" @@ -313,27 +312,17 @@ func (cfg *PackerConfig) evaluateDatasources(skipExecution bool) hcl.Diagnostics // with the datasources in its context. dependencies[ref] = []DatasourceRef{} - block := ds.block - body := block.Body - attrs, _ := body.JustAttributes() - - skipFirstEval := false - for _, attr := range attrs { - vars := attr.Expr.Variables() - for _, v := range vars { - // check whether the variable is a data source - if v.RootName() == "data" { - // construct, backwards, the data source type and name we - // need to evaluate before this one can be evaluated. - dependsOn := DatasourceRef{ - Type: v[1].(hcl.TraverseAttr).Name, - Name: v[2].(hcl.TraverseAttr).Name, - } - log.Printf("The data source %#v depends on datasource %#v", ref, dependsOn) - dependencies[ref] = append(dependencies[ref], dependsOn) - skipFirstEval = true - } + // Note: when looking at the expressions, we only need to care about + // attributes, as HCL2 expressions are not allowed in a block's labels. + vars := GetVarsByType(ds.block, "data") + for _, v := range vars { + // construct, backwards, the data source type and name we + // need to evaluate before this one can be evaluated. + dependsOn := DatasourceRef{ + Type: v[1].(hcl.TraverseAttr).Name, + Name: v[2].(hcl.TraverseAttr).Name, } + dependencies[ref] = append(dependencies[ref], dependsOn) } } diff --git a/hcl2template/utils.go b/hcl2template/utils.go index 98546a95456..a542a2467ac 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -186,3 +186,23 @@ func ConvertPluginConfigValueToHCLValue(v interface{}) (cty.Value, error) { } return buildValue, nil } + +func GetVarsByType(block *hcl.Block, topLevelLabels ...string) []hcl.Traversal { + attributes, _ := block.Body.JustAttributes() + + var vars []hcl.Traversal + + for _, attr := range attributes { + for _, variable := range attr.Expr.Variables() { + rootLabel := variable.RootName() + for _, label := range topLevelLabels { + if label == rootLabel { + vars = append(vars, variable) + break + } + } + } + } + + return vars +} From 19c8281c49e50ee26ff240969f6010a54d984730 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 24 Aug 2023 20:11:55 +0000 Subject: [PATCH 90/92] backport of commit f4dcae25308be3e718533a27edff792f2d4a6c73 --- .copywrite.hcl | 4 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/labeler-issue-triage.yml | 2 +- .github/workflows/acceptance-test.yml | 10 +- .github/workflows/auto-close-stale-issues.yml | 2 +- .github/workflows/backport.yml | 2 +- .github/workflows/build.yml | 16 +- .../workflows/check-legacy-links-format.yml | 17 + .github/workflows/check-plugin-docs.yml | 4 +- .github/workflows/create-release-branch.yml | 2 +- .github/workflows/go-test.yml | 14 +- .github/workflows/go-validate.yml | 18 +- .github/workflows/issue-comment-created.yml | 3 +- .github/workflows/issue-migrator.yml | 2 +- .github/workflows/issues-opened.yml | 41 +- .github/workflows/jira.yml | 28 +- .github/workflows/lock.yml | 2 +- .github/workflows/nightly-release.yml | 16 +- .go-version | 2 +- .golangci.yml | 2 +- .release/ci.hcl | 2 +- .release/release-metadata.hcl | 2 +- .release/security-scan.hcl | 2 +- CHANGELOG.md | 9 - Dockerfile | 2 +- LICENSE | 436 +++++++++++++++--- acctest/plugin/bundled_plugin_test.go | 2 +- acctest/plugin/component_acc_test.go | 2 +- acctest/plugin/plugin_acc_test.go | 2 +- .../basic-amazon-ami-datasource.pkr.hcl | 2 +- acctest/testing.go | 2 +- acctest/testing_test.go | 2 +- background_check.go | 2 +- background_check_openbsd.go | 2 +- builder/file/artifact.go | 2 +- builder/file/artifact_test.go | 2 +- builder/file/builder.go | 2 +- builder/file/builder_test.go | 2 +- builder/file/config.go | 2 +- builder/file/config_test.go | 2 +- builder/file/version/version.go | 2 +- builder/null/artifact_export.go | 2 +- builder/null/artifact_export_test.go | 2 +- builder/null/builder.go | 2 +- builder/null/builder_test.go | 2 +- builder/null/config.go | 2 +- builder/null/config_test.go | 2 +- builder/null/ssh.go | 2 +- builder/null/version/version.go | 2 +- checkpoint.go | 2 +- cmd/generate-fixer-deprecations/main.go | 2 +- cmd/ssh-keygen/main.go | 2 +- command/build.go | 2 +- command/build_cancellation_test.go | 2 +- command/build_cleanup_script_test.go | 2 +- command/build_parallel_test.go | 2 +- command/build_test.go | 2 +- command/build_timeout_test.go | 2 +- command/build_windows_test.go | 2 +- command/cli.go | 2 +- command/command_test.go | 2 +- command/config_file_unix.go | 2 +- command/config_file_windows.go | 2 +- command/console.go | 2 +- command/console_test.go | 2 +- command/enumflag/flag.go | 2 +- command/exec_test.go | 2 +- command/fix.go | 2 +- command/fix_test.go | 2 +- command/flag-kv/flag.go | 2 +- command/flag-kv/flag_json.go | 2 +- command/flag-kv/flag_json_test.go | 2 +- command/flag-kv/flag_strings.go | 2 +- command/flag-kv/flag_strings_test.go | 2 +- command/flag-kv/flag_test.go | 2 +- command/flag-slice/flag.go | 2 +- command/flag-slice/flag_test.go | 2 +- command/fmt.go | 2 +- command/fmt_test.go | 2 +- command/hcl2_upgrade.go | 2 +- command/hcl2_upgrade_test.go | 2 +- command/init.go | 2 +- command/init_test.go | 2 +- command/inspect.go | 2 +- command/inspect_test.go | 2 +- command/meta.go | 2 +- command/plugins.go | 2 +- command/plugins_install.go | 2 +- command/plugins_install_test.go | 2 +- command/plugins_installed.go | 2 +- command/plugins_remove.go | 2 +- command/plugins_remove_test.go | 2 +- command/plugins_required.go | 2 +- command/signal.go | 2 +- command/test_utils.go | 2 +- command/utils.go | 2 +- command/utils_test.go | 2 +- command/validate.go | 2 +- command/validate_test.go | 2 +- command/vendored_plugins.go | 2 +- command/version.go | 2 +- command/version_test.go | 2 +- commands.go | 2 +- config.go | 2 +- config_test.go | 2 +- datasource/hcp-packer-image/data.go | 2 +- datasource/hcp-packer-iteration/data.go | 2 +- .../hcp-packer-iteration/data_acc_test.go | 2 +- datasource/http/data.go | 2 +- datasource/http/data_acc_test.go | 2 +- datasource/null/data.go | 2 +- fix/fixer.go | 2 +- fix/fixer_amazon_enhanced_networking.go | 2 +- fix/fixer_amazon_enhanced_networking_test.go | 2 +- fix/fixer_amazon_private_ip.go | 2 +- fix/fixer_amazon_private_ip_test.go | 2 +- fix/fixer_amazon_shutdown_behavior.go | 2 +- fix/fixer_amazon_shutdown_behavior_test.go | 2 +- fix/fixer_amazon_spot_price_product.go | 2 +- ...r_amazon_temporary_security_group_cidrs.go | 2 +- ...zon_temporary_security_group_cidrs_test.go | 2 +- fix/fixer_azure_exclude_from_latest.go | 2 +- fix/fixer_azure_exclude_from_latest_test.go | 2 +- fix/fixer_clean_image_name.go | 2 +- fix/fixer_clean_image_name_test.go | 2 +- fix/fixer_comm_config.go | 2 +- fix/fixer_comm_config_test.go | 2 +- fix/fixer_createtime.go | 2 +- fix/fixer_createtime_test.go | 2 +- fix/fixer_docker_email.go | 2 +- fix/fixer_galaxy_command.go | 2 +- fix/fixer_galaxy_command_test.go | 2 +- fix/fixer_hyperv_cpu_and_ram_naming.go | 2 +- fix/fixer_hyperv_deprecations.go | 2 +- fix/fixer_hyperv_deprecations_test.go | 2 +- fix/fixer_hyperv_vmxc_typo.go | 2 +- fix/fixer_hyperv_vmxc_typo_test.go | 2 +- fix/fixer_iso_checksum_type_and_url.go | 2 +- fix/fixer_iso_checksum_type_and_url_test.go | 2 +- fix/fixer_iso_md5.go | 2 +- fix/fixer_iso_md5_test.go | 2 +- fix/fixer_parallels_deprecations.go | 2 +- fix/fixer_parallels_deprecations_test.go | 2 +- fix/fixer_parallels_headless.go | 2 +- fix/fixer_parallels_headless_test.go | 2 +- fix/fixer_powershell_escapes.go | 2 +- fix/fixer_pp_docker_tag_tags.go | 2 +- fix/fixer_pp_docker_tag_tags_test.go | 2 +- fix/fixer_pp_manifest_filename.go | 2 +- fix/fixer_pp_manifest_filename_test.go | 2 +- fix/fixer_pp_vagrant_override.go | 2 +- fix/fixer_pp_vagrant_override_test.go | 2 +- fix/fixer_proxmox_type.go | 2 +- fix/fixer_proxmox_type_test.go | 2 +- fix/fixer_qemu_disk_size.go | 2 +- fix/fixer_qemu_disk_size_test.go | 2 +- fix/fixer_qemu_host_port.go | 2 +- fix/fixer_qemu_host_port_test.go | 2 +- fix/fixer_scaleway_access_key.go | 2 +- fix/fixer_scaleway_access_key_test.go | 2 +- fix/fixer_ssh_timeout.go | 2 +- fix/fixer_ssh_timeout_test.go | 2 +- fix/fixer_sshdisableagent.go | 2 +- fix/fixer_sshdisableagent_test.go | 2 +- fix/fixer_sshkeypath.go | 2 +- fix/fixer_sshkeypath_test.go | 2 +- fix/fixer_test.go | 2 +- fix/fixer_virtualbox_gaattach.go | 2 +- fix/fixer_virtualbox_gaattach_test.go | 2 +- fix/fixer_virtualbox_rename.go | 2 +- fix/fixer_virtualbox_rename_test.go | 2 +- fix/fixer_vmware_compaction.go | 2 +- fix/fixer_vmware_compaction_test.go | 2 +- fix/fixer_vmware_rename.go | 2 +- fix/fixer_vmware_rename_test.go | 2 +- fix/fixer_vsphere_network_storage.go | 2 +- fix/fixer_vsphere_network_storage_test.go | 2 +- fix/helpers.go | 2 +- go | 0 hcl2template/addrs/doc.go | 2 +- hcl2template/addrs/input_variable.go | 2 +- hcl2template/addrs/parse_ref.go | 2 +- hcl2template/addrs/plugin.go | 2 +- hcl2template/addrs/plugin_test.go | 2 +- hcl2template/addrs/referenceable.go | 2 +- hcl2template/common_test.go | 2 +- hcl2template/components.go | 2 +- hcl2template/decode.go | 2 +- hcl2template/docs.go | 2 +- hcl2template/formatter.go | 2 +- hcl2template/formatter_test.go | 2 +- hcl2template/function/Consul.go | 2 +- hcl2template/function/aws_secretetkey.go | 2 +- hcl2template/function/datetime.go | 2 +- hcl2template/function/datetime_test.go | 2 +- hcl2template/function/env.go | 2 +- hcl2template/function/index.go | 2 +- hcl2template/function/index_test.go | 2 +- hcl2template/function/length.go | 2 +- hcl2template/function/length_test.go | 2 +- hcl2template/function/templatefile.go | 2 +- hcl2template/function/templatefile_test.go | 2 +- hcl2template/function/vault.go | 2 +- hcl2template/functions.go | 2 +- hcl2template/internal/mock.go | 2 +- hcl2template/parser.go | 2 +- hcl2template/plugin.go | 2 +- hcl2template/repl/format.go | 2 +- hcl2template/repl/repl.go | 2 +- hcl2template/shim/mock.go | 2 +- hcl2template/shim/values.go | 2 +- hcl2template/shim/values_test.go | 2 +- hcl2template/types.build.from.go | 2 +- hcl2template/types.build.go | 2 +- .../types.build.hcp_packer_registry.go | 2 +- .../types.build.hcp_packer_registry_test.go | 2 +- hcl2template/types.build.post-processor.go | 2 +- hcl2template/types.build.provisioners.go | 2 +- hcl2template/types.build.provisioners_test.go | 2 +- hcl2template/types.build_test.go | 2 +- hcl2template/types.datasource.go | 2 +- hcl2template/types.datasource_test.go | 2 +- hcl2template/types.hcl_post-processor.go | 2 +- hcl2template/types.hcl_provisioner.go | 2 +- hcl2template/types.hcl_ref.go | 2 +- hcl2template/types.packer_config.go | 2 +- hcl2template/types.packer_config_test.go | 2 +- hcl2template/types.required_plugins.go | 2 +- hcl2template/types.required_plugins_test.go | 2 +- hcl2template/types.source.go | 2 +- hcl2template/types.source_test.go | 2 +- hcl2template/types.variables.go | 2 +- hcl2template/types.variables_test.go | 2 +- hcl2template/utils.go | 2 +- hcl2template/version.go | 2 +- hcl2template/version_required.go | 2 +- helper/wrappedreadline/wrappedreadline.go | 2 +- .../wrappedreadline_solaris.go | 2 +- .../wrappedreadline/wrappedreadline_unix.go | 2 +- .../wrappedreadline_windows.go | 2 +- helper/wrappedstreams/streams.go | 2 +- helper/wrappedstreams/streams_other.go | 2 +- helper/wrappedstreams/streams_windows.go | 2 +- internal/hcp/api/client.go | 2 +- internal/hcp/api/client_test.go | 2 +- internal/hcp/api/errors.go | 2 +- internal/hcp/api/mock_service.go | 2 +- internal/hcp/api/service.go | 2 +- internal/hcp/env/env.go | 2 +- internal/hcp/env/env_test.go | 2 +- internal/hcp/env/variables.go | 2 +- internal/hcp/registry/artifact.go | 2 +- internal/hcp/registry/errors.go | 2 +- internal/hcp/registry/hcl.go | 2 +- internal/hcp/registry/hcp.go | 2 +- internal/hcp/registry/json.go | 2 +- internal/hcp/registry/null_registry.go | 2 +- internal/hcp/registry/registry.go | 2 +- internal/hcp/registry/types.bucket.go | 2 +- .../hcp/registry/types.bucket_service_test.go | 2 +- internal/hcp/registry/types.bucket_test.go | 2 +- internal/hcp/registry/types.builds.go | 2 +- internal/hcp/registry/types.iterations.go | 2 +- .../hcp/registry/types.iterations_test.go | 2 +- log.go | 2 +- main.go | 12 +- main_test.go | 2 +- packer/build.go | 2 +- packer/build_test.go | 2 +- packer/builder_test.go | 2 +- packer/client_test.go | 2 +- packer/cmd_builder.go | 2 +- packer/cmd_builder_test.go | 2 +- packer/cmd_datasource.go | 2 +- packer/cmd_datasource_test.go | 2 +- packer/cmd_hook.go | 2 +- packer/cmd_hook_test.go | 2 +- packer/cmd_post_processor.go | 2 +- packer/cmd_post_processor_test.go | 2 +- packer/cmd_provisioner.go | 2 +- packer/cmd_provisioner_test.go | 2 +- packer/core.go | 2 +- packer/core_test.go | 2 +- packer/maps.go | 2 +- packer/packer_test.go | 2 +- packer/plugin-getter/checksum.go | 2 +- packer/plugin-getter/docs.go | 2 +- packer/plugin-getter/github/docs.go | 2 +- packer/plugin-getter/github/getter.go | 2 +- packer/plugin-getter/plugins.go | 2 +- packer/plugin-getter/plugins_test.go | 2 +- packer/plugin.go | 2 +- packer/plugin_client.go | 2 +- packer/plugin_discover_test.go | 2 +- packer/plugin_folders.go | 2 +- packer/plugin_test.go | 2 +- packer/post_processor_mock.go | 2 +- packer/progressbar.go | 2 +- packer/progressbar_solaris.go | 2 +- packer/progressbar_test.go | 2 +- packer/provisioner.go | 2 +- packer/provisioner_test.go | 2 +- packer/provisioner_timeout.go | 2 +- packer/run_interfaces.go | 2 +- packer/telemetry.go | 2 +- packer/telemetry_test.go | 2 +- packer/testing.go | 2 +- packer/ui.go | 2 +- packer/ui_test.go | 2 +- panic.go | 2 +- post-processor/artifice/artifact.go | 2 +- post-processor/artifice/post-processor.go | 2 +- post-processor/artifice/version/version.go | 2 +- post-processor/checksum/artifact.go | 2 +- post-processor/checksum/post-processor.go | 2 +- .../checksum/post-processor_test.go | 2 +- post-processor/checksum/version/version.go | 2 +- post-processor/compress/artifact.go | 2 +- post-processor/compress/artifact_test.go | 2 +- post-processor/compress/benchmark.go | 2 +- post-processor/compress/post-processor.go | 2 +- .../compress/post-processor_test.go | 2 +- post-processor/compress/tar_fix.go | 2 +- post-processor/compress/tar_fix_go110.go | 2 +- post-processor/compress/version/version.go | 2 +- post-processor/manifest/artifact.go | 2 +- post-processor/manifest/post-processor.go | 2 +- post-processor/manifest/version/version.go | 2 +- post-processor/shell-local/post-processor.go | 2 +- .../shell-local/post-processor_test.go | 2 +- post-processor/shell-local/version/version.go | 2 +- provisioner/breakpoint/provisioner.go | 2 +- provisioner/breakpoint/version/version.go | 2 +- provisioner/file/provisioner.go | 2 +- provisioner/file/provisioner_test.go | 2 +- provisioner/file/version/version.go | 2 +- provisioner/powershell/execution_policy.go | 2 +- .../powershell/execution_policy_test.go | 2 +- provisioner/powershell/provisioner.go | 2 +- .../powershell/provisioner_acc_test.go | 2 +- provisioner/powershell/provisioner_test.go | 2 +- provisioner/powershell/version/version.go | 2 +- provisioner/shell-local/provisioner.go | 2 +- .../shell-local/provisioner_acc_test.go | 2 +- provisioner/shell-local/provisioner_test.go | 2 +- provisioner/shell-local/version/version.go | 2 +- provisioner/shell/provisioner.go | 2 +- provisioner/shell/provisioner_acc_test.go | 2 +- provisioner/shell/provisioner_test.go | 2 +- provisioner/shell/unix_reader.go | 2 +- provisioner/shell/unix_reader_test.go | 2 +- provisioner/shell/version/version.go | 2 +- provisioner/sleep/provisioner.go | 2 +- provisioner/sleep/provisioner_test.go | 2 +- provisioner/sleep/version/version.go | 2 +- provisioner/windows-restart/provisioner.go | 2 +- .../windows-restart/provisioner_test.go | 2 +- .../windows-restart/version/version.go | 2 +- provisioner/windows-shell/provisioner.go | 2 +- provisioner/windows-shell/provisioner_test.go | 2 +- provisioner/windows-shell/version/version.go | 2 +- scripts/build.ps1 | 2 +- scripts/build.sh | 2 +- scripts/codesign_example.sh | 2 +- scripts/dist.sh | 2 +- scripts/generate-plugins.go | 2 +- scripts/off_gopath.sh | 2 +- scripts/prepare_changelog.sh | 2 +- scripts/sign.sh | 2 +- scripts/sort-md-list.py | 2 +- scripts/upgrade_plugins.sh | 2 +- scripts/vagrant-freebsd-priv-config.sh | 2 +- scripts/vagrant-freebsd-unpriv-bootstrap.sh | 2 +- scripts/vagrant-linux-priv-config.sh | 2 +- scripts/vagrant-linux-priv-go.sh | 2 +- scripts/vagrant-linux-unpriv-bootstrap.sh | 2 +- tty.go | 2 +- tty_solaris.go | 2 +- version/VERSION | 2 +- version/version.go | 4 +- website/content/docs/commands/init.mdx | 2 +- website/content/docs/community-tools.mdx | 3 - website/content/docs/index.mdx | 2 +- website/content/docs/intro/index.mdx | 2 +- website/content/docs/partnerships.mdx | 2 +- .../guides/packer-on-cicd/trigger-tfe.mdx | 2 +- website/package-lock.json | 12 +- 387 files changed, 841 insertions(+), 544 deletions(-) create mode 100644 .github/workflows/check-legacy-links-format.yml delete mode 100644 go diff --git a/.copywrite.hcl b/.copywrite.hcl index 3cbd1daa501..2e86e1c3cc1 100644 --- a/.copywrite.hcl +++ b/.copywrite.hcl @@ -1,6 +1,6 @@ project { - license = "BUSL-1.1" - copyright_year = 2023 + license = "MPL-2.0" + copyright_year = 2013 header_ignore = [ "*.hcl2spec.go", # generated code specs, since they'll be wiped out until we support adding the headers at generation-time "hcl2template/testdata/**", diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index b79897d5954..eae8012b936 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 blank_issues_enabled: false contact_links: diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 6d9ef6d547c..1737a33b92c 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 bug: - 'panic:' diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index 783b6bdccde..98d012cb8d4 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -19,7 +19,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: 'Determine Go version' id: get-go-version # We use .go-version as our source of truth for current Go @@ -40,12 +40,12 @@ jobs: # Packer GH Token for API Rate Limiting PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - name: IAM Assume Role - uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0 + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 with: role-to-assume: ${{ env.AWS_ROLE_ARN }} aws-region: ${{ env.AWS_REGION }} @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 + uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 with: payload: | { diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml index af4a089df5d..40b04dec196 100644 --- a/.github/workflows/auto-close-stale-issues.yml +++ b/.github/workflows/auto-close-stale-issues.yml @@ -14,7 +14,7 @@ jobs: pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-latest steps: - - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 + - uses: actions/stale@a20b814fb01b71def3bd6f56e7494d667ddf28da # v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-issue-stale: 23 diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 8e4ebf5e0b2..bb6e5b88158 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,7 +16,7 @@ jobs: contents: none if: github.event.pull_request.merged runs-on: ubuntu-latest - container: hashicorpdev/backport-assistant:0.3.4 + container: hashicorpdev/backport-assistant:0.2.3 steps: - name: Backport changes to stable-website run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c15c8c6acf5..0f13bedff1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: 'Determine Go version' id: get-go-version # We use .go-version as our source of truth for current Go @@ -44,7 +44,7 @@ jobs: product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }} set-ld-flags: ${{ steps.set-ld-flags.outputs.set-ld-flags }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: set product version id: set-product-version uses: hashicorp/actions-set-product-version@v1 @@ -67,7 +67,7 @@ jobs: filepath: ${{ steps.generate-metadata-file.outputs.filepath }} steps: - name: 'Checkout directory' - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Generate metadata file id: generate-metadata-file uses: hashicorp/actions-generate-metadata@main @@ -105,7 +105,7 @@ jobs: GOPRIVATE: "github.com/hashicorp" GO111MODULE: on steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Go Build env: PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} @@ -142,7 +142,7 @@ jobs: GO111MODULE: on steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Go Build env: PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} @@ -169,7 +169,7 @@ jobs: version: ${{ needs.set-product-version.outputs.product-version }} maintainer: "HashiCorp" homepage: "https://www.packer.io/docs" - license: "BUSL-1.1" + license: "MPL-2.0" binary: "dist/${{ env.REPO_NAME }}" deb_depends: "openssl" rpm_depends: "openssl" @@ -204,7 +204,7 @@ jobs: GO111MODULE: on steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Go Build env: PRODUCT_VERSION: ${{ needs.set-product-version.outputs.product-version }} @@ -234,7 +234,7 @@ jobs: env: version: ${{ needs.set-product-version.outputs.product-version }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Docker Build (Action) uses: hashicorp/actions-docker-build@v1 with: diff --git a/.github/workflows/check-legacy-links-format.yml b/.github/workflows/check-legacy-links-format.yml new file mode 100644 index 00000000000..08c128a9f49 --- /dev/null +++ b/.github/workflows/check-legacy-links-format.yml @@ -0,0 +1,17 @@ +name: Legacy Link Format Checker + +on: + push: + paths: + - "website/content/**/*.mdx" + - "website/data/*-nav-data.json" + +jobs: + check-links: + uses: hashicorp/dev-portal/.github/workflows/docs-content-check-legacy-links-format.yml@475289345d312552b745224b46895f51cc5fc490 + with: + repo-owner: "hashicorp" + repo-name: "packer" + commit-sha: ${{ github.sha }} + mdx-directory: "website/content" + nav-data-directory: "website/data" diff --git a/.github/workflows/check-plugin-docs.yml b/.github/workflows/check-plugin-docs.yml index 00ba2851ef8..c43ae9cb33c 100644 --- a/.github/workflows/check-plugin-docs.yml +++ b/.github/workflows/check-plugin-docs.yml @@ -23,9 +23,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Setup Node - uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: '16.x' - name: Install Dependencies diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index 780087058b7..0d1f4f3953c 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -4,7 +4,7 @@ jobs: create-branch: runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - uses: hashicorp/actions-create-release-branch@v1 with: token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 2f426d16a03..93f8eeb1ae8 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -24,7 +24,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 - name: 'Determine Go version' id: get-go-version run: | @@ -36,8 +36,8 @@ jobs: runs-on: ubuntu-latest name: Linux go tests steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci @@ -47,8 +47,8 @@ jobs: runs-on: macos-latest name: Darwin go tests steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go test ./... -coverprofile=coverage.txt -covermode=atomic @@ -58,8 +58,8 @@ jobs: runs-on: windows-latest name: Windows go tests steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go test ./... -coverprofile=coverage.txt -covermode=atomic diff --git a/.github/workflows/go-validate.yml b/.github/workflows/go-validate.yml index a3c45f794ff..d67b3aa5151 100644 --- a/.github/workflows/go-validate.yml +++ b/.github/workflows/go-validate.yml @@ -20,7 +20,7 @@ jobs: outputs: go-version: ${{ steps.get-go-version.outputs.go-version }} steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 - name: 'Determine Go version' id: get-go-version run: | @@ -32,8 +32,8 @@ jobs: runs-on: ubuntu-latest name: Go Mod Tidy steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: go mod tidy @@ -43,10 +43,10 @@ jobs: runs-on: ubuntu-latest name: Lint steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: fetch-depth: 0 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: echo "$GITHUB_SHA" @@ -59,8 +59,8 @@ jobs: runs-on: ubuntu-latest name: Fmt check steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: make fmt-check @@ -70,8 +70,8 @@ jobs: runs-on: ubuntu-latest name: Generate check steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - run: make generate-check diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows/issue-comment-created.yml index a5c112d2a15..f250dc1f101 100644 --- a/.github/workflows/issue-comment-created.yml +++ b/.github/workflows/issue-comment-created.yml @@ -12,10 +12,9 @@ jobs: permissions: contents: read # for actions/checkout to fetch code issues: write # for actions-ecosystem/action-remove-labels to remove issue labels - if: ${{contains(github.event.issue.labels.*.name, 'waiting-reply') || contains(github.event.issue.labels.*.name, 'stale')}} runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 with: github_token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/issue-migrator.yml b/.github/workflows/issue-migrator.yml index 719cfa44f2f..9acc66ee6d4 100644 --- a/.github/workflows/issue-migrator.yml +++ b/.github/workflows/issue-migrator.yml @@ -12,7 +12,7 @@ jobs: if: startsWith(github.event.label.name, 'remote-plugin/') runs-on: ubuntu-latest steps: - - uses: bflad/action-migrate-issue@2e049d822b08e67d25b938343227051518f14d9a # v1.0.2 + - uses: bflad/action-migrate-issue@main # TSCCR: no entry for repository "bflad/action-migrate-issue" with: source-issue-comment: | This issue has been migrated to {target-issue-url} due to the [Packer Plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). diff --git a/.github/workflows/issues-opened.yml b/.github/workflows/issues-opened.yml index 565b89af048..57a8cd0cb65 100644 --- a/.github/workflows/issues-opened.yml +++ b/.github/workflows/issues-opened.yml @@ -13,8 +13,8 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: github/issue-labeler@98b5412841f6c4b0b3d9c29d53c13fad16bd7de2 # v3.2 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: github/issue-labeler@e24a3eb6b2e28c8904d086302a2b760647f5f45c # v3.1 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-triage.yml @@ -23,35 +23,24 @@ jobs: name: Redirect to discuss permissions: contents: read - issues: write # for actions/github-script to create comments and add labels + issues: write # for actions-ecosystem/action-create-comment to create comments if: contains(github.event.issue.labels.*.name, 'question') runs-on: ubuntu-latest steps: - - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + - uses: actions-ecosystem/action-create-comment@v1.0.2 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: ` - Hi 👋 thanks for reaching out. + github_token: ${{ secrets.GITHUB_TOKEN }} + body: | + Hi 👋 thanks for reaching out. - For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. - As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. - We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. - If no activity is taken on this question within 30 days it will be automatically closed. + For general questions we recommend reaching out to the [community forum](https://discuss.hashicorp.com/c/packer) for greater visibility. + As the GitHub issue tracker is only watched by a small subset of maintainers and is really reserved for bugs and enhancements, you'll have a better chance of finding someone who can help you in the forum. + We'll mark this issue as needs-reply to help inform maintainers that this question is awaiting a response. + If no activity is taken on this question within 30 days it will be automatically closed. - If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue.` - }) - - - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + If you find the forum to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. + - uses: actions-ecosystem/action-add-labels@v1.1.3 # TSCCR: no entry for repository "actions-ecosystem/action-add-labels" with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['needs-reply'] - }) + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: needs-reply diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml index a3fa8cd7ea8..e0e82a97f01 100644 --- a/.github/workflows/jira.yml +++ b/.github/workflows/jira.yml @@ -11,11 +11,11 @@ jobs: sync: name: Sync to JIRA permissions: - issues: write # for actions/github-script to create comments + issues: write # for actions-ecosytem/action-create-comment runs-on: ubuntu-latest steps: - name: Login - uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3 + uses: atlassian/gajira-login@45fd029b9f1d6d8926c6f04175aa80c0e42c9026 # v3.0.1 env: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} @@ -61,26 +61,26 @@ jobs: - name: Create ticket id: create-ticket if: steps.search.outputs.issue == '' && github.event.label.name == 'sync to jira' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: atlassian/gajira-create@1ff0b6bd115a780592b47bfbb63fc4629132e6ec # v3 + uses: atlassian/gajira-create@59e177c4f6451399df5b4911c2211104f171e669 # v3.0.1 with: project: HPR issuetype: "${{ steps.set-ticket-type.outputs.type }}" summary: "${{ github.event.repository.name }}: ${{ github.event.issue.title }}" description: "${{ github.event.issue.body }}\n\n_Created from GitHub by ${{ github.actor }}._" # The field customfield_10089 refers to the Issue Link field in JIRA. - fields: '{ "customfield_10089": "${{ github.event.issue.html_url }}", "components": [{ "name": "OSS" }], "labels": ${{ steps.set-ticket-labels.outputs.labels }} }' + fields: '{ "customfield_10089": "${{ github.event.issue.html_url }}", + "components": [{ "name": "OSS" }], + "labels": ${{ steps.set-ticket-labels.outputs.labels }} }' - name: Add tracking comment if: steps.create-ticket.outputs.issue != '' && steps.set-ticket-type.outputs.type != 'Invalid' - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + uses: actions-ecosystem/action-create-comment@v1.0.0 # TSCCR: no entry for repository "actions-ecosystem/action-create-comment" with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: ` - This issue has been synced to JIRA for planning. - JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}})` - }) + github_token: ${{ secrets.GITHUB_TOKEN }} + body: | + This issue has been synced to JIRA for planning. + + JIRA ID: [${{ steps.create-ticket.outputs.issue }}](https://hashicorp.atlassian.net/browse/${{steps.create-ticket.outputs.issue}}) + + diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index f1f17b35893..77f57ab0a7f 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write # for dessant/lock-threads to lock PRs runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21 # v4.0.1 + - uses: dessant/lock-threads@c1b35aecc5cdb1a34539d14196df55838bb2f836 # v4.0.0 with: github-token: ${{ github.token }} issue-comment: > diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index e63c05ea30d..ea388be057c 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -24,7 +24,7 @@ jobs: needs: build-artifacts runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Download built artifacts uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: @@ -38,12 +38,12 @@ jobs: echo "BUILD_OUTPUT_LIST=$(cat tmp2.txt | tr '\n' ',' | perl -ple 'chop')" >> $GITHUB_ENV rm -rf tmp.txt && rm -rf tmp2.txt - name: Advance nightly tag - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | try { - await github.rest.git.deleteRef({ + await github.git.deleteRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "tags/nightly" @@ -51,7 +51,7 @@ jobs: } catch (e) { console.log("Warning: The nightly tag doesn't exist yet, so there's nothing to do. Trace: " + e) } - await github.rest.git.createRef({ + await github.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "refs/tags/nightly", @@ -62,7 +62,7 @@ jobs: - name: Create a nightly GitHub prerelease id: create_prerelease continue-on-error: true - uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 + uses: ncipollo/release-action@v1 # TSCCR: no entry for repository "ncipollo/release-action" with: name: nightly artifacts: "${{ env.BUILD_OUTPUT_LIST }}" @@ -85,7 +85,7 @@ jobs: - name: Retry failed nightly GitHub prerelease id: create_prerelease_retry if: steps.create_prerelease.outcome == 'failure' - uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 + uses: ncipollo/release-action@v1 # TSCCR: no entry for repository "ncipollo/release-action" with: name: nightly artifacts: "${{ env.BUILD_OUTPUT_LIST }}" @@ -101,7 +101,7 @@ jobs: run: | echo "prerelease_id=${{ steps.create_prerelease_retry.outputs.id }}" >> $GITHUB_ENV - name: Publish nightly GitHub prerelease - uses: eregon/publish-release@46913fa2b3f7edc7345ae3c17f6d1b093a54916d # v1.0.5 + uses: eregon/publish-release@v1 # TSCCR: no entry for repository "eregon/publish-release" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -117,7 +117,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send slack notification on failure - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 + uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0 with: payload: | { diff --git a/.go-version b/.go-version index 95393fc7d4d..8909929f6e7 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.8 +1.20.7 diff --git a/.golangci.yml b/.golangci.yml index 656b0373ac5..ccd990c0040 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 issues: # List of regexps of issue texts to exclude, empty list by default. diff --git a/.release/ci.hcl b/.release/ci.hcl index 14dab1591d9..6ca7eb0de23 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 schema = "1" diff --git a/.release/release-metadata.hcl b/.release/release-metadata.hcl index 05d0b9f3a81..0fb2456679e 100644 --- a/.release/release-metadata.hcl +++ b/.release/release-metadata.hcl @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 url_docker_registry_dockerhub = "https://hub.docker.com/r/hashicorp/packer" url_docker_registry_ecr = "https://gallery.ecr.aws/hashicorp/packer" diff --git a/.release/security-scan.hcl b/.release/security-scan.hcl index 12ef1d53388..7d3258126bc 100644 --- a/.release/security-scan.hcl +++ b/.release/security-scan.hcl @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 container { dependencies = false diff --git a/CHANGELOG.md b/CHANGELOG.md index 5810f01c34d..64b819a3139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -186,15 +186,6 @@ if using HCL2, a `required_plugins` block to define a list of plugins to use for * Bumped gopsutil to v3. This fixes a macOS intermittent crash reported by the community [GH-12430](https://github.com/hashicorp/packer/issues/12430) -### HCP Packer -- Multi project support advisory - -If using HCP Packer to store metadata on your builds, please be aware that Packer -does not support this feature yet, and as such, having multiple projects in your -organization will make it impossible to use HCP Packer in this release. - -We are actively working on supporting this feature, which will be available in a -subsequent release. - ## 1.8.7 (May 4, 2023) ### NOTES: diff --git a/Dockerfile b/Dockerfile index 12c38fde6af..1b5ae54e942 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 # ======================================================================== # diff --git a/LICENSE b/LICENSE index 73957dc7d75..c96665ef71f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,61 +1,375 @@ -License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. -“Business Source License” is a trademark of MariaDB Corporation Ab. - -Parameters - -Licensor: 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 such use does not include offering the Licensed Work - to third parties on a hosted or embedded basis which is - competitive with HashiCorp's products. -Change Date: Four years from the date the Licensed Work is published. -Change License: MPL 2.0 - -For information about alternative licensing arrangements for the Licensed Work, -please contact licensing@hashicorp.com. - -Notice - -Business Source License 1.1 - -Terms - -The Licensor hereby grants you the right to copy, modify, create derivative -works, redistribute, and make non-production use of the Licensed Work. The -Licensor may make an Additional Use Grant, above, permitting limited production use. - -Effective on the Change Date, or the fourth anniversary of the first publicly -available distribution of a specific version of the Licensed Work under this -License, whichever comes first, the Licensor hereby grants you rights under -the terms of the Change License, and the rights granted in the paragraph -above terminate. - -If your use of the Licensed Work does not comply with the requirements -currently in effect as described in this License, you must purchase a -commercial license from the Licensor, its affiliated entities, or authorized -resellers, or you must refrain from using the Licensed Work. - -All copies of the original and modified Licensed Work, and derivative works -of the Licensed Work, are subject to this License. This License applies -separately for each version of the Licensed Work and the Change Date may vary -for each version of the Licensed Work released by Licensor. - -You must conspicuously display this License on each original or modified copy -of the Licensed Work. If you receive the Licensed Work in original or -modified form from a third party, the terms and conditions set forth in this -License apply to your use of that work. - -Any use of the Licensed Work in violation of this License will automatically -terminate your rights under this License for the current and all other -versions of the Licensed Work. - -This License does not grant you any right in any trademark or logo of -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, -EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -TITLE. +Copyright (c) 2013 HashiCorp, Inc. + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/acctest/plugin/bundled_plugin_test.go b/acctest/plugin/bundled_plugin_test.go index c6652610955..9f21dfac626 100644 --- a/acctest/plugin/bundled_plugin_test.go +++ b/acctest/plugin/bundled_plugin_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package plugin diff --git a/acctest/plugin/component_acc_test.go b/acctest/plugin/component_acc_test.go index e78c77284c0..e24e4c01492 100644 --- a/acctest/plugin/component_acc_test.go +++ b/acctest/plugin/component_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // component_acc_test.go should contain acceptance tests for plugin components // to make sure all component types can be discovered and started. diff --git a/acctest/plugin/plugin_acc_test.go b/acctest/plugin/plugin_acc_test.go index 6549b2129a3..b83063f15f8 100644 --- a/acctest/plugin/plugin_acc_test.go +++ b/acctest/plugin/plugin_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // plugin_acc_test.go should contain acceptance tests for features related to // installing, discovering and running plugins. diff --git a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl index 7ff2d3127da..b3c4696024d 100644 --- a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl @@ -9,7 +9,7 @@ packer { data "amazon-ami" "test" { filters = { - name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" + name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*" root-device-type = "ebs" virtualization-type = "hvm" } diff --git a/acctest/testing.go b/acctest/testing.go index dd18be1a365..e24b64324f5 100644 --- a/acctest/testing.go +++ b/acctest/testing.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package acctest diff --git a/acctest/testing_test.go b/acctest/testing_test.go index 85364bd1154..71247d4cef7 100644 --- a/acctest/testing_test.go +++ b/acctest/testing_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package acctest diff --git a/background_check.go b/background_check.go index 30a0a65e2d5..3eaf7ee2348 100644 --- a/background_check.go +++ b/background_check.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build !openbsd // +build !openbsd diff --git a/background_check_openbsd.go b/background_check_openbsd.go index 0fc5574ba9c..ff2ef4b0ef2 100644 --- a/background_check_openbsd.go +++ b/background_check_openbsd.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/builder/file/artifact.go b/builder/file/artifact.go index 4c33f6d45a3..9b9ed8ef949 100644 --- a/builder/file/artifact.go +++ b/builder/file/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file diff --git a/builder/file/artifact_test.go b/builder/file/artifact_test.go index 02df6c2ae4e..ea799e12f5f 100644 --- a/builder/file/artifact_test.go +++ b/builder/file/artifact_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file diff --git a/builder/file/builder.go b/builder/file/builder.go index 0f79c958fe8..1e8d7d08fc6 100644 --- a/builder/file/builder.go +++ b/builder/file/builder.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file diff --git a/builder/file/builder_test.go b/builder/file/builder_test.go index 5248318a4dc..ede2e032470 100644 --- a/builder/file/builder_test.go +++ b/builder/file/builder_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file diff --git a/builder/file/config.go b/builder/file/config.go index 244490a36da..017355ee6c7 100644 --- a/builder/file/config.go +++ b/builder/file/config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/builder/file/config_test.go b/builder/file/config_test.go index b6692495b9d..60d3553a1f9 100644 --- a/builder/file/config_test.go +++ b/builder/file/config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file diff --git a/builder/file/version/version.go b/builder/file/version/version.go index 2136829ae88..3cb6b9ec19e 100644 --- a/builder/file/version/version.go +++ b/builder/file/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/builder/null/artifact_export.go b/builder/null/artifact_export.go index 5a685629072..f9ec6d825cd 100644 --- a/builder/null/artifact_export.go +++ b/builder/null/artifact_export.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null diff --git a/builder/null/artifact_export_test.go b/builder/null/artifact_export_test.go index 265b8d36781..ffa668865ec 100644 --- a/builder/null/artifact_export_test.go +++ b/builder/null/artifact_export_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null diff --git a/builder/null/builder.go b/builder/null/builder.go index a9a53dbd7e8..9b660bd24f9 100644 --- a/builder/null/builder.go +++ b/builder/null/builder.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null diff --git a/builder/null/builder_test.go b/builder/null/builder_test.go index fdb52031d7a..b50d1484ff9 100644 --- a/builder/null/builder_test.go +++ b/builder/null/builder_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null diff --git a/builder/null/config.go b/builder/null/config.go index 24ee61ed6fb..b240d57d98d 100644 --- a/builder/null/config.go +++ b/builder/null/config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/builder/null/config_test.go b/builder/null/config_test.go index 67d35f66972..1123d470e09 100644 --- a/builder/null/config_test.go +++ b/builder/null/config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null diff --git a/builder/null/ssh.go b/builder/null/ssh.go index fbffbb13a3c..f79bdd1eed4 100644 --- a/builder/null/ssh.go +++ b/builder/null/ssh.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null diff --git a/builder/null/version/version.go b/builder/null/version/version.go index 27e53e312d1..f3b8cb444e1 100644 --- a/builder/null/version/version.go +++ b/builder/null/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/checkpoint.go b/checkpoint.go index 380cdd6bf29..5ca534ea8d4 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/cmd/generate-fixer-deprecations/main.go b/cmd/generate-fixer-deprecations/main.go index 4316a1605a0..a3e76547428 100644 --- a/cmd/generate-fixer-deprecations/main.go +++ b/cmd/generate-fixer-deprecations/main.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/cmd/ssh-keygen/main.go b/cmd/ssh-keygen/main.go index c29edf76e7e..5a759b165f5 100644 --- a/cmd/ssh-keygen/main.go +++ b/cmd/ssh-keygen/main.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/command/build.go b/command/build.go index c77687c3586..842938adcb9 100644 --- a/command/build.go +++ b/command/build.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/build_cancellation_test.go b/command/build_cancellation_test.go index 0ada639074a..348b1d9180e 100644 --- a/command/build_cancellation_test.go +++ b/command/build_cancellation_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/build_cleanup_script_test.go b/command/build_cleanup_script_test.go index 35639a4f4a9..82f7fdd94e4 100644 --- a/command/build_cleanup_script_test.go +++ b/command/build_cleanup_script_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/build_parallel_test.go b/command/build_parallel_test.go index 4bebc65cee8..09e994e9e5d 100644 --- a/command/build_parallel_test.go +++ b/command/build_parallel_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/build_test.go b/command/build_test.go index de476fdb0c4..f6b8aa06f8b 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/build_timeout_test.go b/command/build_timeout_test.go index d97485b3490..9896894ec2b 100644 --- a/command/build_timeout_test.go +++ b/command/build_timeout_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/build_windows_test.go b/command/build_windows_test.go index b18f4e3153a..5c99cd95786 100644 --- a/command/build_windows_test.go +++ b/command/build_windows_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/cli.go b/command/cli.go index 4ad80440f0e..de47a735c22 100644 --- a/command/cli.go +++ b/command/cli.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/command_test.go b/command/command_test.go index 712e9300496..870cd3a0e20 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/config_file_unix.go b/command/config_file_unix.go index ec3932f9e0b..31a8db0ee44 100644 --- a/command/config_file_unix.go +++ b/command/config_file_unix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build darwin || freebsd || linux || netbsd || openbsd || solaris // +build darwin freebsd linux netbsd openbsd solaris diff --git a/command/config_file_windows.go b/command/config_file_windows.go index ede0a618687..52cdf420c7c 100644 --- a/command/config_file_windows.go +++ b/command/config_file_windows.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build windows // +build windows diff --git a/command/console.go b/command/console.go index f942ec4bd4f..54281fdd6ed 100644 --- a/command/console.go +++ b/command/console.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/console_test.go b/command/console_test.go index 7b4bbc7d7b8..b8c4989ff99 100644 --- a/command/console_test.go +++ b/command/console_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/enumflag/flag.go b/command/enumflag/flag.go index c50e70b0714..cbb58769190 100644 --- a/command/enumflag/flag.go +++ b/command/enumflag/flag.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package enumflag diff --git a/command/exec_test.go b/command/exec_test.go index c4bf24ab157..cfdbda66c3a 100644 --- a/command/exec_test.go +++ b/command/exec_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/fix.go b/command/fix.go index 708be59717d..893c788ef8d 100644 --- a/command/fix.go +++ b/command/fix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/fix_test.go b/command/fix_test.go index 1c916b56b2a..d092a8091c4 100644 --- a/command/fix_test.go +++ b/command/fix_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/flag-kv/flag.go b/command/flag-kv/flag.go index 4361545ab2f..96cda3120ce 100644 --- a/command/flag-kv/flag.go +++ b/command/flag-kv/flag.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package kvflag diff --git a/command/flag-kv/flag_json.go b/command/flag-kv/flag_json.go index 290bb4aa837..25d34ef5de5 100644 --- a/command/flag-kv/flag_json.go +++ b/command/flag-kv/flag_json.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package kvflag diff --git a/command/flag-kv/flag_json_test.go b/command/flag-kv/flag_json_test.go index d22f3545fd5..ab8a67e0ba3 100644 --- a/command/flag-kv/flag_json_test.go +++ b/command/flag-kv/flag_json_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package kvflag diff --git a/command/flag-kv/flag_strings.go b/command/flag-kv/flag_strings.go index f99122ec971..d639bde6abb 100644 --- a/command/flag-kv/flag_strings.go +++ b/command/flag-kv/flag_strings.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package kvflag diff --git a/command/flag-kv/flag_strings_test.go b/command/flag-kv/flag_strings_test.go index 721265d1e52..070e95c0d48 100644 --- a/command/flag-kv/flag_strings_test.go +++ b/command/flag-kv/flag_strings_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package kvflag diff --git a/command/flag-kv/flag_test.go b/command/flag-kv/flag_test.go index 5aed4ef33db..28644119578 100644 --- a/command/flag-kv/flag_test.go +++ b/command/flag-kv/flag_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package kvflag diff --git a/command/flag-slice/flag.go b/command/flag-slice/flag.go index 7f8b9db269c..b75580ec227 100644 --- a/command/flag-slice/flag.go +++ b/command/flag-slice/flag.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package sliceflag diff --git a/command/flag-slice/flag_test.go b/command/flag-slice/flag_test.go index fd225889284..d70b270b53b 100644 --- a/command/flag-slice/flag_test.go +++ b/command/flag-slice/flag_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package sliceflag diff --git a/command/fmt.go b/command/fmt.go index 095a6fc8c69..9cfaa46b8d4 100644 --- a/command/fmt.go +++ b/command/fmt.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/fmt_test.go b/command/fmt_test.go index 7d9f3b11979..516fb6acca9 100644 --- a/command/fmt_test.go +++ b/command/fmt_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index 7802d409875..08b7d2ad745 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index 487d99999cb..353fe4c980d 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/init.go b/command/init.go index 709e8ab0fdf..28b5f1fbbb1 100644 --- a/command/init.go +++ b/command/init.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/init_test.go b/command/init_test.go index 57ab1781d04..cfa1abb47ae 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build amd64 && (darwin || windows || linux) diff --git a/command/inspect.go b/command/inspect.go index 7a77ab76bb8..827d61f70b1 100644 --- a/command/inspect.go +++ b/command/inspect.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/inspect_test.go b/command/inspect_test.go index f417b4cdc09..0d87ee71a71 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/meta.go b/command/meta.go index 1989027499b..fb3d9efb2a7 100644 --- a/command/meta.go +++ b/command/meta.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/plugins.go b/command/plugins.go index 6bc286dd19c..0b415d8f5c0 100644 --- a/command/plugins.go +++ b/command/plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/plugins_install.go b/command/plugins_install.go index 3037c0959d0..31fe7ec665d 100644 --- a/command/plugins_install.go +++ b/command/plugins_install.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/plugins_install_test.go b/command/plugins_install_test.go index 105b9b00067..7f34cb5dddd 100644 --- a/command/plugins_install_test.go +++ b/command/plugins_install_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build amd64 && (darwin || windows || linux) diff --git a/command/plugins_installed.go b/command/plugins_installed.go index b19be4e5c33..bc6175a61a5 100644 --- a/command/plugins_installed.go +++ b/command/plugins_installed.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/plugins_remove.go b/command/plugins_remove.go index 07993f21a4e..592f7cf1716 100644 --- a/command/plugins_remove.go +++ b/command/plugins_remove.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/plugins_remove_test.go b/command/plugins_remove_test.go index 61273487632..83b2463bc02 100644 --- a/command/plugins_remove_test.go +++ b/command/plugins_remove_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build amd64 && (darwin || windows || linux) diff --git a/command/plugins_required.go b/command/plugins_required.go index 04f86b3628c..d484322291c 100644 --- a/command/plugins_required.go +++ b/command/plugins_required.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/signal.go b/command/signal.go index a47ac58aa22..5980192baf4 100644 --- a/command/signal.go +++ b/command/signal.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/test_utils.go b/command/test_utils.go index 852343085cc..41e02dbcb7b 100644 --- a/command/test_utils.go +++ b/command/test_utils.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/utils.go b/command/utils.go index 359a96b9726..9fee02d419c 100644 --- a/command/utils.go +++ b/command/utils.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/utils_test.go b/command/utils_test.go index cf5e2dbe3e7..0d9817aeac2 100644 --- a/command/utils_test.go +++ b/command/utils_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/validate.go b/command/validate.go index 60199bdbf71..2b7e2107b0d 100644 --- a/command/validate.go +++ b/command/validate.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/validate_test.go b/command/validate_test.go index 5b9da04d78b..5b51f378158 100644 --- a/command/validate_test.go +++ b/command/validate_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/vendored_plugins.go b/command/vendored_plugins.go index d412db98bf6..d6e5f836338 100644 --- a/command/vendored_plugins.go +++ b/command/vendored_plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/version.go b/command/version.go index 976221efed5..3a6db86d712 100644 --- a/command/version.go +++ b/command/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/command/version_test.go b/command/version_test.go index 60f97f4f38e..cd2b67e5c6d 100644 --- a/command/version_test.go +++ b/command/version_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command diff --git a/commands.go b/commands.go index 9b2d3ebdf35..01e3bf56e73 100644 --- a/commands.go +++ b/commands.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/config.go b/config.go index 6688d6a74a5..af679dd8e0b 100644 --- a/config.go +++ b/config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/config_test.go b/config_test.go index ac101010c3c..e305a379428 100644 --- a/config_test.go +++ b/config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/datasource/hcp-packer-image/data.go b/datasource/hcp-packer-image/data.go index aba7a6d19bf..3e473e145e4 100644 --- a/datasource/hcp-packer-image/data.go +++ b/datasource/hcp-packer-image/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/datasource/hcp-packer-iteration/data.go b/datasource/hcp-packer-iteration/data.go index ff0bbd46f34..7a7be3e4979 100644 --- a/datasource/hcp-packer-iteration/data.go +++ b/datasource/hcp-packer-iteration/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/datasource/hcp-packer-iteration/data_acc_test.go b/datasource/hcp-packer-iteration/data_acc_test.go index 82e3b78e5f7..bf91e870d7e 100644 --- a/datasource/hcp-packer-iteration/data_acc_test.go +++ b/datasource/hcp-packer-iteration/data_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcp_packer_iteration diff --git a/datasource/http/data.go b/datasource/http/data.go index 58dec04c35b..7790baf15f1 100644 --- a/datasource/http/data.go +++ b/datasource/http/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/datasource/http/data_acc_test.go b/datasource/http/data_acc_test.go index fdf680b8298..8b49b97c6ba 100644 --- a/datasource/http/data_acc_test.go +++ b/datasource/http/data_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package http diff --git a/datasource/null/data.go b/datasource/null/data.go index 90c8064aefd..308e06217d7 100644 --- a/datasource/null/data.go +++ b/datasource/null/data.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type DatasourceOutput,Config diff --git a/fix/fixer.go b/fix/fixer.go index 3fd30cacf11..3de4bc1f814 100644 --- a/fix/fixer.go +++ b/fix/fixer.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_enhanced_networking.go b/fix/fixer_amazon_enhanced_networking.go index f5c0aa15ed0..708d2f5bc30 100644 --- a/fix/fixer_amazon_enhanced_networking.go +++ b/fix/fixer_amazon_enhanced_networking.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_enhanced_networking_test.go b/fix/fixer_amazon_enhanced_networking_test.go index c92293d96dd..4abdcc5f4d1 100644 --- a/fix/fixer_amazon_enhanced_networking_test.go +++ b/fix/fixer_amazon_enhanced_networking_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_private_ip.go b/fix/fixer_amazon_private_ip.go index f2ca9a26948..ee18770b40a 100644 --- a/fix/fixer_amazon_private_ip.go +++ b/fix/fixer_amazon_private_ip.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_private_ip_test.go b/fix/fixer_amazon_private_ip_test.go index 7d78e396b7b..554e2e7ee3b 100644 --- a/fix/fixer_amazon_private_ip_test.go +++ b/fix/fixer_amazon_private_ip_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_shutdown_behavior.go b/fix/fixer_amazon_shutdown_behavior.go index b779fc10766..c7e2db0d315 100644 --- a/fix/fixer_amazon_shutdown_behavior.go +++ b/fix/fixer_amazon_shutdown_behavior.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_shutdown_behavior_test.go b/fix/fixer_amazon_shutdown_behavior_test.go index 5af1f59c5cd..87058ea9054 100644 --- a/fix/fixer_amazon_shutdown_behavior_test.go +++ b/fix/fixer_amazon_shutdown_behavior_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_spot_price_product.go b/fix/fixer_amazon_spot_price_product.go index 7c49afeb9ce..b701e1d9f59 100644 --- a/fix/fixer_amazon_spot_price_product.go +++ b/fix/fixer_amazon_spot_price_product.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_temporary_security_group_cidrs.go b/fix/fixer_amazon_temporary_security_group_cidrs.go index bd9a9b019b8..ffd75eb364d 100644 --- a/fix/fixer_amazon_temporary_security_group_cidrs.go +++ b/fix/fixer_amazon_temporary_security_group_cidrs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_amazon_temporary_security_group_cidrs_test.go b/fix/fixer_amazon_temporary_security_group_cidrs_test.go index 28dac694904..2ed9f4bb261 100644 --- a/fix/fixer_amazon_temporary_security_group_cidrs_test.go +++ b/fix/fixer_amazon_temporary_security_group_cidrs_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_azure_exclude_from_latest.go b/fix/fixer_azure_exclude_from_latest.go index b85f1da6d67..210b59f46ac 100644 --- a/fix/fixer_azure_exclude_from_latest.go +++ b/fix/fixer_azure_exclude_from_latest.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_azure_exclude_from_latest_test.go b/fix/fixer_azure_exclude_from_latest_test.go index e7e16e9bde8..a3cd70d538d 100644 --- a/fix/fixer_azure_exclude_from_latest_test.go +++ b/fix/fixer_azure_exclude_from_latest_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_clean_image_name.go b/fix/fixer_clean_image_name.go index 981e2e36f41..423d2e34035 100644 --- a/fix/fixer_clean_image_name.go +++ b/fix/fixer_clean_image_name.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_clean_image_name_test.go b/fix/fixer_clean_image_name_test.go index 7a95ac2a0f1..385e6f113df 100644 --- a/fix/fixer_clean_image_name_test.go +++ b/fix/fixer_clean_image_name_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_comm_config.go b/fix/fixer_comm_config.go index 3d02fcdac33..6f2c49af8e7 100644 --- a/fix/fixer_comm_config.go +++ b/fix/fixer_comm_config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_comm_config_test.go b/fix/fixer_comm_config_test.go index c0e22bb7e06..52beb052de1 100644 --- a/fix/fixer_comm_config_test.go +++ b/fix/fixer_comm_config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_createtime.go b/fix/fixer_createtime.go index 345ec750242..0412c4d9afb 100644 --- a/fix/fixer_createtime.go +++ b/fix/fixer_createtime.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_createtime_test.go b/fix/fixer_createtime_test.go index 9c78b525ac0..a7350966812 100644 --- a/fix/fixer_createtime_test.go +++ b/fix/fixer_createtime_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_docker_email.go b/fix/fixer_docker_email.go index 6a644210cef..3a5883f2b9b 100644 --- a/fix/fixer_docker_email.go +++ b/fix/fixer_docker_email.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_galaxy_command.go b/fix/fixer_galaxy_command.go index df36558275b..f5988d9bc27 100644 --- a/fix/fixer_galaxy_command.go +++ b/fix/fixer_galaxy_command.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_galaxy_command_test.go b/fix/fixer_galaxy_command_test.go index 125039240c8..ee067b174fa 100644 --- a/fix/fixer_galaxy_command_test.go +++ b/fix/fixer_galaxy_command_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_hyperv_cpu_and_ram_naming.go b/fix/fixer_hyperv_cpu_and_ram_naming.go index 3c655bb2ecd..4983b5cb4fc 100644 --- a/fix/fixer_hyperv_cpu_and_ram_naming.go +++ b/fix/fixer_hyperv_cpu_and_ram_naming.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_hyperv_deprecations.go b/fix/fixer_hyperv_deprecations.go index 191a8f0d8df..12714d9d71b 100644 --- a/fix/fixer_hyperv_deprecations.go +++ b/fix/fixer_hyperv_deprecations.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_hyperv_deprecations_test.go b/fix/fixer_hyperv_deprecations_test.go index 1f9672d42ed..00154e2b9a4 100644 --- a/fix/fixer_hyperv_deprecations_test.go +++ b/fix/fixer_hyperv_deprecations_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_hyperv_vmxc_typo.go b/fix/fixer_hyperv_vmxc_typo.go index c2c57fe8071..f9c5d63d969 100644 --- a/fix/fixer_hyperv_vmxc_typo.go +++ b/fix/fixer_hyperv_vmxc_typo.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_hyperv_vmxc_typo_test.go b/fix/fixer_hyperv_vmxc_typo_test.go index c88a1d40d8b..1f7ac625a0b 100644 --- a/fix/fixer_hyperv_vmxc_typo_test.go +++ b/fix/fixer_hyperv_vmxc_typo_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_iso_checksum_type_and_url.go b/fix/fixer_iso_checksum_type_and_url.go index df61844fa61..fc50055ac7e 100644 --- a/fix/fixer_iso_checksum_type_and_url.go +++ b/fix/fixer_iso_checksum_type_and_url.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_iso_checksum_type_and_url_test.go b/fix/fixer_iso_checksum_type_and_url_test.go index 556ab966391..f3492dc50cb 100644 --- a/fix/fixer_iso_checksum_type_and_url_test.go +++ b/fix/fixer_iso_checksum_type_and_url_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_iso_md5.go b/fix/fixer_iso_md5.go index 3d6acb86aa5..074a0b2bab3 100644 --- a/fix/fixer_iso_md5.go +++ b/fix/fixer_iso_md5.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_iso_md5_test.go b/fix/fixer_iso_md5_test.go index 106fff6096c..fc396507977 100644 --- a/fix/fixer_iso_md5_test.go +++ b/fix/fixer_iso_md5_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_parallels_deprecations.go b/fix/fixer_parallels_deprecations.go index b287f58f003..36ad9a708eb 100644 --- a/fix/fixer_parallels_deprecations.go +++ b/fix/fixer_parallels_deprecations.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_parallels_deprecations_test.go b/fix/fixer_parallels_deprecations_test.go index 584129693d5..a5fd425385d 100644 --- a/fix/fixer_parallels_deprecations_test.go +++ b/fix/fixer_parallels_deprecations_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_parallels_headless.go b/fix/fixer_parallels_headless.go index cd645df1181..164deff3ea0 100644 --- a/fix/fixer_parallels_headless.go +++ b/fix/fixer_parallels_headless.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_parallels_headless_test.go b/fix/fixer_parallels_headless_test.go index 62f5654bb27..bc3efbcc0e7 100644 --- a/fix/fixer_parallels_headless_test.go +++ b/fix/fixer_parallels_headless_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_powershell_escapes.go b/fix/fixer_powershell_escapes.go index a96bc35fd99..d33d046d628 100644 --- a/fix/fixer_powershell_escapes.go +++ b/fix/fixer_powershell_escapes.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_pp_docker_tag_tags.go b/fix/fixer_pp_docker_tag_tags.go index e21a9c26dfb..49e33ebee91 100644 --- a/fix/fixer_pp_docker_tag_tags.go +++ b/fix/fixer_pp_docker_tag_tags.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_pp_docker_tag_tags_test.go b/fix/fixer_pp_docker_tag_tags_test.go index 97b600bbc3a..908c0768efb 100644 --- a/fix/fixer_pp_docker_tag_tags_test.go +++ b/fix/fixer_pp_docker_tag_tags_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_pp_manifest_filename.go b/fix/fixer_pp_manifest_filename.go index a9447d74050..9f66bc7ad2e 100644 --- a/fix/fixer_pp_manifest_filename.go +++ b/fix/fixer_pp_manifest_filename.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_pp_manifest_filename_test.go b/fix/fixer_pp_manifest_filename_test.go index 95eaeae68a3..ab86324e906 100644 --- a/fix/fixer_pp_manifest_filename_test.go +++ b/fix/fixer_pp_manifest_filename_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_pp_vagrant_override.go b/fix/fixer_pp_vagrant_override.go index c70ab1f5929..eee262212c8 100644 --- a/fix/fixer_pp_vagrant_override.go +++ b/fix/fixer_pp_vagrant_override.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_pp_vagrant_override_test.go b/fix/fixer_pp_vagrant_override_test.go index 29f7edba658..1ba56eb6821 100644 --- a/fix/fixer_pp_vagrant_override_test.go +++ b/fix/fixer_pp_vagrant_override_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_proxmox_type.go b/fix/fixer_proxmox_type.go index 5c08a35631b..602e82a9435 100644 --- a/fix/fixer_proxmox_type.go +++ b/fix/fixer_proxmox_type.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_proxmox_type_test.go b/fix/fixer_proxmox_type_test.go index 53b9d855c8e..e0ea378d572 100644 --- a/fix/fixer_proxmox_type_test.go +++ b/fix/fixer_proxmox_type_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_qemu_disk_size.go b/fix/fixer_qemu_disk_size.go index 5fd4184e571..7cd53800393 100644 --- a/fix/fixer_qemu_disk_size.go +++ b/fix/fixer_qemu_disk_size.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_qemu_disk_size_test.go b/fix/fixer_qemu_disk_size_test.go index a05e6f75239..3d141a5195c 100644 --- a/fix/fixer_qemu_disk_size_test.go +++ b/fix/fixer_qemu_disk_size_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_qemu_host_port.go b/fix/fixer_qemu_host_port.go index 1b92b04b316..4cd96b53ac1 100644 --- a/fix/fixer_qemu_host_port.go +++ b/fix/fixer_qemu_host_port.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_qemu_host_port_test.go b/fix/fixer_qemu_host_port_test.go index 7a9bf529c00..64aaeddcbb7 100644 --- a/fix/fixer_qemu_host_port_test.go +++ b/fix/fixer_qemu_host_port_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_scaleway_access_key.go b/fix/fixer_scaleway_access_key.go index cf9e173928a..c7e45484fab 100644 --- a/fix/fixer_scaleway_access_key.go +++ b/fix/fixer_scaleway_access_key.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_scaleway_access_key_test.go b/fix/fixer_scaleway_access_key_test.go index a91f1886cad..365bb467533 100644 --- a/fix/fixer_scaleway_access_key_test.go +++ b/fix/fixer_scaleway_access_key_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_ssh_timeout.go b/fix/fixer_ssh_timeout.go index d73b47d66e8..fc675199912 100644 --- a/fix/fixer_ssh_timeout.go +++ b/fix/fixer_ssh_timeout.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_ssh_timeout_test.go b/fix/fixer_ssh_timeout_test.go index 0c89b7cf7b3..558a94d9e23 100644 --- a/fix/fixer_ssh_timeout_test.go +++ b/fix/fixer_ssh_timeout_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_sshdisableagent.go b/fix/fixer_sshdisableagent.go index aa36504f010..1ed262f225c 100644 --- a/fix/fixer_sshdisableagent.go +++ b/fix/fixer_sshdisableagent.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_sshdisableagent_test.go b/fix/fixer_sshdisableagent_test.go index 1c5ecc38c87..9fc67bd763e 100644 --- a/fix/fixer_sshdisableagent_test.go +++ b/fix/fixer_sshdisableagent_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_sshkeypath.go b/fix/fixer_sshkeypath.go index 6c2f8ee0367..48bc8eee198 100644 --- a/fix/fixer_sshkeypath.go +++ b/fix/fixer_sshkeypath.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_sshkeypath_test.go b/fix/fixer_sshkeypath_test.go index 561db0ef788..c95917902a1 100644 --- a/fix/fixer_sshkeypath_test.go +++ b/fix/fixer_sshkeypath_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_test.go b/fix/fixer_test.go index 2b09611521b..091084ac794 100644 --- a/fix/fixer_test.go +++ b/fix/fixer_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_virtualbox_gaattach.go b/fix/fixer_virtualbox_gaattach.go index 5fc0834c72b..23e8c7fdff2 100644 --- a/fix/fixer_virtualbox_gaattach.go +++ b/fix/fixer_virtualbox_gaattach.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_virtualbox_gaattach_test.go b/fix/fixer_virtualbox_gaattach_test.go index 62aa5b159a8..83fa00b59e7 100644 --- a/fix/fixer_virtualbox_gaattach_test.go +++ b/fix/fixer_virtualbox_gaattach_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_virtualbox_rename.go b/fix/fixer_virtualbox_rename.go index 86d53fd1ff4..a3723f2ed27 100644 --- a/fix/fixer_virtualbox_rename.go +++ b/fix/fixer_virtualbox_rename.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_virtualbox_rename_test.go b/fix/fixer_virtualbox_rename_test.go index 932975bd0a6..fc570f3095b 100644 --- a/fix/fixer_virtualbox_rename_test.go +++ b/fix/fixer_virtualbox_rename_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_vmware_compaction.go b/fix/fixer_vmware_compaction.go index cc833186dd1..906ff4d197d 100644 --- a/fix/fixer_vmware_compaction.go +++ b/fix/fixer_vmware_compaction.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_vmware_compaction_test.go b/fix/fixer_vmware_compaction_test.go index eb5494a3159..bd107705544 100644 --- a/fix/fixer_vmware_compaction_test.go +++ b/fix/fixer_vmware_compaction_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_vmware_rename.go b/fix/fixer_vmware_rename.go index c81e01b8577..5e7db8a6ed8 100644 --- a/fix/fixer_vmware_rename.go +++ b/fix/fixer_vmware_rename.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_vmware_rename_test.go b/fix/fixer_vmware_rename_test.go index 4c2cb095dc3..6d8710cfb74 100644 --- a/fix/fixer_vmware_rename_test.go +++ b/fix/fixer_vmware_rename_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_vsphere_network_storage.go b/fix/fixer_vsphere_network_storage.go index f82bc20463e..87723a9e9fc 100644 --- a/fix/fixer_vsphere_network_storage.go +++ b/fix/fixer_vsphere_network_storage.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/fixer_vsphere_network_storage_test.go b/fix/fixer_vsphere_network_storage_test.go index 59e4bbf1c62..54ebb8015e1 100644 --- a/fix/fixer_vsphere_network_storage_test.go +++ b/fix/fixer_vsphere_network_storage_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/fix/helpers.go b/fix/helpers.go index d4d01b22123..f3812674e3c 100644 --- a/fix/helpers.go +++ b/fix/helpers.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package fix diff --git a/go b/go deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/hcl2template/addrs/doc.go b/hcl2template/addrs/doc.go index 783284822ba..9768f453d12 100644 --- a/hcl2template/addrs/doc.go +++ b/hcl2template/addrs/doc.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package addrs contains types that represent "addresses", which are // references to specific objects within a Packer configuration. diff --git a/hcl2template/addrs/input_variable.go b/hcl2template/addrs/input_variable.go index 9ffbf6fb0a4..e2821e7e5b1 100644 --- a/hcl2template/addrs/input_variable.go +++ b/hcl2template/addrs/input_variable.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package addrs diff --git a/hcl2template/addrs/parse_ref.go b/hcl2template/addrs/parse_ref.go index 3f6c7320179..866ced8f459 100644 --- a/hcl2template/addrs/parse_ref.go +++ b/hcl2template/addrs/parse_ref.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package addrs diff --git a/hcl2template/addrs/plugin.go b/hcl2template/addrs/plugin.go index 9db29b31717..8b4891044fc 100644 --- a/hcl2template/addrs/plugin.go +++ b/hcl2template/addrs/plugin.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package addrs diff --git a/hcl2template/addrs/plugin_test.go b/hcl2template/addrs/plugin_test.go index e99a72416b8..491d2221a1c 100644 --- a/hcl2template/addrs/plugin_test.go +++ b/hcl2template/addrs/plugin_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package addrs diff --git a/hcl2template/addrs/referenceable.go b/hcl2template/addrs/referenceable.go index 2b11d6008bc..9b54c5bac49 100644 --- a/hcl2template/addrs/referenceable.go +++ b/hcl2template/addrs/referenceable.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package addrs diff --git a/hcl2template/common_test.go b/hcl2template/common_test.go index 831ce5d3596..cb37a7bf996 100644 --- a/hcl2template/common_test.go +++ b/hcl2template/common_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/components.go b/hcl2template/components.go index e83f8b3768d..956a753f38b 100644 --- a/hcl2template/components.go +++ b/hcl2template/components.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/decode.go b/hcl2template/decode.go index 1dcd34c55ce..137e54eec05 100644 --- a/hcl2template/decode.go +++ b/hcl2template/decode.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/docs.go b/hcl2template/docs.go index cf970f2e8e1..2b19f42b029 100644 --- a/hcl2template/docs.go +++ b/hcl2template/docs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package hcl2template defines code to parse hcl2 template files. // diff --git a/hcl2template/formatter.go b/hcl2template/formatter.go index c04bb114748..171d919b89a 100644 --- a/hcl2template/formatter.go +++ b/hcl2template/formatter.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/formatter_test.go b/hcl2template/formatter_test.go index 8cb909292a9..07fc88c5a0f 100644 --- a/hcl2template/formatter_test.go +++ b/hcl2template/formatter_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/function/Consul.go b/hcl2template/function/Consul.go index e1e51b2299b..4f51ca41d15 100644 --- a/hcl2template/function/Consul.go +++ b/hcl2template/function/Consul.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/aws_secretetkey.go b/hcl2template/function/aws_secretetkey.go index 4684c9bf2d2..50b4fe9ee53 100644 --- a/hcl2template/function/aws_secretetkey.go +++ b/hcl2template/function/aws_secretetkey.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/datetime.go b/hcl2template/function/datetime.go index 066db18db39..1d807e407d3 100644 --- a/hcl2template/function/datetime.go +++ b/hcl2template/function/datetime.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/datetime_test.go b/hcl2template/function/datetime_test.go index 416b6fa23f3..686564803cc 100644 --- a/hcl2template/function/datetime_test.go +++ b/hcl2template/function/datetime_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/env.go b/hcl2template/function/env.go index 34c09a8b921..aeb632aba75 100644 --- a/hcl2template/function/env.go +++ b/hcl2template/function/env.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/index.go b/hcl2template/function/index.go index cb4f0c51921..3c5f73ccda9 100644 --- a/hcl2template/function/index.go +++ b/hcl2template/function/index.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/index_test.go b/hcl2template/function/index_test.go index 0a46da34ce8..d70511ad516 100644 --- a/hcl2template/function/index_test.go +++ b/hcl2template/function/index_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/length.go b/hcl2template/function/length.go index 23b5969af10..90ab7997ec9 100644 --- a/hcl2template/function/length.go +++ b/hcl2template/function/length.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/length_test.go b/hcl2template/function/length_test.go index 0a68c126c51..2c6f10c49d6 100644 --- a/hcl2template/function/length_test.go +++ b/hcl2template/function/length_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/templatefile.go b/hcl2template/function/templatefile.go index 0b927cf834a..eee0092197c 100644 --- a/hcl2template/function/templatefile.go +++ b/hcl2template/function/templatefile.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/templatefile_test.go b/hcl2template/function/templatefile_test.go index f12967dd3c5..a4536b59ca5 100644 --- a/hcl2template/function/templatefile_test.go +++ b/hcl2template/function/templatefile_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/function/vault.go b/hcl2template/function/vault.go index 3b9c092442e..4aa49da6753 100644 --- a/hcl2template/function/vault.go +++ b/hcl2template/function/vault.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function diff --git a/hcl2template/functions.go b/hcl2template/functions.go index c74754bdf90..cc144940cf6 100644 --- a/hcl2template/functions.go +++ b/hcl2template/functions.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/internal/mock.go b/hcl2template/internal/mock.go index 4d3adb14ae5..86d5b0e0e06 100644 --- a/hcl2template/internal/mock.go +++ b/hcl2template/internal/mock.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag diff --git a/hcl2template/parser.go b/hcl2template/parser.go index c372a7733a9..f32df189242 100644 --- a/hcl2template/parser.go +++ b/hcl2template/parser.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/plugin.go b/hcl2template/plugin.go index 323263596f8..ac109ee7911 100644 --- a/hcl2template/plugin.go +++ b/hcl2template/plugin.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/repl/format.go b/hcl2template/repl/format.go index 8d99a4392d0..8e596e4be9d 100644 --- a/hcl2template/repl/format.go +++ b/hcl2template/repl/format.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package repl diff --git a/hcl2template/repl/repl.go b/hcl2template/repl/repl.go index eb13353eed0..7a698f87f5b 100644 --- a/hcl2template/repl/repl.go +++ b/hcl2template/repl/repl.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package repl provides the structs and functions necessary to run REPL for // HCL2. The REPL allows experimentation of HCL2 interpolations without having diff --git a/hcl2template/shim/mock.go b/hcl2template/shim/mock.go index 40fdbca4d32..adeda84dd39 100644 --- a/hcl2template/shim/mock.go +++ b/hcl2template/shim/mock.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag diff --git a/hcl2template/shim/values.go b/hcl2template/shim/values.go index 096c8c23d56..88580f1f2c1 100644 --- a/hcl2template/shim/values.go +++ b/hcl2template/shim/values.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2shim diff --git a/hcl2template/shim/values_test.go b/hcl2template/shim/values_test.go index 4449e711bc9..46e154002cd 100644 --- a/hcl2template/shim/values_test.go +++ b/hcl2template/shim/values_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2shim diff --git a/hcl2template/types.build.from.go b/hcl2template/types.build.from.go index fb1544ef53a..9661fa167b0 100644 --- a/hcl2template/types.build.from.go +++ b/hcl2template/types.build.from.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build.go b/hcl2template/types.build.go index 648305ee202..2ab6aa718fe 100644 --- a/hcl2template/types.build.go +++ b/hcl2template/types.build.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build.hcp_packer_registry.go b/hcl2template/types.build.hcp_packer_registry.go index b64b3ff4e55..6d1b99f2ec9 100644 --- a/hcl2template/types.build.hcp_packer_registry.go +++ b/hcl2template/types.build.hcp_packer_registry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build.hcp_packer_registry_test.go b/hcl2template/types.build.hcp_packer_registry_test.go index 3ada389c29d..18c8ca3fa34 100644 --- a/hcl2template/types.build.hcp_packer_registry_test.go +++ b/hcl2template/types.build.hcp_packer_registry_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build.post-processor.go b/hcl2template/types.build.post-processor.go index 8844eadff11..1216f32ebfd 100644 --- a/hcl2template/types.build.post-processor.go +++ b/hcl2template/types.build.post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build.provisioners.go b/hcl2template/types.build.provisioners.go index b08eca59f63..8459f1be921 100644 --- a/hcl2template/types.build.provisioners.go +++ b/hcl2template/types.build.provisioners.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build.provisioners_test.go b/hcl2template/types.build.provisioners_test.go index 284651f2cbd..e19570dff29 100644 --- a/hcl2template/types.build.provisioners_test.go +++ b/hcl2template/types.build.provisioners_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.build_test.go b/hcl2template/types.build_test.go index 8647821dd18..376646c6376 100644 --- a/hcl2template/types.build_test.go +++ b/hcl2template/types.build_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.datasource.go b/hcl2template/types.datasource.go index 348d06f452c..fd21585fdc3 100644 --- a/hcl2template/types.datasource.go +++ b/hcl2template/types.datasource.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.datasource_test.go b/hcl2template/types.datasource_test.go index d12fcafd076..b22f438d64b 100644 --- a/hcl2template/types.datasource_test.go +++ b/hcl2template/types.datasource_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.hcl_post-processor.go b/hcl2template/types.hcl_post-processor.go index b9d200758de..26974aacedf 100644 --- a/hcl2template/types.hcl_post-processor.go +++ b/hcl2template/types.hcl_post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.hcl_provisioner.go b/hcl2template/types.hcl_provisioner.go index b607a0092a2..022a2fd58d1 100644 --- a/hcl2template/types.hcl_provisioner.go +++ b/hcl2template/types.hcl_provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.hcl_ref.go b/hcl2template/types.hcl_ref.go index f3e6176dbf1..091a2043610 100644 --- a/hcl2template/types.hcl_ref.go +++ b/hcl2template/types.hcl_ref.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index c9beb67bd0a..ef23c7db954 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.packer_config_test.go b/hcl2template/types.packer_config_test.go index 5eae6a2f21f..d8881c18415 100644 --- a/hcl2template/types.packer_config_test.go +++ b/hcl2template/types.packer_config_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.required_plugins.go b/hcl2template/types.required_plugins.go index d5e010345ea..179434c29f0 100644 --- a/hcl2template/types.required_plugins.go +++ b/hcl2template/types.required_plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.required_plugins_test.go b/hcl2template/types.required_plugins_test.go index 0329d1505ff..7d832c4788f 100644 --- a/hcl2template/types.required_plugins_test.go +++ b/hcl2template/types.required_plugins_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.source.go b/hcl2template/types.source.go index 46b9caac98e..1ea939d015f 100644 --- a/hcl2template/types.source.go +++ b/hcl2template/types.source.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.source_test.go b/hcl2template/types.source_test.go index 47caeec5a75..efdddea5abe 100644 --- a/hcl2template/types.source_test.go +++ b/hcl2template/types.source_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.variables.go b/hcl2template/types.variables.go index 33df28a84ee..9111ced9a44 100644 --- a/hcl2template/types.variables.go +++ b/hcl2template/types.variables.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/types.variables_test.go b/hcl2template/types.variables_test.go index a19b80bd990..d0691a0910c 100644 --- a/hcl2template/types.variables_test.go +++ b/hcl2template/types.variables_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/utils.go b/hcl2template/utils.go index 98546a95456..1503eb35c9a 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/version.go b/hcl2template/version.go index f6f584a69a5..920cff51031 100644 --- a/hcl2template/version.go +++ b/hcl2template/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/hcl2template/version_required.go b/hcl2template/version_required.go index f8c67228bfb..c418eda550a 100644 --- a/hcl2template/version_required.go +++ b/hcl2template/version_required.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template diff --git a/helper/wrappedreadline/wrappedreadline.go b/helper/wrappedreadline/wrappedreadline.go index 9d4bd7fcf25..6641cb8960b 100644 --- a/helper/wrappedreadline/wrappedreadline.go +++ b/helper/wrappedreadline/wrappedreadline.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. diff --git a/helper/wrappedreadline/wrappedreadline_solaris.go b/helper/wrappedreadline/wrappedreadline_solaris.go index 55eac364548..fb2a9388e00 100644 --- a/helper/wrappedreadline/wrappedreadline_solaris.go +++ b/helper/wrappedreadline/wrappedreadline_solaris.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package wrappedreadline diff --git a/helper/wrappedreadline/wrappedreadline_unix.go b/helper/wrappedreadline/wrappedreadline_unix.go index 7d01bb3a99e..ff621e7da9e 100644 --- a/helper/wrappedreadline/wrappedreadline_unix.go +++ b/helper/wrappedreadline/wrappedreadline_unix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build darwin || dragonfly || freebsd || (linux && !appengine) || netbsd || openbsd // +build darwin dragonfly freebsd linux,!appengine netbsd openbsd diff --git a/helper/wrappedreadline/wrappedreadline_windows.go b/helper/wrappedreadline/wrappedreadline_windows.go index 88d04a06ab8..d3d361579f1 100644 --- a/helper/wrappedreadline/wrappedreadline_windows.go +++ b/helper/wrappedreadline/wrappedreadline_windows.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build windows // +build windows diff --git a/helper/wrappedstreams/streams.go b/helper/wrappedstreams/streams.go index 1b18abf1958..80d1e66b259 100644 --- a/helper/wrappedstreams/streams.go +++ b/helper/wrappedstreams/streams.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. diff --git a/helper/wrappedstreams/streams_other.go b/helper/wrappedstreams/streams_other.go index 98045b535da..34ecf76d06a 100644 --- a/helper/wrappedstreams/streams_other.go +++ b/helper/wrappedstreams/streams_other.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build !windows // +build !windows diff --git a/helper/wrappedstreams/streams_windows.go b/helper/wrappedstreams/streams_windows.go index 5a0d01de4fc..18489fdc268 100644 --- a/helper/wrappedstreams/streams_windows.go +++ b/helper/wrappedstreams/streams_windows.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build windows // +build windows diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index 5c8c851ae40..f28999d57b6 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package api provides access to the HCP Packer Registry API. package api diff --git a/internal/hcp/api/client_test.go b/internal/hcp/api/client_test.go index bb952375bf9..16d321beb77 100644 --- a/internal/hcp/api/client_test.go +++ b/internal/hcp/api/client_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package api diff --git a/internal/hcp/api/errors.go b/internal/hcp/api/errors.go index cff55fc9e09..32a5708cc14 100644 --- a/internal/hcp/api/errors.go +++ b/internal/hcp/api/errors.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package api diff --git a/internal/hcp/api/mock_service.go b/internal/hcp/api/mock_service.go index f9b427cbf29..9a126346e06 100644 --- a/internal/hcp/api/mock_service.go +++ b/internal/hcp/api/mock_service.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package api diff --git a/internal/hcp/api/service.go b/internal/hcp/api/service.go index df56bdbd58c..a0ee9f8ce4c 100644 --- a/internal/hcp/api/service.go +++ b/internal/hcp/api/service.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package api diff --git a/internal/hcp/env/env.go b/internal/hcp/env/env.go index 972fd68f77e..0186be1671f 100644 --- a/internal/hcp/env/env.go +++ b/internal/hcp/env/env.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package env provides HCP Packer environment variables. package env diff --git a/internal/hcp/env/env_test.go b/internal/hcp/env/env_test.go index a773b41c928..1de73f5913d 100644 --- a/internal/hcp/env/env_test.go +++ b/internal/hcp/env/env_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package env diff --git a/internal/hcp/env/variables.go b/internal/hcp/env/variables.go index a8c1a493e13..8c74b600d47 100644 --- a/internal/hcp/env/variables.go +++ b/internal/hcp/env/variables.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package env diff --git a/internal/hcp/registry/artifact.go b/internal/hcp/registry/artifact.go index 7257d302f3d..a0b0049cc9f 100644 --- a/internal/hcp/registry/artifact.go +++ b/internal/hcp/registry/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/errors.go b/internal/hcp/registry/errors.go index 8bc458d241b..a93f960f996 100644 --- a/internal/hcp/registry/errors.go +++ b/internal/hcp/registry/errors.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/hcl.go b/internal/hcp/registry/hcl.go index 531fd648c7e..64c57a51761 100644 --- a/internal/hcp/registry/hcl.go +++ b/internal/hcp/registry/hcl.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/hcp.go b/internal/hcp/registry/hcp.go index c0d12726e2d..838350b7641 100644 --- a/internal/hcp/registry/hcp.go +++ b/internal/hcp/registry/hcp.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/json.go b/internal/hcp/registry/json.go index 92aa6db904c..bb0bba14674 100644 --- a/internal/hcp/registry/json.go +++ b/internal/hcp/registry/json.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/null_registry.go b/internal/hcp/registry/null_registry.go index f7dbcdf0970..5aee3e6bcd1 100644 --- a/internal/hcp/registry/null_registry.go +++ b/internal/hcp/registry/null_registry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/registry.go b/internal/hcp/registry/registry.go index 35485a8993e..b095e14ea2f 100644 --- a/internal/hcp/registry/registry.go +++ b/internal/hcp/registry/registry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package registry provides access to the HCP registry. package registry diff --git a/internal/hcp/registry/types.bucket.go b/internal/hcp/registry/types.bucket.go index d4239f45005..7e548643a65 100644 --- a/internal/hcp/registry/types.bucket.go +++ b/internal/hcp/registry/types.bucket.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/types.bucket_service_test.go b/internal/hcp/registry/types.bucket_service_test.go index 6503b95fb02..5fa28ac4e93 100644 --- a/internal/hcp/registry/types.bucket_service_test.go +++ b/internal/hcp/registry/types.bucket_service_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/types.bucket_test.go b/internal/hcp/registry/types.bucket_test.go index 9c1467ad714..30f73dec51c 100644 --- a/internal/hcp/registry/types.bucket_test.go +++ b/internal/hcp/registry/types.bucket_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/types.builds.go b/internal/hcp/registry/types.builds.go index 991ef563a00..9245a9d3141 100644 --- a/internal/hcp/registry/types.builds.go +++ b/internal/hcp/registry/types.builds.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/types.iterations.go b/internal/hcp/registry/types.iterations.go index c186a2a256d..b9ffc232243 100644 --- a/internal/hcp/registry/types.iterations.go +++ b/internal/hcp/registry/types.iterations.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/internal/hcp/registry/types.iterations_test.go b/internal/hcp/registry/types.iterations_test.go index 27e87b5798f..fe7132d6b36 100644 --- a/internal/hcp/registry/types.iterations_test.go +++ b/internal/hcp/registry/types.iterations_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package registry diff --git a/log.go b/log.go index 72744bc3dd5..2c15a700a16 100644 --- a/log.go +++ b/log.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/main.go b/main.go index fe902f5bdb3..59af0a7b580 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // This is the main package for the `packer` application. @@ -251,16 +251,6 @@ func wrappedMain() int { Ui: ui, } - //versionCLIHelper shortcuts "--version" and "-v" to just show the version - versionCLIHelper := &cli.CLI{ - Args: args, - Version: version.Version, - } - if versionCLIHelper.IsVersion() && versionCLIHelper.Version != "" { - // by default version flags ignore all other args so there is no need to persist the original args. - args = []string{"version"} - } - cli := &cli.CLI{ Args: args, Autocomplete: true, diff --git a/main_test.go b/main_test.go index b71319e9dea..69be0aca87e 100644 --- a/main_test.go +++ b/main_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/packer/build.go b/packer/build.go index e51e71d00c9..3309bb194d5 100644 --- a/packer/build.go +++ b/packer/build.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/build_test.go b/packer/build_test.go index c15eec5b570..86531d8ca4b 100644 --- a/packer/build_test.go +++ b/packer/build_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/builder_test.go b/packer/builder_test.go index 85b7eaf5f08..1276552788b 100644 --- a/packer/builder_test.go +++ b/packer/builder_test.go @@ -1,4 +1,4 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/client_test.go b/packer/client_test.go index c914a3edaed..8656537e269 100644 --- a/packer/client_test.go +++ b/packer/client_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_builder.go b/packer/cmd_builder.go index 8b472d1fb24..99a0bc6f913 100644 --- a/packer/cmd_builder.go +++ b/packer/cmd_builder.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_builder_test.go b/packer/cmd_builder_test.go index a47bcea31b8..dfc5d15fb99 100644 --- a/packer/cmd_builder_test.go +++ b/packer/cmd_builder_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_datasource.go b/packer/cmd_datasource.go index 0e2d6b79892..4e8b32561ed 100644 --- a/packer/cmd_datasource.go +++ b/packer/cmd_datasource.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_datasource_test.go b/packer/cmd_datasource_test.go index 1616b218cf7..c174c8ee02b 100644 --- a/packer/cmd_datasource_test.go +++ b/packer/cmd_datasource_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_hook.go b/packer/cmd_hook.go index f3973a98a0d..ace3d2c032d 100644 --- a/packer/cmd_hook.go +++ b/packer/cmd_hook.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_hook_test.go b/packer/cmd_hook_test.go index ed149c5af7c..f2a1f4d9246 100644 --- a/packer/cmd_hook_test.go +++ b/packer/cmd_hook_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_post_processor.go b/packer/cmd_post_processor.go index 139c9133390..c686a3937ef 100644 --- a/packer/cmd_post_processor.go +++ b/packer/cmd_post_processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_post_processor_test.go b/packer/cmd_post_processor_test.go index 3c69d899f6b..ce70a8bf125 100644 --- a/packer/cmd_post_processor_test.go +++ b/packer/cmd_post_processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_provisioner.go b/packer/cmd_provisioner.go index 335b7bd97ec..965ad89587f 100644 --- a/packer/cmd_provisioner.go +++ b/packer/cmd_provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/cmd_provisioner_test.go b/packer/cmd_provisioner_test.go index 6c2005b9354..5bb86942ace 100644 --- a/packer/cmd_provisioner_test.go +++ b/packer/cmd_provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/core.go b/packer/core.go index 732f026360f..b711af080bc 100644 --- a/packer/core.go +++ b/packer/core.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/core_test.go b/packer/core_test.go index b1694cbf86c..e46f62e6b0e 100644 --- a/packer/core_test.go +++ b/packer/core_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/maps.go b/packer/maps.go index 1d99802dfef..6fec5c67950 100644 --- a/packer/maps.go +++ b/packer/maps.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/packer_test.go b/packer/packer_test.go index 2f52c5e76d2..bc75903397b 100644 --- a/packer/packer_test.go +++ b/packer/packer_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/plugin-getter/checksum.go b/packer/plugin-getter/checksum.go index d7193ba3b7f..507a17e6537 100644 --- a/packer/plugin-getter/checksum.go +++ b/packer/plugin-getter/checksum.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package plugingetter diff --git a/packer/plugin-getter/docs.go b/packer/plugin-getter/docs.go index 216a7781d2f..6c8cfba37cf 100644 --- a/packer/plugin-getter/docs.go +++ b/packer/plugin-getter/docs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package plugingetter defines means to download and install plugins. package plugingetter diff --git a/packer/plugin-getter/github/docs.go b/packer/plugin-getter/github/docs.go index 50fa13e30ae..9c189dfd3a3 100644 --- a/packer/plugin-getter/github/docs.go +++ b/packer/plugin-getter/github/docs.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Package github defines a Github getter. diff --git a/packer/plugin-getter/github/getter.go b/packer/plugin-getter/github/getter.go index a4942a42163..eb2aea38d2c 100644 --- a/packer/plugin-getter/github/getter.go +++ b/packer/plugin-getter/github/getter.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package github diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index f6ca5c4abfe..84b5d8da1da 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package plugingetter diff --git a/packer/plugin-getter/plugins_test.go b/packer/plugin-getter/plugins_test.go index dfb28767067..03e34251ecd 100644 --- a/packer/plugin-getter/plugins_test.go +++ b/packer/plugin-getter/plugins_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package plugingetter diff --git a/packer/plugin.go b/packer/plugin.go index 313ef2db31e..caf05df0e4a 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/plugin_client.go b/packer/plugin_client.go index 01e899e2813..bcd71890043 100644 --- a/packer/plugin_client.go +++ b/packer/plugin_client.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index 901c3d42f1d..fec52607d83 100644 --- a/packer/plugin_discover_test.go +++ b/packer/plugin_discover_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/plugin_folders.go b/packer/plugin_folders.go index e1d4dbea4a2..52d63aac4cc 100644 --- a/packer/plugin_folders.go +++ b/packer/plugin_folders.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/plugin_test.go b/packer/plugin_test.go index a912ca07a38..099d9cf6c8a 100644 --- a/packer/plugin_test.go +++ b/packer/plugin_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/post_processor_mock.go b/packer/post_processor_mock.go index 5a9bfc85ae2..b6156e28ceb 100644 --- a/packer/post_processor_mock.go +++ b/packer/post_processor_mock.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type MockPostProcessor package packer diff --git a/packer/progressbar.go b/packer/progressbar.go index 0a9225047c3..c7e68f7c2ba 100644 --- a/packer/progressbar.go +++ b/packer/progressbar.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build !solaris // +build !solaris diff --git a/packer/progressbar_solaris.go b/packer/progressbar_solaris.go index 7aa199339a7..cfc0266f27a 100644 --- a/packer/progressbar_solaris.go +++ b/packer/progressbar_solaris.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/progressbar_test.go b/packer/progressbar_test.go index 20edc07c9b2..4d4c3f22e66 100644 --- a/packer/progressbar_test.go +++ b/packer/progressbar_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/provisioner.go b/packer/provisioner.go index c7761adeb5f..66d61d9fb98 100644 --- a/packer/provisioner.go +++ b/packer/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/provisioner_test.go b/packer/provisioner_test.go index bc646e5ca10..d5e191038c9 100644 --- a/packer/provisioner_test.go +++ b/packer/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/provisioner_timeout.go b/packer/provisioner_timeout.go index f1183744cdb..c7407130cb4 100644 --- a/packer/provisioner_timeout.go +++ b/packer/provisioner_timeout.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/run_interfaces.go b/packer/run_interfaces.go index 07829e629e1..253998c20a4 100644 --- a/packer/run_interfaces.go +++ b/packer/run_interfaces.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/telemetry.go b/packer/telemetry.go index c3d0573ef5e..1245ce5229a 100644 --- a/packer/telemetry.go +++ b/packer/telemetry.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/telemetry_test.go b/packer/telemetry_test.go index 7abc600cda1..a45db2bcb3e 100644 --- a/packer/telemetry_test.go +++ b/packer/telemetry_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/testing.go b/packer/testing.go index b0ebc04b95f..2f01e18aafc 100644 --- a/packer/testing.go +++ b/packer/testing.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/ui.go b/packer/ui.go index c01e9591a54..dac5689205c 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/packer/ui_test.go b/packer/ui_test.go index 44fa93c7f07..1d15cb4ea0f 100644 --- a/packer/ui_test.go +++ b/packer/ui_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer diff --git a/panic.go b/panic.go index 6fdfc59af24..6f609645345 100644 --- a/panic.go +++ b/panic.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/post-processor/artifice/artifact.go b/post-processor/artifice/artifact.go index 859b05e6199..4f481b2be29 100644 --- a/post-processor/artifice/artifact.go +++ b/post-processor/artifice/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package artifice diff --git a/post-processor/artifice/post-processor.go b/post-processor/artifice/post-processor.go index d1a4f422268..334d8531b6b 100644 --- a/post-processor/artifice/post-processor.go +++ b/post-processor/artifice/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/post-processor/artifice/version/version.go b/post-processor/artifice/version/version.go index b329b365688..b426efb501a 100644 --- a/post-processor/artifice/version/version.go +++ b/post-processor/artifice/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/post-processor/checksum/artifact.go b/post-processor/checksum/artifact.go index 5468460d53a..eb1eeeeec26 100644 --- a/post-processor/checksum/artifact.go +++ b/post-processor/checksum/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package checksum diff --git a/post-processor/checksum/post-processor.go b/post-processor/checksum/post-processor.go index efd51b6a169..28b107cd8e6 100644 --- a/post-processor/checksum/post-processor.go +++ b/post-processor/checksum/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/post-processor/checksum/post-processor_test.go b/post-processor/checksum/post-processor_test.go index 6a08f029735..eff52c929ea 100644 --- a/post-processor/checksum/post-processor_test.go +++ b/post-processor/checksum/post-processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package checksum diff --git a/post-processor/checksum/version/version.go b/post-processor/checksum/version/version.go index 9e1eeb239d9..74332d82388 100644 --- a/post-processor/checksum/version/version.go +++ b/post-processor/checksum/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/post-processor/compress/artifact.go b/post-processor/compress/artifact.go index c56b2905daf..20c7ef7d0b3 100644 --- a/post-processor/compress/artifact.go +++ b/post-processor/compress/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package compress diff --git a/post-processor/compress/artifact_test.go b/post-processor/compress/artifact_test.go index a30a803edf6..d0c1da8caeb 100644 --- a/post-processor/compress/artifact_test.go +++ b/post-processor/compress/artifact_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package compress diff --git a/post-processor/compress/benchmark.go b/post-processor/compress/benchmark.go index e315f3bcf2d..cdbeb733f29 100644 --- a/post-processor/compress/benchmark.go +++ b/post-processor/compress/benchmark.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build ignore // +build ignore diff --git a/post-processor/compress/post-processor.go b/post-processor/compress/post-processor.go index 07a74e813d0..bf0cb1041d2 100644 --- a/post-processor/compress/post-processor.go +++ b/post-processor/compress/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/post-processor/compress/post-processor_test.go b/post-processor/compress/post-processor_test.go index 00b8a1377ca..04aea52b1e5 100644 --- a/post-processor/compress/post-processor_test.go +++ b/post-processor/compress/post-processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package compress diff --git a/post-processor/compress/tar_fix.go b/post-processor/compress/tar_fix.go index 0402f4e7075..ad58cb18fa9 100644 --- a/post-processor/compress/tar_fix.go +++ b/post-processor/compress/tar_fix.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build !go1.10 // +build !go1.10 diff --git a/post-processor/compress/tar_fix_go110.go b/post-processor/compress/tar_fix_go110.go index 2e0eba8d8cf..5eac3dea192 100644 --- a/post-processor/compress/tar_fix_go110.go +++ b/post-processor/compress/tar_fix_go110.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build go1.10 // +build go1.10 diff --git a/post-processor/compress/version/version.go b/post-processor/compress/version/version.go index 75bfb46f656..639290a83ef 100644 --- a/post-processor/compress/version/version.go +++ b/post-processor/compress/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/post-processor/manifest/artifact.go b/post-processor/manifest/artifact.go index ceef83f8123..b70c7deceb0 100644 --- a/post-processor/manifest/artifact.go +++ b/post-processor/manifest/artifact.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package manifest diff --git a/post-processor/manifest/post-processor.go b/post-processor/manifest/post-processor.go index 74f203525d9..3063c51bdfe 100644 --- a/post-processor/manifest/post-processor.go +++ b/post-processor/manifest/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config //go:generate packer-sdc struct-markdown diff --git a/post-processor/manifest/version/version.go b/post-processor/manifest/version/version.go index 86f862f89fd..20a5523154a 100644 --- a/post-processor/manifest/version/version.go +++ b/post-processor/manifest/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/post-processor/shell-local/post-processor.go b/post-processor/shell-local/post-processor.go index 801e8ac6567..334081e5927 100644 --- a/post-processor/shell-local/post-processor.go +++ b/post-processor/shell-local/post-processor.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_local diff --git a/post-processor/shell-local/post-processor_test.go b/post-processor/shell-local/post-processor_test.go index 13121658af2..44d29f3cb2a 100644 --- a/post-processor/shell-local/post-processor_test.go +++ b/post-processor/shell-local/post-processor_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_local diff --git a/post-processor/shell-local/version/version.go b/post-processor/shell-local/version/version.go index 1f602bc5f46..1d02737909d 100644 --- a/post-processor/shell-local/version/version.go +++ b/post-processor/shell-local/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/breakpoint/provisioner.go b/provisioner/breakpoint/provisioner.go index 9ac6e340fb2..893dc2d79c9 100644 --- a/provisioner/breakpoint/provisioner.go +++ b/provisioner/breakpoint/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/breakpoint/version/version.go b/provisioner/breakpoint/version/version.go index 2024c7e5a74..008af956575 100644 --- a/provisioner/breakpoint/version/version.go +++ b/provisioner/breakpoint/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/file/provisioner.go b/provisioner/file/provisioner.go index 586896611d9..84e9c3744fa 100644 --- a/provisioner/file/provisioner.go +++ b/provisioner/file/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config //go:generate packer-sdc struct-markdown diff --git a/provisioner/file/provisioner_test.go b/provisioner/file/provisioner_test.go index 280afa0250a..8f54634b3f1 100644 --- a/provisioner/file/provisioner_test.go +++ b/provisioner/file/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file diff --git a/provisioner/file/version/version.go b/provisioner/file/version/version.go index 8451cf03227..e5b7923463f 100644 --- a/provisioner/file/version/version.go +++ b/provisioner/file/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/powershell/execution_policy.go b/provisioner/powershell/execution_policy.go index 057f60a2ec7..94463db2b24 100644 --- a/provisioner/powershell/execution_policy.go +++ b/provisioner/powershell/execution_policy.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate enumer -transform snake -trimprefix ExecutionPolicy -type ExecutionPolicy diff --git a/provisioner/powershell/execution_policy_test.go b/provisioner/powershell/execution_policy_test.go index 5631b78bdd1..8b82c97f270 100644 --- a/provisioner/powershell/execution_policy_test.go +++ b/provisioner/powershell/execution_policy_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package powershell diff --git a/provisioner/powershell/provisioner.go b/provisioner/powershell/provisioner.go index aae71f9fb3e..65ed16d1bf2 100644 --- a/provisioner/powershell/provisioner.go +++ b/provisioner/powershell/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/powershell/provisioner_acc_test.go b/provisioner/powershell/provisioner_acc_test.go index 8073d011334..efe2a2789d5 100644 --- a/provisioner/powershell/provisioner_acc_test.go +++ b/provisioner/powershell/provisioner_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package powershell_test diff --git a/provisioner/powershell/provisioner_test.go b/provisioner/powershell/provisioner_test.go index 024b0585fa2..dd9f610feb6 100644 --- a/provisioner/powershell/provisioner_test.go +++ b/provisioner/powershell/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package powershell diff --git a/provisioner/powershell/version/version.go b/provisioner/powershell/version/version.go index b0350e51cbd..eb2cc7e0d33 100644 --- a/provisioner/powershell/version/version.go +++ b/provisioner/powershell/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/shell-local/provisioner.go b/provisioner/shell-local/provisioner.go index 3c62b28f9d5..d051b361239 100644 --- a/provisioner/shell-local/provisioner.go +++ b/provisioner/shell-local/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell diff --git a/provisioner/shell-local/provisioner_acc_test.go b/provisioner/shell-local/provisioner_acc_test.go index 1f1b37a0cb8..ad027ec7de2 100644 --- a/provisioner/shell-local/provisioner_acc_test.go +++ b/provisioner/shell-local/provisioner_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_test diff --git a/provisioner/shell-local/provisioner_test.go b/provisioner/shell-local/provisioner_test.go index c320ad4a1d1..ac7262b616a 100644 --- a/provisioner/shell-local/provisioner_test.go +++ b/provisioner/shell-local/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell diff --git a/provisioner/shell-local/version/version.go b/provisioner/shell-local/version/version.go index 27e57fb5c0a..205aea7ccf0 100644 --- a/provisioner/shell-local/version/version.go +++ b/provisioner/shell-local/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 593f898caf0..cc1e399996a 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/shell/provisioner_acc_test.go b/provisioner/shell/provisioner_acc_test.go index 167456d274a..ca7a32d8282 100644 --- a/provisioner/shell/provisioner_acc_test.go +++ b/provisioner/shell/provisioner_acc_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_test diff --git a/provisioner/shell/provisioner_test.go b/provisioner/shell/provisioner_test.go index 40da9b5ea2b..3e52593b4ca 100644 --- a/provisioner/shell/provisioner_test.go +++ b/provisioner/shell/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell diff --git a/provisioner/shell/unix_reader.go b/provisioner/shell/unix_reader.go index 9e27a6de928..dc74647b292 100644 --- a/provisioner/shell/unix_reader.go +++ b/provisioner/shell/unix_reader.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell diff --git a/provisioner/shell/unix_reader_test.go b/provisioner/shell/unix_reader_test.go index 869531653ad..96c470cc13c 100644 --- a/provisioner/shell/unix_reader_test.go +++ b/provisioner/shell/unix_reader_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell diff --git a/provisioner/shell/version/version.go b/provisioner/shell/version/version.go index bb0b798efe2..f192bb373db 100644 --- a/provisioner/shell/version/version.go +++ b/provisioner/shell/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/sleep/provisioner.go b/provisioner/sleep/provisioner.go index 7c74c74b73d..8dfb4ce1f7c 100644 --- a/provisioner/sleep/provisioner.go +++ b/provisioner/sleep/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Provisioner diff --git a/provisioner/sleep/provisioner_test.go b/provisioner/sleep/provisioner_test.go index 94acf5771ef..315849e66dc 100644 --- a/provisioner/sleep/provisioner_test.go +++ b/provisioner/sleep/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package sleep diff --git a/provisioner/sleep/version/version.go b/provisioner/sleep/version/version.go index 3b0c4c2bf25..bdad4975ec3 100644 --- a/provisioner/sleep/version/version.go +++ b/provisioner/sleep/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go index 4c1113a0df8..8aaa3598ccd 100644 --- a/provisioner/windows-restart/provisioner.go +++ b/provisioner/windows-restart/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/windows-restart/provisioner_test.go b/provisioner/windows-restart/provisioner_test.go index c2d934ed539..bc68f167398 100644 --- a/provisioner/windows-restart/provisioner_test.go +++ b/provisioner/windows-restart/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package restart diff --git a/provisioner/windows-restart/version/version.go b/provisioner/windows-restart/version/version.go index d178be5e559..5376f9e31a6 100644 --- a/provisioner/windows-restart/version/version.go +++ b/provisioner/windows-restart/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/provisioner/windows-shell/provisioner.go b/provisioner/windows-shell/provisioner.go index 0002d85ba06..c6f22a3e778 100644 --- a/provisioner/windows-shell/provisioner.go +++ b/provisioner/windows-shell/provisioner.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:generate packer-sdc mapstructure-to-hcl2 -type Config diff --git a/provisioner/windows-shell/provisioner_test.go b/provisioner/windows-shell/provisioner_test.go index 08990b00ae7..ae97cc20334 100644 --- a/provisioner/windows-shell/provisioner_test.go +++ b/provisioner/windows-shell/provisioner_test.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell diff --git a/provisioner/windows-shell/version/version.go b/provisioner/windows-shell/version/version.go index 71885679439..18ad34fe08e 100644 --- a/provisioner/windows-shell/version/version.go +++ b/provisioner/windows-shell/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 3290347fe0f..4f1abd3a1cb 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 <# .Synopsis diff --git a/scripts/build.sh b/scripts/build.sh index 491a1bbce4f..8b65f50b773 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 # This script builds the application from source for multiple platforms. diff --git a/scripts/codesign_example.sh b/scripts/codesign_example.sh index 85303332049..2e1a1698477 100755 --- a/scripts/codesign_example.sh +++ b/scripts/codesign_example.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 set -euo pipefail diff --git a/scripts/dist.sh b/scripts/dist.sh index 999be612a05..113af57ba21 100755 --- a/scripts/dist.sh +++ b/scripts/dist.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 set -e diff --git a/scripts/generate-plugins.go b/scripts/generate-plugins.go index 7390fafa070..669da9d3f32 100755 --- a/scripts/generate-plugins.go +++ b/scripts/generate-plugins.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 // Generate Plugins is a small program that updates the lists of plugins in // command/plugin.go so they will be compiled into the main packer binary. diff --git a/scripts/off_gopath.sh b/scripts/off_gopath.sh index 04e1ae709e5..beb1433e1bf 100755 --- a/scripts/off_gopath.sh +++ b/scripts/off_gopath.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 set -eu -o pipefail diff --git a/scripts/prepare_changelog.sh b/scripts/prepare_changelog.sh index be9049eca78..3f776034b1d 100755 --- a/scripts/prepare_changelog.sh +++ b/scripts/prepare_changelog.sh @@ -1,6 +1,6 @@ #!/bin/zsh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 LAST_RELEASE=$1 diff --git a/scripts/sign.sh b/scripts/sign.sh index 494347ef677..f7d18acd764 100755 --- a/scripts/sign.sh +++ b/scripts/sign.sh @@ -1,5 +1,5 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 #!/usr/bin/env bash diff --git a/scripts/sort-md-list.py b/scripts/sort-md-list.py index c84ad663da2..9842977752e 100755 --- a/scripts/sort-md-list.py +++ b/scripts/sort-md-list.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 """ sort-md-list.py sorts markdown lists diff --git a/scripts/upgrade_plugins.sh b/scripts/upgrade_plugins.sh index 961f8ed804d..3ca2885f178 100755 --- a/scripts/upgrade_plugins.sh +++ b/scripts/upgrade_plugins.sh @@ -1,6 +1,6 @@ #!/bin/zsh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 ## This script is to be run before a Packer release in order to update diff --git a/scripts/vagrant-freebsd-priv-config.sh b/scripts/vagrant-freebsd-priv-config.sh index 89915370f36..9d5f0761ed5 100755 --- a/scripts/vagrant-freebsd-priv-config.sh +++ b/scripts/vagrant-freebsd-priv-config.sh @@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 chown vagrant:wheel \ diff --git a/scripts/vagrant-freebsd-unpriv-bootstrap.sh b/scripts/vagrant-freebsd-unpriv-bootstrap.sh index 809415ab6c8..89fc9fc87bb 100755 --- a/scripts/vagrant-freebsd-unpriv-bootstrap.sh +++ b/scripts/vagrant-freebsd-unpriv-bootstrap.sh @@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 export GOPATH=/opt/gopath diff --git a/scripts/vagrant-linux-priv-config.sh b/scripts/vagrant-linux-priv-config.sh index b658e719179..d89e10ecb0b 100755 --- a/scripts/vagrant-linux-priv-config.sh +++ b/scripts/vagrant-linux-priv-config.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 export DEBIAN_FRONTEND=noninteractive diff --git a/scripts/vagrant-linux-priv-go.sh b/scripts/vagrant-linux-priv-go.sh index e59ae7e145d..2d99bc1517b 100755 --- a/scripts/vagrant-linux-priv-go.sh +++ b/scripts/vagrant-linux-priv-go.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 function install_go() { diff --git a/scripts/vagrant-linux-unpriv-bootstrap.sh b/scripts/vagrant-linux-unpriv-bootstrap.sh index ff6b8f8f90f..ca7f004c9eb 100755 --- a/scripts/vagrant-linux-unpriv-bootstrap.sh +++ b/scripts/vagrant-linux-unpriv-bootstrap.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 cd /opt/gopath/src/github.com/hashicorp/packer && make dev diff --git a/tty.go b/tty.go index 62fa5203ffd..a6f16d122ac 100644 --- a/tty.go +++ b/tty.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 //go:build !solaris // +build !solaris diff --git a/tty_solaris.go b/tty_solaris.go index ed40b7fdb82..257db948865 100644 --- a/tty_solaris.go +++ b/tty_solaris.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/version/VERSION b/version/VERSION index 81c871de46b..6ecac68129f 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -1.10.0 +1.9.5 \ No newline at end of file diff --git a/version/version.go b/version/version.go index 2df08d2d71b..144c68eb324 100644 --- a/version/version.go +++ b/version/version.go @@ -1,5 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package version @@ -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.10.0" + Version = "1.9.5" // 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/content/docs/commands/init.mdx b/website/content/docs/commands/init.mdx index 940751c5b67..32008db86bd 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -70,7 +70,7 @@ packer { } ``` -HashiCorp does not officially verify third party Packer plugins, plugins not under the HashiCorp namespace `hashicorp/*`; as with all community tools, please do your own due diligence when using a new tool. +HashiCorp does not officially verify third party Packer plugins, plugins not under the HashiCorp namespace `hashicorp/*`; as with all open source tools, please do your own due diligence when using a new tool. ## Plugin Selection diff --git a/website/content/docs/community-tools.mdx b/website/content/docs/community-tools.mdx index 3a222f17a75..ea75ef3df23 100644 --- a/website/content/docs/community-tools.mdx +++ b/website/content/docs/community-tools.mdx @@ -65,9 +65,6 @@ contribution here! to automate the creation of virtual machine images and their guest operating systems on VMware vSphere using HashiCorp Packer and the Packer Plugin for VMware vSphere (vsphere-iso). -- [Parallels/packer-examples](https://github.com/parallels/packer-examples) - Examples in how to use Packer with Parallels Desktop - to automate the creation of virtual machine images and their guest operating systems on macOS, windows and linux. - ## Wrappers - [packer-config](https://github.com/ianchesal/packer-config) - a Ruby model that lets you build Packer configurations in Ruby diff --git a/website/content/docs/index.mdx b/website/content/docs/index.mdx index 5fd386e1dc7..ad32aa8a02c 100644 --- a/website/content/docs/index.mdx +++ b/website/content/docs/index.mdx @@ -6,7 +6,7 @@ page_title: Documentation # Packer Documentation -[Packer](https://www.packer.io/) is a community tool that enables you to create identical machine images for multiple platforms from a single source template. A common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. +[Packer](https://www.packer.io/) is an open source tool that enables you to create identical machine images for multiple platforms from a single source template. A common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. To install Packer and learn the standard Packer workflow, try the [Get Started tutorials](/packer/tutorials). diff --git a/website/content/docs/intro/index.mdx b/website/content/docs/intro/index.mdx index d6fb56902f6..99f8175943e 100644 --- a/website/content/docs/intro/index.mdx +++ b/website/content/docs/intro/index.mdx @@ -17,7 +17,7 @@ features. ## What is Packer? -Packer is a community tool for creating identical machine images for multiple +Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration diff --git a/website/content/docs/partnerships.mdx b/website/content/docs/partnerships.mdx index 97d1ec526f6..2e87dfdb7c8 100644 --- a/website/content/docs/partnerships.mdx +++ b/website/content/docs/partnerships.mdx @@ -15,7 +15,7 @@ This program is intended to be largely a self-service process with links and gui ### Types of Packer Integrations -Packer is a community tool for creating identical machine images for multiple platforms from a single source configuration. +Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image. A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc. To know more about use cases of Packer click ([Use Cases - Introduction | Packer by HashiCorp](/packer/docs/intro/use-cases)) diff --git a/website/content/guides/packer-on-cicd/trigger-tfe.mdx b/website/content/guides/packer-on-cicd/trigger-tfe.mdx index 14b2643bd1e..b43e282a6b2 100644 --- a/website/content/guides/packer-on-cicd/trigger-tfe.mdx +++ b/website/content/guides/packer-on-cicd/trigger-tfe.mdx @@ -12,7 +12,7 @@ and used locally in development, like is often done with VirtualBox images with Vagrant. In most other cases, the new image will be used to provision new infrastructure. -[Terraform](https://www.terraform.io/) is a community tool that is ideal for +[Terraform](https://www.terraform.io/) is an open source tool that is ideal for provisioning new infrastructure with images generated by Packer, and [Terraform Enterprise](https://www.hashicorp.com/products/terraform/) is the best way to perform automated Terraform runs. diff --git a/website/package-lock.json b/website/package-lock.json index fa295779654..09bd084d46a 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -13726,9 +13726,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", - "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -24389,9 +24389,9 @@ } }, "word-wrap": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", - "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wrap-ansi": { From b3c9d5e95a2da58e42b3b38920db540715f7a635 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 25 Aug 2023 18:55:26 +0000 Subject: [PATCH 91/92] backport of commit 5bae773a28d57f9130a0f4cb086fceac1674082c --- hcl2template/types.datasource.go | 17 +++++++++-------- hcl2template/types.packer_config.go | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hcl2template/types.datasource.go b/hcl2template/types.datasource.go index fd21585fdc3..68df0a695e8 100644 --- a/hcl2template/types.datasource.go +++ b/hcl2template/types.datasource.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/hcl/v2/hclsyntax" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" - "github.com/hashicorp/packer/packer" "github.com/zclconf/go-cty/cty" ) @@ -65,13 +64,15 @@ func (ds *Datasources) Values() (map[string]cty.Value, hcl.Diagnostics) { return res, diags } -func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, ref DatasourceRef, secondaryEvaluation bool) (packersdk.Datasource, hcl.Diagnostics) { +func (cfg *PackerConfig) startDatasource(ds DatasourceBlock) (packersdk.Datasource, hcl.Diagnostics) { var diags hcl.Diagnostics - block := cfg.Datasources[ref].block + block := ds.block + + dataSourceStore := cfg.parser.PluginConfig.DataSources if dataSourceStore == nil { diags = append(diags, &hcl.Diagnostic{ - Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, + Summary: "Unknown " + dataSourceLabel + " type " + ds.Type, Subject: block.LabelRanges[0].Ptr(), Detail: "packer does not currently know any data source.", Severity: hcl.DiagError, @@ -79,9 +80,9 @@ func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, return nil, diags } - if !dataSourceStore.Has(ref.Type) { + if !dataSourceStore.Has(ds.Type) { diags = append(diags, &hcl.Diagnostic{ - Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, + Summary: "Unknown " + dataSourceLabel + " type " + ds.Type, Subject: block.LabelRanges[0].Ptr(), Detail: fmt.Sprintf("known data sources: %v", dataSourceStore.List()), Severity: hcl.DiagError, @@ -89,7 +90,7 @@ func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, return nil, diags } - datasource, err := dataSourceStore.Start(ref.Type) + datasource, err := dataSourceStore.Start(ds.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: err.Error(), @@ -99,7 +100,7 @@ func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, } if datasource == nil { diags = append(diags, &hcl.Diagnostic{ - Summary: fmt.Sprintf("failed to start datasource plugin %q.%q", ref.Type, ref.Name), + Summary: fmt.Sprintf("failed to start datasource plugin %q.%q", ds.Type, ds.Name), Subject: &block.DefRange, Severity: hcl.DiagError, }) diff --git a/hcl2template/types.packer_config.go b/hcl2template/types.packer_config.go index 8664538ba9f..79c17825478 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -381,7 +381,7 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen // If we've gotten here, then it means ref doesn't seem to have any further // dependencies we need to evaluate first. Evaluate it, with the cfg's full // data source context. - datasource, startDiags := cfg.startDatasource(cfg.parser.PluginConfig.DataSources, ref, true) + datasource, startDiags := cfg.startDatasource(ds) if startDiags.HasErrors() { diags = append(diags, startDiags...) return dependencies, diags From 08af008f01259d7e24ffaa54b12d8389e111a4d0 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 25 Aug 2023 21:00:03 +0000 Subject: [PATCH 92/92] backport of commit febaada14ec3a7d1c2b22c7ddccd5aeaa0682181 --- hcl2template/utils.go | 52 ++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/hcl2template/utils.go b/hcl2template/utils.go index 8c3b55ed584..d3d0cb29447 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -11,6 +11,7 @@ import ( "github.com/gobwas/glob" "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/packer/hcl2template/repl" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" "github.com/zclconf/go-cty/cty" @@ -187,22 +188,47 @@ func ConvertPluginConfigValueToHCLValue(v interface{}) (cty.Value, error) { return buildValue, nil } +// GetVarsByType walks through a hcl body, and gathers all the Traversals that +// have a root type matching one of the specified top-level labels. +// +// This will only work on finite, expanded, HCL bodies. func GetVarsByType(block *hcl.Block, topLevelLabels ...string) []hcl.Traversal { - attributes, _ := block.Body.JustAttributes() - - var vars []hcl.Traversal - - for _, attr := range attributes { - for _, variable := range attr.Expr.Variables() { - rootLabel := variable.RootName() - for _, label := range topLevelLabels { - if label == rootLabel { - vars = append(vars, variable) - break - } + var travs []hcl.Traversal + + switch body := block.Body.(type) { + case *hclsyntax.Body: + travs = getVarsByTypeForHCLSyntaxBody(body) + default: + attrs, _ := body.JustAttributes() + for _, attr := range attrs { + travs = append(travs, attr.Expr.Variables()...) + } + } + + var rets []hcl.Traversal + for _, t := range travs { + varRootname := t.RootName() + for _, lbl := range topLevelLabels { + if varRootname == lbl { + rets = append(rets, t) + break } } } - return vars + return rets +} + +func getVarsByTypeForHCLSyntaxBody(body *hclsyntax.Body) []hcl.Traversal { + var rets []hcl.Traversal + + for _, attr := range body.Attributes { + rets = append(rets, attr.Expr.Variables()...) + } + + for _, block := range body.Blocks { + rets = append(rets, getVarsByTypeForHCLSyntaxBody(block.Body)...) + } + + return rets }