From 838de8fddd25d850e9efdae36277a171c718ef7a Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 17 Jan 2024 11:13:04 +0000 Subject: [PATCH] backport of commit cffc3f0404f5a1966da93ecae19848c15f703dbf --- .copywrite.hcl | 4 +- .github/CONTRIBUTING.md | 4 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/plugin_integration.md | 10 +- .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 | 46 +- .../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/docker/README.md | 49 +- .release/release-metadata.hcl | 2 +- .release/security-scan.hcl | 2 +- CHANGELOG.md | 216 +---- CODEOWNERS | 2 + Dockerfile | 79 +- LICENSE | 467 +++++++++-- Makefile | 50 +- README.md | 97 ++- acctest/plugin/component_acc_test.go | 14 +- acctest/plugin/plugin_acc_test.go | 14 +- .../basic-amazon-ami-datasource.pkr.hcl | 5 +- .../test-fixtures/basic-amazon-ebs.pkr.hcl | 15 +- acctest/testing.go | 11 +- 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 | 5 +- builder/file/builder_test.go | 8 +- builder/file/config.go | 2 +- builder/file/config_test.go | 2 +- builder/file/version/version.go | 2 +- builder/null/artifact_export.go | 6 +- 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 | 7 +- command/build.go | 12 +- command/build_cancellation_test.go | 2 +- command/build_cleanup_script_test.go | 2 +- command/build_parallel_test.go | 9 +- command/build_test.go | 7 +- command/build_timeout_test.go | 2 +- command/build_windows_test.go | 2 +- command/cli.go | 4 +- command/command_test.go | 6 +- command/config_file_unix.go | 2 +- command/config_file_windows.go | 2 +- command/console.go | 4 +- command/console_test.go | 2 +- command/enumflag/flag.go | 2 +- command/exec_test.go | 9 +- command/fix.go | 4 +- 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 | 4 +- command/fmt_test.go | 5 +- command/hcl2_upgrade.go | 196 +---- command/hcl2_upgrade_test.go | 32 +- command/init.go | 76 +- command/init_test.go | 152 ++-- command/inspect.go | 4 +- command/inspect_test.go | 2 +- command/meta.go | 19 +- command/plugins.go | 2 +- command/plugins_install.go | 253 +----- command/plugins_install_test.go | 9 +- command/plugins_installed.go | 3 +- command/plugins_remove.go | 18 +- command/plugins_remove_test.go | 29 +- command/plugins_required.go | 4 +- command/signal.go | 2 +- .../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 - command/test_utils.go | 2 +- command/utils.go | 2 +- command/utils_test.go | 7 +- command/validate.go | 12 +- command/validate_test.go | 2 +- command/vendored_plugins.go | 135 +++ command/version.go | 2 +- command/version_test.go | 2 +- commands.go | 2 +- config.go | 2 +- config_test.go | 7 +- 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 | 6 +- datasource/http/data_acc_test.go | 6 +- 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 go.mod | 199 +++-- go.sum | 785 ++++++++++++------ 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 | 13 +- hcl2template/formatter_test.go | 11 +- hcl2template/function/Consul.go | 2 +- hcl2template/function/aws_secretetkey.go | 2 +- hcl2template/function/datetime.go | 37 +- hcl2template/function/datetime_test.go | 2 +- hcl2template/function/env.go | 5 +- hcl2template/function/index.go | 5 +- hcl2template/function/index_test.go | 2 +- hcl2template/function/length.go | 3 +- hcl2template/function/length_test.go | 20 +- hcl2template/function/refinements.go | 9 - 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 | 34 +- hcl2template/plugin.go | 87 +- 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 | 23 +- 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 | 101 ++- hcl2template/types.packer_config_test.go | 2 +- hcl2template/types.required_plugins.go | 140 +++- hcl2template/types.required_plugins_test.go | 220 ++++- hcl2template/types.source.go | 2 +- hcl2template/types.source_test.go | 2 +- hcl2template/types.variables.go | 3 +- hcl2template/types.variables_test.go | 2 +- hcl2template/utils.go | 51 +- 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 | 150 ++-- internal/hcp/api/client_test.go | 92 +- internal/hcp/api/errors.go | 2 +- internal/hcp/api/mock_service.go | 17 +- internal/hcp/api/service.go | 2 +- internal/hcp/env/env.go | 6 +- internal/hcp/env/env_test.go | 2 +- internal/hcp/env/variables.go | 3 +- 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 | 83 +- main_test.go | 2 +- packer/build.go | 2 +- packer/build_test.go | 2 +- packer/builder_test.go | 2 +- packer/client_test.go | 5 +- 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 | 61 +- 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 | 7 +- packer/plugin-getter/plugins.go | 31 +- packer/plugin-getter/plugins_test.go | 71 +- ...cker-plugin-alazon_v1.2.5_x5.0_linux_amd64 | 1 - ...n-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM | 1 - ...cker-plugin-amazon_v1.2.5_x5.0_linux_amd64 | 1 - ...n-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM | 1 - packer/plugin.go | 291 ++++--- packer/plugin_client.go | 5 +- packer/plugin_discover_test.go | 462 ++++++----- packer/plugin_folders.go | 13 +- packer/plugin_test.go | 2 +- packer/post_processor_mock.go | 2 +- packer/progressbar.go | 2 +- packer/progressbar_solaris.go | 2 +- packer/progressbar_test.go | 12 +- packer/provisioner.go | 2 +- packer/provisioner_test.go | 2 +- packer/provisioner_timeout.go | 2 +- packer/run_interfaces.go | 9 +- packer/telemetry.go | 15 +- packer/telemetry_test.go | 24 +- packer/testing.go | 8 +- 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 | 6 +- 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 | 6 +- post-processor/compress/post-processor.go | 27 +- .../compress/post-processor_test.go | 22 +- 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 | 7 +- post-processor/manifest/version/version.go | 2 +- post-processor/shell-local/post-processor.go | 2 +- .../shell-local/post-processor_test.go | 11 +- post-processor/shell-local/version/version.go | 2 +- provisioner/breakpoint/provisioner.go | 5 +- provisioner/breakpoint/version/version.go | 2 +- provisioner/file/provisioner.go | 2 +- provisioner/file/provisioner_test.go | 31 +- 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 | 6 +- provisioner/powershell/provisioner_test.go | 19 +- provisioner/powershell/version/version.go | 2 +- provisioner/shell-local/provisioner.go | 2 +- .../shell-local/provisioner_acc_test.go | 6 +- 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 | 6 +- provisioner/shell/provisioner_test.go | 11 +- 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 | 17 +- 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 | 5 +- scripts/off_gopath.sh | 2 +- scripts/prepare_changelog.sh | 69 +- scripts/sign.sh | 2 +- scripts/sort-md-list.py | 2 +- scripts/upgrade_plugins.sh | 68 ++ 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 | 34 +- website/content/docs/community-tools.mdx | 2 +- website/content/docs/index.mdx | 2 +- website/content/docs/intro/index.mdx | 2 +- website/content/docs/partnerships.mdx | 2 +- .../content/docs/plugins/install-plugins.mdx | 10 - .../guides/packer-on-cicd/trigger-tfe.mdx | 2 +- website/package-lock.json | 504 ++++------- 411 files changed, 3737 insertions(+), 3198 deletions(-) create mode 100644 .github/workflows/check-legacy-links-format.yml delete mode 100644 command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl delete mode 100644 command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json create mode 100644 command/vendored_plugins.go delete mode 100644 go delete mode 100644 hcl2template/function/refinements.go delete mode 100644 packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 delete mode 100644 packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM delete mode 100644 packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 delete mode 100644 packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM create mode 100755 scripts/upgrade_plugins.sh diff --git a/.copywrite.hcl b/.copywrite.hcl index 459f9e10287..2e86e1c3cc1 100644 --- a/.copywrite.hcl +++ b/.copywrite.hcl @@ -1,6 +1,6 @@ project { - license = "BUSL-1.1" - copyright_year = 2024 + 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/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2696178f861..86e030cce3b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -70,7 +70,7 @@ runtime in order to build packer. 1. This project always releases from the latest version of golang. [Install go](https://golang.org/doc/install#install) To properly build from -source, you need to have golang >= v1.20 +source, you need to have golang >= v1.18 ## Setting up Packer for dev @@ -274,7 +274,7 @@ does not attempt to track the latest version for each dependency. Packer relies on `go generate` to generate a [peg parser for boot commands](https://github.com/hashicorp/packer/blob/master/packer-plugin-sdk/bootcommand/boot_command.go), [docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx) -and HCL2's bridging code. Packer's testing suite will run `make generate-check` +and HCL2's bridging code. Packer's testing suite will run `make check-generate` to check that all the generated files Packer needs are what they should be. `make generate` re-generates all these file and can take a while depending on your machine's performances. To make it faster it is recommended to run 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/ISSUE_TEMPLATE/plugin_integration.md b/.github/ISSUE_TEMPLATE/plugin_integration.md index 540e437fe6e..c84da673895 100644 --- a/.github/ISSUE_TEMPLATE/plugin_integration.md +++ b/.github/ISSUE_TEMPLATE/plugin_integration.md @@ -13,9 +13,9 @@ A written description of your plugin along with a link to the plugin repository. HashiCorp Technology partners https://www.hashicorp.com/partners/find-a-partner will be registered as a partner once verified. ---> #### Checklist -- [ ] Has valid [`metadata.hcl`](https://github.com/hashicorp/integration-template) file in plugin repository. -- [ ] Has added integration scripts [packer-plugin-scaffolding](https://github.com/hashicorp/packer-plugin-scoffolding) to plugin repository. -- [ ] Has added top-level integration README.md file to plugin `docs` directory. -- [ ] All plugins components have one README.md describing their usage. -- [ ] Has a fully synced `.web-docs` directory ready for publishing to the integrations portal. +- [] Has valid [`metadata.hcl`](https://github.com/hashicorp/integration-template) file in plugin repository. +- [] Has added integration scripts [packer-plugin-scaffolding](https://github.com/hashicorp/packer-plugin-scoffolding) to plugin repository. +- [] Has added top-level integration README.md file to plugin `docs` directory. +- [] All plugins components have one README.md describing their usage. +- [] Has a fully synced `.web-docs` directory ready for publishing to the integrations portal. 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..657b9c39ebc 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 }} @@ -222,7 +222,7 @@ jobs: instructions: |- go build -o "$BIN_PATH" -ldflags="$LD_FLAGS" -tags netcgo -trimpath -buildvcs=false - build-docker-light: + build-docker: name: Docker light ${{ matrix.arch }} build needs: - set-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: @@ -251,31 +251,3 @@ 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 }} 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 3b9e4a0c187..0bd54efd316 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.12 +1.20.4 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/docker/README.md b/.release/docker/README.md index f733efbeaf9..4fdf9272958 100644 --- a/.release/docker/README.md +++ b/.release/docker/README.md @@ -1,46 +1,37 @@ # 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 `light` and `full` docker images are 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 -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. +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` ### Usage This repository automatically builds containers for using the -[`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 +[`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 inside the container before exposing it for use. -##### `light` +##### `official` -The `light` version of this container will copy the current stable version of +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, -especially if you are just looking to run the binary from a container. +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. You can use this version with the following: ```shell -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 +docker run hashicorp/packer:official ``` ##### `dev` @@ -50,7 +41,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 `light` image. This version of the container is most useful for development or +the `official` image. This version of the container is most useful for development or debugging. You can use this version with the following: @@ -73,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 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 81da4bcc5e9..9e7e6bde4d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,209 +1,4 @@ -## 1.10.1 (Upcoming) - -## 1.10.0 (December 5, 2023) - -### NOTES: -This release contains breaking changes for practitioner relying on plugins - previously bundled into Packer. As specified in the [Bundled Plugins Removal announcement](https://www.hashicorp.com/blog/announcing-the-removal-of-bundled-plugins-in-hashicorp-packer) - HashiCorp maintained plugins will no longer be shipped with Packer. - Users are encouraged to use `packer init` or `packer plugins [...]` when managing required plugins - needed for executing their builds. - [GH-12660](https://github.com/hashicorp/packer/pull/12660) - -The affected plugins include: -* [packer-plugin-amazon](https://github.com/hashicorp/packer-plugin-amazon) -* [packer-plugin-ansible](https://github.com/hashicorp/packer-plugin-ansible) -* [packer-plugin-azure](https://github.com/hashicorp/packer-plugin-azure) -* [packer-plugin-docker](https://github.com/hashicorp/packer-plugin-docker) -* [packer-plugin-googlecompute](https://github.com/hashicorp/packer-plugin-googlecompute) -* [packer-plugin-qemu](https://github.com/hashicorp/packer-plugin-qemu) -* [packer-plugin-vagrant](https://github.com/hashicorp/packer-plugin-vagrant) -* [packer-plugin-virtualbox](https://github.com/hashicorp/packer-plugin-virtualbox) -* [packer-plugin-vmware](https://github.com/hashicorp/packer-plugin-vmware) -* [packer-plugin-vsphere](https://github.com/hashicorp/packer-plugin-vsphere) - -### SECURITY: -* Bump github.com/go-jose/go-jose/v3 to address GO-2023-2334. There have been - no reported issues with Packer but we are bumping given that it is a - secondary - dependency. [GH-12723](https://github.com/hashicorp/packer/pull/12723) -* Bump Go to 1.20.10 to Address CVE-2023-44487 / CVE-2023-39325. - [GH-12661](https://github.com/hashicorp/packer/pull/12661) -* Bump Go to 1.20.11 CVE-2023-45283. There have been no reported issues with - Packer but we are bumping given its usage of the path/filepath pkg. - [GH-12690](https://github.com/hashicorp/packer/pull/12690) -* Bump Packer Plugin SDK to v0.5.2. - [GH-12717](https://github.com/hashicorp/packer/pull/12717) - -### PLUGINS: - -* Removed all HashiCorp vendored plugins from being bundled into the Packer binary. -[GH-12660](https://github.com/hashicorp/packer/pull/12660), [GH-12720](https://github.com/hashicorp/packer/pull/12720) -* packer-plugin-hcloud: The Hetzner Cloud plugin has been handed over to the - Hetzner integrations team. New releases for this plugin are available at - https://github.com/hetznercloud/packer-plugin-hcloud. Existing references - to the plugin will continue to work but users are advised to update the - `required_plugins` block to use the new plugin source address. - ``` - required_plugins { - parallels = { - source = "github.com/hetznercloud/hcloud" - version = "~> 1" - } - } - ``` -### IMPROVEMENTS: -* cmd/init: Warn users running `packer init` on configuration templates with a - missing `required_plugins` blocks. - [GH-12638](https://github.com/hashicorp/packer/pull/12638) -* cmd/plugins: Add `--path` flag to `packer plugins install` subcommand to - support installation of plugins from a local binary rather than from - GitHub. [GH-12643](https://github.com/hashicorp/packer/pull/12643) -* cmd/plugins: Install SHA256SUM file with 0644 perms. - [GH-12665](https://github.com/hashicorp/packer/pull/12665) -* cmd/plugins: Remove SHA256SUM file on plugin removal. - [GH-12666](https://github.com/hashicorp/packer/pull/12666) -* cmd/plugins: Remove will error if it fails to find the plugin being selected - for removal. [GH-12669](https://github.com/hashicorp/packer/pull/12669) -* core/hcl2: Remove empty source file reference on unset variable errors. - [GH-12712](https://github.com/hashicorp/packer/pull/12712) -* core/hcl: Improve the recursive execution of data sources with other data - source dependencies. - [GH-12608](https://github.com/hashicorp/packer/pull/12608) -* core: Bump github.com/hashicorp/hcp-sdk-go from 0.73.0 to 0.74.0 - - [GH-12704](https://github.com/hashicorp/packer/pull/12704) -* core: Bump Packer Plugin SDK to v0.5.2. - [GH-12717](https://github.com/hashicorp/packer/pull/12717) -* core: Provide integration link as hint in error message if a plugin component - is unknown. [GH-12705](https://github.com/hashicorp/packer/pull/12705) -* core: Update version output for `packer -v` and `packer --version` to match - `packer version`. - [GH-12569](https://github.com/hashicorp/packer/pull/12569) -* docs: Update plugin installation guides with supported methods for 1.10.0 and - above. [GH-12713](https://github.com/hashicorp/packer/pull/12713) - -### BUG FIXES: - -* cmd/plugins: Update `packer plugin installed` to show all installed plugin - binaries, including any duplicate versions or binaries copied from a - different source URI. - [GH-12731](https://github.com/hashicorp/packer/pull/12731) - -## 1.9.5 (December 4, 2023) - -### SECURITY - -* Bump github.com/go-jose/go-jose/v3 to address GO-2023-2334. - [GH-12723](https://github.com/hashicorp/packer/pull/12723) - -### BUG FIXES: - -* Add VirtualBox as known plugin prefix to prevent endless bundled plugin warning. - [GH-12719](https://github.com/hashicorp/packer/pull/12719) - -## 1.9.4 (August 18, 2023) - -### 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) - -### 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) - -### 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 help users update their templates. - [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 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` 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.2 (Upcoming) ## 1.9.1 (June 1, 2023) @@ -287,15 +82,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/CODEOWNERS b/CODEOWNERS index b92152c7348..0efb6b1ac47 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,3 +2,5 @@ # release configuration +/.release/ @hashicorp/release-engineering +/.github/workflows/build.yml @hashicorp/release-engineering diff --git a/Dockerfile b/Dockerfile index 12c38fde6af..75acdcd3450 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# 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. @@ -27,8 +27,59 @@ 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. +# 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 @@ -53,24 +104,6 @@ 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 diff --git a/LICENSE b/LICENSE index 91ed1781f82..c96665ef71f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,92 +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 Version 1.10.0 or later. The Licensed Work is (c) 2024 - HashiCorp, Inc. -Additional Use Grant: You may make production use of the Licensed Work, provided - Your use does not include offering the Licensed Work to third - parties on a hosted or embedded basis in order to compete with - HashiCorp's paid version(s) of the Licensed Work. For purposes - of this license: - - A "competitive offering" is a Product that is offered to third - parties on a paid basis, including through paid support - arrangements, that significantly overlaps with the capabilities - of HashiCorp's paid version(s) of the Licensed Work. If Your - Product is not a competitive offering when You first make it - generally available, it will not become a competitive offering - later due to HashiCorp releasing a new version of the Licensed - Work with additional capabilities. In addition, Products that - are not provided on a paid basis are not competitive. - - "Product" means software that is offered to end users to manage - in their own environments or offered as a service on a hosted - basis. - - "Embedded" means including the source code or executable code - from the Licensed Work in a competitive offering. "Embedded" - also means packaging the competitive offering in such a way - that the Licensed Work must be accessed or downloaded for the - competitive offering to operate. - - Hosting or using the Licensed Work(s) for internal purposes - within an organization is not considered a competitive - offering. HashiCorp considers your organization to include all - of your affiliates under common control. - - For binding interpretive guidance on using HashiCorp products - under the Business Source License, please visit our FAQ. - (https://www.hashicorp.com/license-faq) -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/Makefile b/Makefile index ed46303684f..ad6cfd3a28a 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ 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) @@ -71,22 +73,41 @@ dev: ## Build and install a development build # Docker build variables and targets REGISTRY_NAME?=docker.io/hashicorp IMAGE_NAME=packer -IMAGE_TAG_DEV=$(REGISTRY_NAME)/$(IMAGE_NAME):latest-$(GIT_COMMIT) +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) \ + . -docker: docker-dev +# 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 \ + . # Builds from the locally generated binary in ./bin/ # To generate the local binary, run `make dev` -docker-dev: - @GOOS=linux \ - GOARCH=amd64 \ - CGO_ENABLED=0 \ - go build -ldflags '$(GOLDFLAGS)' -o bin/packer . +docker-dev: export GOOS=linux +docker-dev: export GOARCH=amd64 +docker-dev: dev @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 \ @@ -112,6 +133,15 @@ 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 {} \; @@ -136,7 +166,7 @@ generate-check: generate ## Check go code generation is on par exit 1; \ fi -test: vet ## Run unit tests +test: mode-check vet ## Run unit tests @go test -count $(COUNT) $(TEST) $(TESTARGS) -timeout=3m # acctest runs provisioners acceptance tests @@ -148,7 +178,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: vet ## Test with race detection enabled +testrace: mode-check 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 diff --git a/README.md b/README.md index 05a280b2b85..af75e1ed95b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,16 @@ # Packer -[![License: BUSL-1.1](https://img.shields.io/badge/License-BUSL--1.1-yellow.svg)](LICENSE) + [![Build Status](https://github.com/hashicorp/packer/actions/workflows/build.yml/badge.svg)](https://github.com/hashicorp/packer/actions/workflows/build.yml) [![Discuss](https://img.shields.io/badge/discuss-packer-3d89ff?style=flat)](https://discuss.hashicorp.com/c/packer) -=== +[![PkgGoDev](https://pkg.go.dev/badge/github.com/hashicorp/packer)](https://pkg.go.dev/github.com/hashicorp/packer) +[![GoReportCard][report-badge]][report] + +[github-badge]: https://github.com/hashicorp/packer/actions/workflows/build.yml/badge.svg +[appveyor-badge]: https://ci.appveyor.com/api/projects/status/miavlgnp989e5obc/branch/master?svg=true +[godoc-badge]: https://godoc.org/github.com/hashicorp/packer?status.svg +[godoc]: https://godoc.org/github.com/hashicorp/packer +[report-badge]: https://goreportcard.com/badge/github.com/hashicorp/packer +[report]: https://goreportcard.com/report/github.com/hashicorp/packer

@@ -15,31 +23,79 @@ 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 -supports various platforms through external plugin integrations, the full list of which can -be found at https://developer.hashicorp.com/packer/integrations. - -The images that Packer creates can easily be turned into [Vagrant](http://www.vagrantup.com) boxes. - -## Quick Start +comes out of the box with support for many platforms, the full list of which can +be found at https://www.packer.io/docs/builders. -### Packer +Support for other platforms can be added via plugins. -There is a great [introduction and getting started guide](https://learn.hashicorp.com/tutorials/packer/get-started-install-cli) -for building a Docker image on your local machine without using any paid cloud resources. +The images that Packer creates can easily be turned into +[Vagrant](http://www.vagrantup.com) boxes. -Alternatively, you can refer to [getting started with AWS](https://developer.hashicorp.com/packer/tutorials/aws-get-started) to -learn how to build a machine image for an external cloud provider. - -### HCP Packer - -HCP Packer registry stores Packer image metadata, enabling you to track your image lifecycle. +## Quick Start -To get started with building an AWS machine image to HCP Packer for referencing in Terraform refer -to the collection of [HCP Packer Tutorials](https://developer.hashicorp.com/packer/tutorials/hcp-get-started). +**Note:** There is a great +[introduction and getting started guide](https://learn.hashicorp.com/tutorials/packer/get-started-install-cli) +for those with a bit more patience. Otherwise, the quick start below +will get you up and running quickly, at the sacrifice of not explaining some +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). + +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 +case, we'll create a simple AMI that has Redis pre-installed. + +Save this file as `quick-start.pkr.hcl`. Export your AWS credentials as the +`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables. + +```hcl +variable "access_key" { + type = string + default = "${env("AWS_ACCESS_KEY_ID")}" +} + +variable "secret_key" { + type = string + default = "${env("AWS_SECRET_ACCESS_KEY")}" + sensitive = true +} + +locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } + +source "amazon-ebs" "quick-start" { + access_key = "${var.access_key}" + ami_name = "packer-example ${local.timestamp}" + instance_type = "t2.micro" + region = "us-east-1" + secret_key = "${var.secret_key}" + source_ami = "ami-af22d9b9" + ssh_username = "ubuntu" +} + +build { + sources = ["source.amazon-ebs.quick-start"] +} +``` + +Next, tell Packer to build the image: + +``` +$ packer build quick-start.pkr.hcl +... +``` + +Packer will build an AMI according to the "quick-start" template. The AMI +will be available in your AWS account. To delete the AMI, you must manually +delete it using the [AWS console](https://console.aws.amazon.com/). Packer +builds your images, it does not manage their lifecycle. Where they go, how +they're run, etc., is up to you. ## Documentation -Comprehensive documentation is viewable on the Packer website at https://developer.hashicorp.com/packer/docs. +Comprehensive documentation is viewable on the Packer website at https://www.packer.io/docs. ## Contributing to Packer @@ -62,4 +118,3 @@ What does **unmaintained** mean? If you are interested in maintaining an unmaintained or archived plugin, please reach out to us at packer@hashicorp.com. - diff --git a/acctest/plugin/component_acc_test.go b/acctest/plugin/component_acc_test.go index 53a49ad229c..ff77adf636f 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. @@ -8,11 +8,12 @@ package plugin import ( _ "embed" "fmt" - "io" + "io/ioutil" "os" "os/exec" "testing" + amazonacc "github.com/hashicorp/packer-plugin-amazon/builder/ebs/acceptance" "github.com/hashicorp/packer-plugin-sdk/acctest" "github.com/hashicorp/packer/hcl2template/addrs" ) @@ -31,6 +32,13 @@ func TestAccInitAndBuildBasicAmazonAmiDatasource(t *testing.T) { Setup: func() error { return cleanupPluginInstallation(plugin) }, + Teardown: func() error { + helper := amazonacc.AMIHelper{ + Region: "us-west-2", + Name: "packer-amazon-ami-test", + } + return helper.CleanUpAmi() + }, Template: basicAmazonAmiDatasourceHCL2Template, Type: "amazon-ami", Init: true, @@ -46,7 +54,7 @@ func TestAccInitAndBuildBasicAmazonAmiDatasource(t *testing.T) { } defer logs.Close() - logsBytes, err := io.ReadAll(logs) + logsBytes, err := ioutil.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 b2afe7e8162..9e69afe3774 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. @@ -8,13 +8,14 @@ package plugin import ( _ "embed" "fmt" - "io" + "io/ioutil" "os" "os/exec" "path/filepath" "regexp" "testing" + amazonacc "github.com/hashicorp/packer-plugin-amazon/builder/ebs/acceptance" "github.com/hashicorp/packer-plugin-sdk/acctest" "github.com/hashicorp/packer-plugin-sdk/acctest/testutils" "github.com/hashicorp/packer/hcl2template/addrs" @@ -35,6 +36,13 @@ func TestAccInitAndBuildBasicAmazonEbs(t *testing.T) { Setup: func() error { return cleanupPluginInstallation(plugin) }, + Teardown: func() error { + helper := amazonacc.AMIHelper{ + Region: "us-east-1", + Name: "packer-plugin-amazon-ebs-test", + } + return helper.CleanUpAmi() + }, Template: basicAmazonEbsHCL2Template, Type: "amazon-ebs", Init: true, @@ -50,7 +58,7 @@ func TestAccInitAndBuildBasicAmazonEbs(t *testing.T) { } defer logs.Close() - logsBytes, err := io.ReadAll(logs) + logsBytes, err := ioutil.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } 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 207530aa26f..b3c4696024d 100644 --- a/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic-amazon-ami-datasource.pkr.hcl @@ -1,7 +1,7 @@ packer { required_plugins { amazon = { - version = "~>1" + version = ">= 0.0.1" source = "github.com/hashicorp/amazon" } } @@ -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" } @@ -25,7 +25,6 @@ source "amazon-ebs" "basic-example" { communicator = "ssh" instance_type = "t2.micro" ssh_username = "ubuntu" - skip_create_ami = true } build { diff --git a/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl b/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl index daaec2feb7f..aa9399a9239 100644 --- a/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl +++ b/acctest/plugin/test-fixtures/basic-amazon-ebs.pkr.hcl @@ -1,19 +1,18 @@ packer { required_plugins { amazon = { - version = "~> 1" - source = "github.com/hashicorp/amazon" + version = ">= 0.0.1" + source = "github.com/hashicorp/amazon" } } } source "amazon-ebs" "basic-test" { - region = "us-east-1" - instance_type = "m3.medium" - source_ami = "ami-76b2a71e" - ssh_username = "ubuntu" - ami_name = "packer-plugin-amazon-ebs-test" - skip_create_ami = true + region = "us-east-1" + instance_type = "m3.medium" + source_ami = "ami-76b2a71e" + ssh_username = "ubuntu" + ami_name = "packer-plugin-amazon-ebs-test" } build { diff --git a/acctest/testing.go b/acctest/testing.go index f88d2dde3e9..e716ec97b39 100644 --- a/acctest/testing.go +++ b/acctest/testing.go @@ -1,12 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package acctest import ( "context" "fmt" - "io" + "io/ioutil" "log" "os" "strings" @@ -136,9 +136,6 @@ func Test(t TestT, c TestCase) { Components: packer.ComponentFinder{ PluginConfig: &packer.PluginConfig{ Builders: TestBuilderSet{ - BuilderSet: packersdk.MapOfBuilder{ - "test": func() (packersdk.Builder, error) { return c.Builder, nil }, - }, StartFn: func(n string) (packersdk.Builder, error) { if n == "test" { return c.Builder, nil @@ -185,8 +182,8 @@ func Test(t TestT, c TestCase) { log.Printf("[DEBUG] Running 'test' build") ui := &packersdk.BasicUi{ Reader: os.Stdin, - Writer: io.Discard, - ErrorWriter: io.Discard, + Writer: ioutil.Discard, + ErrorWriter: ioutil.Discard, PB: &packersdk.NoopProgressTracker{}, } artifacts, err := build.Run(context.Background(), ui) 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..e6df9b54008 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 @@ -12,6 +12,7 @@ import ( "context" "fmt" "io" + "io/ioutil" "os" "path/filepath" @@ -76,7 +77,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 := os.WriteFile(b.config.Target, []byte(b.config.Content), 0600) + err := ioutil.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 5248318a4dc..dfa87277e2b 100644 --- a/builder/file/builder_test.go +++ b/builder/file/builder_test.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file import ( "fmt" - "os" + "io/ioutil" "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 := os.ReadFile("contentTest.txt") + content, err := ioutil.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 := os.ReadFile("copyTest.txt") + content, err := ioutil.ReadFile("copyTest.txt") if err != nil { return err } 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..ae6e46f2756 100644 --- a/builder/null/artifact_export.go +++ b/builder/null/artifact_export.go @@ -1,9 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package null import ( + "fmt" + registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image" ) @@ -24,7 +26,7 @@ func (*NullArtifact) Id() string { } func (a *NullArtifact) String() string { - return "Did not export anything. This is the null builder" + return fmt.Sprintf("Did not export anything. This is the null builder") } func (a *NullArtifact) State(name string) interface{} { 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..a15797ea811 100644 --- a/cmd/ssh-keygen/main.go +++ b/cmd/ssh-keygen/main.go @@ -1,10 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main import ( "flag" + "io/ioutil" "log" "os" "os/user" @@ -73,12 +74,12 @@ func main() { log.Fatalf("%s already exists.", cla.Filename) } log.Printf("Saving private key to %s", cla.Filename) - if err := os.WriteFile(cla.Filename, keypair.Private, 0600); err != nil { + if err := ioutil.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 := os.WriteFile(publicFilename, keypair.Public, 0644); err != nil { + if err := ioutil.WriteFile(publicFilename, keypair.Public, 0644); err != nil { log.Fatal(err) } } diff --git a/command/build.go b/command/build.go index c9f7a537d1c..b707fe22d6f 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 @@ -43,7 +43,7 @@ func (c *BuildCommand) Run(args []string) int { func (c *BuildCommand) ParseArgs(args []string) (*BuildArgs, int) { var cfg BuildArgs - flags := c.Meta.FlagSet("build") + flags := c.Meta.FlagSet("build", FlagSetBuildFilter|FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -87,13 +87,7 @@ func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int return ret } - diags := packerStarter.DetectPluginBinaries() - ret = writeDiags(c.Ui, nil, diags) - if ret != 0 { - return ret - } - - diags = packerStarter.Initialize(packer.InitializeOptions{}) + diags := packerStarter.Initialize(packer.InitializeOptions{}) ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret 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..959134fd539 100644 --- a/command/build_parallel_test.go +++ b/command/build_parallel_test.go @@ -1,11 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( "bytes" "context" + "fmt" "path/filepath" "sync" "testing" @@ -100,7 +101,7 @@ func TestBuildParallel_1(t *testing.T) { } args := []string{ - "-parallel-builds=10", + fmt.Sprintf("-parallel-builds=10"), filepath.Join(testFixture("parallel"), "1lock-5wg.json"), } @@ -129,7 +130,7 @@ func TestBuildParallel_2(t *testing.T) { } args := []string{ - "-parallel-builds=3", + fmt.Sprintf("-parallel-builds=3"), filepath.Join(testFixture("parallel"), "2lock-4wg.json"), } @@ -158,7 +159,7 @@ func TestBuildParallel_Timeout(t *testing.T) { } args := []string{ - "-parallel-builds=3", + fmt.Sprintf("-parallel-builds=3"), filepath.Join(testFixture("parallel"), "2lock-timeout.json"), } diff --git a/command/build_test.go b/command/build_test.go index de476fdb0c4..8dac9b8e0aa 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -1,10 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( "fmt" + "io/ioutil" "math" "os" "path/filepath" @@ -1008,9 +1009,9 @@ func (fc fileCheck) verify(t *testing.T, dir string) { } } for file, expectedContent := range fc.expectedContent { - content, err := os.ReadFile(filepath.Join(dir, file)) + content, err := ioutil.ReadFile(filepath.Join(dir, file)) if err != nil { - t.Fatalf("os.ReadFile: %v", err) + t.Fatalf("ioutil.ReadFile: %v", err) } if diff := cmp.Diff(expectedContent, string(content)); diff != "" { t.Errorf("content of %s differs: %s", file, diff) 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 2dfc57dbd0d..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 @@ -104,7 +104,6 @@ type BuildArgs struct { func (ia *InitArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&ia.Upgrade, "upgrade", false, "upgrade any present plugin to the highest allowed version.") - flags.BoolVar(&ia.Force, "force", false, "force installation of a plugin, even if already installed") ia.MetaArgs.AddFlagSets(flags) } @@ -113,7 +112,6 @@ func (ia *InitArgs) AddFlagSets(flags *flag.FlagSet) { type InitArgs struct { MetaArgs Upgrade bool - Force bool } // PluginsRequiredArgs represents a parsed cli line for a `packer plugins required ` diff --git a/command/command_test.go b/command/command_test.go index 712e9300496..4666a4109b8 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( "bytes" - "os" + "io/ioutil" "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 := os.ReadFile(path) + b, err := ioutil.ReadFile(path) if err != nil { panic(err) } 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 da24a06150e..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 @@ -43,7 +43,7 @@ func (c *ConsoleCommand) Run(args []string) int { func (c *ConsoleCommand) ParseArgs(args []string) (*ConsoleArgs, int) { var cfg ConsoleArgs - flags := c.Meta.FlagSet("console") + flags := c.Meta.FlagSet("console", FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { 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 debb2dacbf9..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 @@ -11,6 +11,7 @@ import ( "runtime" "testing" + "github.com/hashicorp/packer-plugin-amazon/builder/ebs" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/builder/null" @@ -120,8 +121,10 @@ func getBareComponentFinder() packer.ComponentFinder { return packer.ComponentFinder{ PluginConfig: &packer.PluginConfig{ Builders: packer.MapOfBuilder{ - "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, - "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, + "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, + "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, + "amazon-ebs": func() (packersdk.Builder, error) { return &ebs.Builder{}, nil }, + "azure-arm": func() (packersdk.Builder, error) { return &ebs.Builder{}, nil }, }, Provisioners: packer.MapOfProvisioner{ "shell-local": func() (packersdk.Provisioner, error) { return &shell_local.Provisioner{}, nil }, diff --git a/command/fix.go b/command/fix.go index 07bc8021e80..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 @@ -36,7 +36,7 @@ func (c *FixCommand) Run(args []string) int { func (c *FixCommand) ParseArgs(args []string) (*FixArgs, int) { var cfg FixArgs - flags := c.Meta.FlagSet("fix") + flags := c.Meta.FlagSet("fix", FlagSetNone) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { 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 3a70bcf187d..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 @@ -28,7 +28,7 @@ func (c *FormatCommand) Run(args []string) int { func (c *FormatCommand) ParseArgs(args []string) (*FormatArgs, int) { var cfg FormatArgs - flags := c.Meta.FlagSet("format") + flags := c.Meta.FlagSet("format", FlagSetNone) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { diff --git a/command/fmt_test.go b/command/fmt_test.go index 7d9f3b11979..b642cdef5ad 100644 --- a/command/fmt_test.go +++ b/command/fmt_test.go @@ -1,11 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( "bytes" "fmt" + "io/ioutil" "os" "path/filepath" "strings" @@ -127,7 +128,7 @@ func TestFmt_Recursive(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tempDirectory := mustString(os.MkdirTemp(testDir, "test-dir-*")) + tempDirectory := mustString(ioutil.TempDir(testDir, "test-dir-*")) defer os.RemoveAll(tempDirectory) createFiles(tempDirectory, tt.alreadyPresentContent) diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index 08ffa767e99..adba96d7f87 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 @@ -29,6 +29,42 @@ import ( "github.com/zclconf/go-cty/cty" ) +type HCL2UpgradeCommand struct { + Meta +} + +func (c *HCL2UpgradeCommand) Run(args []string) int { + ctx, cleanup := handleTermInterrupt(c.Ui) + defer cleanup() + + cfg, ret := c.ParseArgs(args) + if ret != 0 { + return ret + } + + return c.RunContext(ctx, cfg) +} + +func (c *HCL2UpgradeCommand) ParseArgs(args []string) (*HCL2UpgradeArgs, int) { + var cfg HCL2UpgradeArgs + flags := c.Meta.FlagSet("hcl2_upgrade", FlagSetNone) + flags.Usage = func() { c.Ui.Say(c.Help()) } + cfg.AddFlagSets(flags) + if err := flags.Parse(args); err != nil { + return &cfg, 1 + } + args = flags.Args() + if len(args) != 1 { + flags.Usage() + return &cfg, 1 + } + cfg.Path = args[0] + if cfg.OutputFile == "" { + cfg.OutputFile = cfg.Path + ".pkr.hcl" + } + return &cfg, 0 +} + const ( hcl2UpgradeFileHeader = `# This file was autogenerated by the 'packer hcl2_upgrade' command. We # recommend double checking that everything is correct before going forward. We @@ -94,60 +130,6 @@ var ( strftime = false ) -// knownPlugins represent the HashiCorp maintained plugins the we can confidently -// construct a required plugins block for. -var knownPlugins = 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", - "virtualbox": "github.com/hashicorp/virtualbox", - "vmware": "github.com/hashicorp/vmware", - "vsphere": "github.com/hashicorp/vsphere", -} - -// unknownPluginName represents any plugin not in knownPlugins or bundled into Packer -const unknownPluginName string = "unknown" - -type HCL2UpgradeCommand struct { - Meta -} - -func (c *HCL2UpgradeCommand) Run(args []string) int { - ctx, cleanup := handleTermInterrupt(c.Ui) - defer cleanup() - - cfg, ret := c.ParseArgs(args) - if ret != 0 { - return ret - } - - return c.RunContext(ctx, cfg) -} - -func (c *HCL2UpgradeCommand) ParseArgs(args []string) (*HCL2UpgradeArgs, int) { - var cfg HCL2UpgradeArgs - flags := c.Meta.FlagSet("hcl2_upgrade") - flags.Usage = func() { c.Ui.Say(c.Help()) } - cfg.AddFlagSets(flags) - if err := flags.Parse(args); err != nil { - return &cfg, 1 - } - args = flags.Args() - if len(args) != 1 { - flags.Usage() - return &cfg, 1 - } - cfg.Path = args[0] - if cfg.OutputFile == "" { - cfg.OutputFile = cfg.Path + ".pkr.hcl" - } - return &cfg, 0 -} - type BlockParser interface { Parse(*template.Template) error Write(*bytes.Buffer) @@ -187,6 +169,7 @@ func (c *HCL2UpgradeCommand) RunContext(_ context.Context, cla *HCL2UpgradeArgs) tpl := core.Template // Parse blocks + packerBlock := &PackerParser{ WithAnnotations: cla.WithAnnotations, } @@ -814,93 +797,16 @@ 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 { - name := knownPluginComponent(b.Type) - if name == unknownPluginName { - continue - } - plugins[knownPlugins[name]] = struct{}{} - } - - for _, p := range tpl.Provisioners { - name := knownPluginComponent(p.Type) - if name == unknownPluginName { - continue - } - plugins[knownPlugins[name]] = struct{}{} - } - - for _, pps := range tpl.PostProcessors { - for _, pp := range pps { - name := knownPluginComponent(pp.Type) - if name == unknownPluginName { - continue - } - plugins[knownPlugins[name]] = 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 { @@ -1199,17 +1105,18 @@ type SourceParser struct { } func (p *SourceParser) Parse(tpl *template.Template) error { + var unknownBuilders []string if p.out == nil { p.out = []byte{} } - - var unknownBuilders []string for i, builderCfg := range p.Builders { sourcesContent := hclwrite.NewEmptyFile() body := sourcesContent.Body() + body.AppendNewline() - if !p.BuilderPlugins.Has(builderCfg.Type) && knownPluginComponent(builderCfg.Type) == unknownPluginName { + if !p.BuilderPlugins.Has(builderCfg.Type) { unknownBuilders = append(unknownBuilders, builderCfg.Type) + } if builderCfg.Name == "" || builderCfg.Name == builderCfg.Type { builderCfg.Name = fmt.Sprintf("autogenerated_%d", i+1) @@ -1222,11 +1129,9 @@ func (p *SourceParser) Parse(tpl *template.Template) error { p.out = append(p.out, transposeTemplatingCalls(sourcesContent.Bytes())...) } - // TODO update to output to stderr as opposed to having the command exit 1 if len(unknownBuilders) > 0 { return fmt.Errorf("unknown builder type(s): %v\n", unknownBuilders) } - return nil } @@ -1430,12 +1335,3 @@ func fixQuoting(old string) string { return string(body) } - -func knownPluginComponent(component string) string { - for prefix := range knownPlugins { - if strings.HasPrefix(component, prefix) { - return prefix - } - } - return unknownPluginName -} diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index 9a3833f909e..d2f92b6b690 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -1,9 +1,10 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( + "io/ioutil" "os" "path/filepath" "testing" @@ -19,25 +20,24 @@ func Test_hcl2_upgrade(t *testing.T) { exitCode int exitEarly bool }{ - {folder: "unknown_builder", flags: []string{}, exitCode: 1}, // warn for unknown components not tracked in knownPluginPrefixes - {folder: "complete", flags: []string{"-with-annotations"}, exitCode: 0}, - {folder: "without-annotations", flags: []string{}, exitCode: 0}, - {folder: "minimal", flags: []string{"-with-annotations"}, exitCode: 0}, - {folder: "source-name", flags: []string{"-with-annotations"}, exitCode: 0}, - {folder: "error-cleanup-provisioner", flags: []string{"-with-annotations"}, exitCode: 0}, - {folder: "aws-access-config", flags: []string{}, exitCode: 0}, - {folder: "escaping", flags: []string{}, exitCode: 0}, - {folder: "vsphere_linux_options_and_network_interface", flags: []string{}, exitCode: 0}, //do not warn for known uninstalled plugins components + {folder: "unknown_builder", flags: []string{}, exitCode: 1}, + {folder: "complete", flags: []string{"-with-annotations"}}, + {folder: "without-annotations", flags: []string{}}, + {folder: "minimal", flags: []string{"-with-annotations"}}, + {folder: "source-name", flags: []string{"-with-annotations"}}, + {folder: "error-cleanup-provisioner", flags: []string{"-with-annotations"}}, + {folder: "aws-access-config", flags: []string{}}, + {folder: "escaping", flags: []string{}}, + {folder: "vsphere_linux_options_and_network_interface", exitCode: 1, flags: []string{}}, {folder: "nonexistent", flags: []string{}, exitCode: 1, exitEarly: true}, {folder: "placeholders", flags: []string{}, exitCode: 0}, {folder: "ami_test", flags: []string{}, exitCode: 0}, {folder: "azure_shg", flags: []string{}, exitCode: 0}, - {folder: "variables-only", flags: []string{}, exitCode: 0}, - {folder: "variables-with-variables", flags: []string{}, exitCode: 0}, - {folder: "complete-variables-with-template-engine", flags: []string{}, exitCode: 0}, + {folder: "variables-only", flags: []string{}}, + {folder: "variables-with-variables", flags: []string{}}, + {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 { @@ -63,8 +63,8 @@ func Test_hcl2_upgrade(t *testing.T) { if tc.exitEarly { return } - expected := string(mustBytes(os.ReadFile(expectedPath))) - actual := string(mustBytes(os.ReadFile(outputPath))) + expected := string(mustBytes(ioutil.ReadFile(expectedPath))) + actual := string(mustBytes(ioutil.ReadFile(outputPath))) if diff := cmp.Diff(expected, actual); diff != "" { t.Fatalf("unexpected output: %s", diff) diff --git a/command/init.go b/command/init.go index 9e5b82f04ba..761627134d6 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 @@ -11,7 +11,6 @@ import ( "runtime" "strings" - gversion "github.com/hashicorp/go-version" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" "github.com/hashicorp/packer/packer" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" @@ -38,7 +37,7 @@ func (c *InitCommand) Run(args []string) int { func (c *InitCommand) ParseArgs(args []string) (*InitArgs, int) { var cfg InitArgs - flags := c.Meta.FlagSet("init") + flags := c.Meta.FlagSet("init", 0) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -67,14 +66,6 @@ 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{ @@ -121,30 +112,67 @@ for more info.`) return 1 } - if len(installs) > 0 { - if !cla.Force && !cla.Upgrade { - continue - } + log.Printf("[TRACE] for plugin %s found %d matching installation(s)", pluginRequirement.Identifier, len(installs)) - if cla.Force && !cla.Upgrade { - pluginRequirement.VersionConstraints, _ = gversion.NewConstraint(fmt.Sprintf("=%s", installs[len(installs)-1].Version)) - } + if len(installs) > 0 && cla.Upgrade == false { + continue } newInstall, err := pluginRequirement.InstallLatest(plugingetter.InstallOptions{ InFolders: opts.FromFolders, BinaryInstallationOptions: opts.BinaryInstallationOptions, Getters: getters, - Force: cla.Force, }) if err != nil { - c.Ui.Error(fmt.Sprintf("Failed getting the %q plugin:", pluginRequirement.Identifier)) - c.Ui.Error(err.Error()) - ret = 1 + 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 + } } 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 @@ -152,7 +180,7 @@ for more info.`) func (*InitCommand) Help() string { helpText := ` -Usage: packer init [options] TEMPLATE +Usage: packer init [options] [config.pkr.hcl|folder/] Install all the missing plugins required in a Packer config. Note that Packer does not have a state. @@ -169,8 +197,6 @@ Options: version, if there is a new higher one. Note that this still takes into consideration the version constraint of the config. - -force Forces reinstallation of plugins, even if already - installed. ` return strings.TrimSpace(helpText) diff --git a/command/init_test.go b/command/init_test.go index d39699ee51c..7f35d3f4cc5 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -1,7 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -//go:build amd64 && (darwin || windows || linux) +// SPDX-License-Identifier: MPL-2.0 package command @@ -10,9 +8,9 @@ import ( "fmt" "log" "os" + "path/filepath" "runtime" "sort" - "strings" "testing" "github.com/google/go-cmp/cmp" @@ -202,6 +200,100 @@ func TestInitCommand_Run(t *testing.T) { "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", nil, }, + { + "manually-installed-single-component-plugin-works", + []func(t *testing.T, tc testCaseInit){ + skipInitTestUnlessEnVar(acctest.TestEnvVar).fn, + initTestGoGetPlugin{ + Src: "https://github.com/azr/packer-provisioner-comment/releases/download/v1.0.0/" + + "packer-provisioner-comment_v1.0.0_" + runtime.GOOS + "_" + runtime.GOARCH + ".zip", + Dst: filepath.Join(cfg.dir("4_pkr_config"), defaultConfigDir, "plugins"), + }.fn, + }, + TestMetaFile(t), + nil, + map[string]string{ + "darwin": "h1:nVebbXToeehPUASRbvV9M4qaA9+UgoR5AMp7LjTrSBk=", + "linux": "h1:/U5vdeMtOpRKNu0ld8+qf4t6WC+BsfCQ6JRo9Dh/khI=", + "windows": "h1:0nkdNCjtTHTgBNkzVKG++/VYmWAvq/o236GGTxrIf/Q=", + }[runtime.GOOS], + map[string]string{ + `source.pkr.hcl`: ` + source "null" "test" { + communicator = "none" + } + `, + `build.pkr.hcl`: ` + build { + sources = ["source.null.test"] + provisioner "comment" { + comment = "Begin ¡" + ui = true + bubble_text = true + } + } + `, + }, + cfg.dir("4_pkr_config"), + cfg.dir("4_pkr_user_folder"), + 0, + nil, + map[string]string{ + "darwin": "h1:nVebbXToeehPUASRbvV9M4qaA9+UgoR5AMp7LjTrSBk=", + "linux": "h1:/U5vdeMtOpRKNu0ld8+qf4t6WC+BsfCQ6JRo9Dh/khI=", + "windows": "h1:0nkdNCjtTHTgBNkzVKG++/VYmWAvq/o236GGTxrIf/Q=", + }[runtime.GOOS], + []func(*testing.T, testCaseInit){ + testBuild{want: 0}.fn, + }, + }, + { + "manually-installed-single-component-plugin-old-api-fails", + []func(t *testing.T, tc testCaseInit){ + skipInitTestUnlessEnVar(acctest.TestEnvVar).fn, + initTestGoGetPlugin{ + Src: "https://github.com/azr/packer-provisioner-comment/releases/download/v0.0.0/" + + "packer-provisioner-comment_v0.0.0_" + runtime.GOOS + "_" + runtime.GOARCH + ".zip", + Dst: filepath.Join(cfg.dir("5_pkr_config"), defaultConfigDir, "plugins"), + }.fn, + }, + TestMetaFile(t), + nil, + map[string]string{ + "darwin": "h1:gW4gzpDXeu3cDrXgHJj9iWAN7Pyak626Gq8Bu2LG1kY=", + "linux": "h1:wQ2H5+J7VXwQzqR9DgpWtjhw9OVEFbcKQL6dgm/+zwo=", + "windows": "h1:BqRdW3c5H1PZ2Q4DOaKWja21v3nDlY5Nn8kqahhHGSw=", + }[runtime.GOOS], + map[string]string{ + `source.pkr.hcl`: ` + source "null" "test" { + communicator = "none" + } + `, + `build.pkr.hcl`: ` + build { + sources = ["source.null.test"] + provisioner "comment" { + comment = "Begin ¡" + ui = true + bubble_text = true + } + } + `, + }, + cfg.dir("5_pkr_config"), + cfg.dir("5_pkr_user_folder"), + 0, + nil, + map[string]string{ + "darwin": "h1:gW4gzpDXeu3cDrXgHJj9iWAN7Pyak626Gq8Bu2LG1kY=", + "linux": "h1:wQ2H5+J7VXwQzqR9DgpWtjhw9OVEFbcKQL6dgm/+zwo=", + "windows": "h1:BqRdW3c5H1PZ2Q4DOaKWja21v3nDlY5Nn8kqahhHGSw=", + }[runtime.GOOS], + []func(*testing.T, testCaseInit){ + testBuild{want: 1}.fn, + }, + }, { "unsupported-non-github-source-address", []func(t *testing.T, tc testCaseInit){ @@ -320,55 +412,3 @@ 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()) - } - }) - } -} diff --git a/command/inspect.go b/command/inspect.go index 7e5ed316650..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 @@ -28,7 +28,7 @@ func (c *InspectCommand) Run(args []string) int { func (c *InspectCommand) ParseArgs(args []string) (*InspectArgs, int) { var cfg InspectArgs - flags := c.Meta.FlagSet("inspect") + flags := c.Meta.FlagSet("inspect", FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { 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 9807df78b5d..99123fd8ec7 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 @@ -20,6 +20,16 @@ import ( "github.com/hashicorp/packer/version" ) +// FlagSetFlags is an enum to define what flags are present in the +// default FlagSet returned by Meta.FlagSet +type FlagSetFlags uint + +const ( + FlagSetNone FlagSetFlags = 0 + FlagSetBuildFilter FlagSetFlags = 1 << iota + FlagSetVars +) + // Meta contains the meta-options and functionality that nearly every // Packer command inherits. type Meta struct { @@ -60,8 +70,11 @@ func (m *Meta) Core(tpl *template.Template, cla *MetaArgs) (*packer.Core, error) return core, nil } -// FlagSet returns a FlagSet with Packer SDK Ui support built-in -func (m *Meta) FlagSet(n string) *flag.FlagSet { +// FlagSet returns a FlagSet with the common flags that every +// command implements. The exact behavior of FlagSet can be configured +// using the flags as the second parameter, for example to disable +// build settings on the commands that don't handle builds. +func (m *Meta) FlagSet(n string, _ FlagSetFlags) *flag.FlagSet { f := flag.NewFlagSet(n, flag.ContinueOnError) // Create an io.Writer that writes to our Ui properly for errors. 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 753d2d558ba..d40bb46bd80 100644 --- a/command/plugins_install.go +++ b/command/plugins_install.go @@ -1,31 +1,23 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( - "bytes" "context" "crypto/sha256" - "encoding/json" - "flag" "fmt" - "io" - "os" - "os/exec" - "path/filepath" "runtime" "strings" "github.com/hashicorp/go-version" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/packer-plugin-sdk/plugin" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" "github.com/hashicorp/packer/hcl2template/addrs" "github.com/hashicorp/packer/packer" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" "github.com/hashicorp/packer/packer/plugin-getter/github" pkrversion "github.com/hashicorp/packer/version" + "github.com/mitchellh/cli" ) type PluginsInstallCommand struct { @@ -38,7 +30,7 @@ func (c *PluginsInstallCommand) Synopsis() string { func (c *PluginsInstallCommand) Help() string { helpText := ` -Usage: packer plugins install [OPTIONS...] [] +Usage: packer plugins install [] This command will install the most recent compatible Packer plugin matching version constraint. @@ -46,15 +38,6 @@ Usage: packer plugins install [OPTIONS...] [] installed. Ex: packer plugins install github.com/hashicorp/happycloud v1.2.3 - packer plugins install --path ./packer-plugin-happycloud "github.com/hashicorp/happycloud" - -Options: - -path Install the plugin from a locally-sourced plugin binary. - This installs the plugin where a normal invocation would, but will - not try to download it from a remote location, and instead - install the binary in the Packer plugins path. This option cannot - be specified with a version constraint. - -force Forces reinstallation of plugins, even if already installed. ` return strings.TrimSpace(helpText) @@ -64,62 +47,14 @@ func (c *PluginsInstallCommand) Run(args []string) int { ctx, cleanup := handleTermInterrupt(c.Ui) defer cleanup() - cmdArgs, ret := c.ParseArgs(args) - if ret != 0 { - return ret - } - - return c.RunContext(ctx, cmdArgs) -} - -type PluginsInstallArgs struct { - MetaArgs - PluginIdentifier string - PluginPath string - Version string - Force bool + return c.RunContext(ctx, args) } -func (pa *PluginsInstallArgs) AddFlagSets(flags *flag.FlagSet) { - flags.StringVar(&pa.PluginPath, "path", "", "install the binary specified by path as a Packer plugin.") - flags.BoolVar(&pa.Force, "force", false, "force installation of the specified plugin, even if already installed.") - pa.MetaArgs.AddFlagSets(flags) -} - -func (c *PluginsInstallCommand) ParseArgs(args []string) (*PluginsInstallArgs, int) { - pa := &PluginsInstallArgs{} - - flags := c.Meta.FlagSet("plugins install") - flags.Usage = func() { c.Ui.Say(c.Help()) } - pa.AddFlagSets(flags) - err := flags.Parse(args) - if err != nil { - c.Ui.Error(fmt.Sprintf("Failed to parse options: %s", err)) - return pa, 1 - } - - args = flags.Args() +func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args []string) int { if len(args) < 1 || len(args) > 2 { - c.Ui.Error(fmt.Sprintf("Invalid arguments, expected either 1 or 2 positional arguments, got %d", len(args))) - flags.Usage() - return pa, 1 - } - - if len(args) == 2 { - pa.Version = args[1] + return cli.RunResultHelp } - if pa.Path != "" && pa.Version != "" { - c.Ui.Error("Invalid arguments: a version cannot be specified when using --path to install a local plugin binary") - flags.Usage() - return pa, 1 - } - - pa.PluginIdentifier = args[0] - return pa, 0 -} - -func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args *PluginsInstallArgs) int { opts := plugingetter.ListInstallationsOptions{ FromFolders: c.Meta.CoreConfig.Components.PluginConfig.KnownPluginFolders, BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{ @@ -132,29 +67,21 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args *Plugi }, }, } - if runtime.GOOS == "windows" { - opts.BinaryInstallationOptions.Ext = ".exe" - } - plugin, diags := addrs.ParsePluginSourceString(args.PluginIdentifier) + plugin, diags := addrs.ParsePluginSourceString(args[0]) if diags.HasErrors() { c.Ui.Error(diags.Error()) return 1 } - // If we did specify a binary to install the plugin from, we ignore - // the Github-based getter in favour of installing it directly. - if args.PluginPath != "" { - return c.InstallFromBinary(opts, plugin, args) - } - // a plugin requirement that matches them all pluginRequirement := plugingetter.Requirement{ Identifier: plugin, + Implicit: false, } - if args.Version != "" { - constraints, err := version.NewConstraint(args.Version) + if len(args) > 1 { + constraints, err := version.NewConstraint(args[1]) if err != nil { c.Ui.Error(err.Error()) return 1 @@ -162,6 +89,10 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args *Plugi pluginRequirement.VersionConstraints = constraints } + if runtime.GOOS == "windows" && opts.Ext == "" { + opts.BinaryInstallationOptions.Ext = ".exe" + } + getters := []plugingetter.Getter{ &github.Getter{ // In the past some terraform plugins downloads were blocked from a @@ -179,7 +110,6 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args *Plugi InFolders: opts.FromFolders, BinaryInstallationOptions: opts.BinaryInstallationOptions, Getters: getters, - Force: args.Force, }) if err != nil { @@ -199,158 +129,3 @@ func (c *PluginsInstallCommand) RunContext(buildCtx context.Context, args *Plugi return 0 } - -func (c *PluginsInstallCommand) InstallFromBinary(opts plugingetter.ListInstallationsOptions, pluginIdentifier *addrs.Plugin, args *PluginsInstallArgs) int { - // As with the other commands, we get the last plugin directory as it - // has precedence over the others, and is where we'll install the - // plugins to. - pluginDir := opts.FromFolders[len(opts.FromFolders)-1] - - var err error - - args.PluginPath, err = filepath.Abs(args.PluginPath) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to transform path", - Detail: fmt.Sprintf("Failed to transform the given path to an absolute one: %s", err), - }}) - } - - s, err := os.Stat(args.PluginPath) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unable to find plugin to promote", - Detail: fmt.Sprintf("The plugin %q failed to be opened because of an error: %s", args.PluginIdentifier, err), - }}) - } - - if s.IsDir() { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Plugin to promote cannot be a directory", - Detail: "The packer plugin promote command can only install binaries, not directories", - }}) - } - - describeCmd, err := exec.Command(args.PluginPath, "describe").Output() - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to describe the plugin", - Detail: fmt.Sprintf("Packer failed to run %s describe: %s", args.PluginPath, err), - }}) - } - - var desc plugin.SetDescription - if err := json.Unmarshal(describeCmd, &desc); err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to decode plugin describe info", - Detail: fmt.Sprintf("'%s describe' produced information that Packer couldn't decode: %s", args.PluginPath, err), - }}) - } - - semver, err := version.NewSemver(desc.Version) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid version", - Detail: fmt.Sprintf("Plugin's reported version (%q) is not semver-compatible: %s", desc.Version, err), - }}) - } - if semver.Prerelease() != "" { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid version", - Detail: fmt.Sprintf("Packer can only install plugin releases with this command (ex: 1.0.0), the binary's reported version is %q", desc.Version), - }}) - } - - pluginBinary, err := os.Open(args.PluginPath) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to open plugin binary", - Detail: fmt.Sprintf("Failed to open plugin binary from %q: %s", args.PluginPath, err), - }}) - } - - pluginContents := bytes.Buffer{} - _, err = io.Copy(&pluginContents, pluginBinary) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to read plugin binary's contents", - Detail: fmt.Sprintf("Failed to read plugin binary from %q: %s", args.PluginPath, err), - }}) - } - _ = pluginBinary.Close() - - // At this point, we know the provided binary behaves correctly with - // describe, so it's very likely to be a plugin, let's install it. - installDir := filepath.Join( - pluginDir, - filepath.Join(pluginIdentifier.Parts()...), - ) - err = os.MkdirAll(installDir, 0755) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to create output directory", - Detail: fmt.Sprintf("The installation directory %q failed to be created because of an error: %s", installDir, err), - }}) - } - - outputPrefix := fmt.Sprintf( - "packer-plugin-%s_v%s_%s", - pluginIdentifier.Type, - desc.Version, - desc.APIVersion, - ) - binaryPath := filepath.Join( - installDir, - outputPrefix+opts.BinaryInstallationOptions.FilenameSuffix(), - ) - - outputPlugin, err := os.OpenFile(binaryPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0755) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to create plugin binary", - Detail: fmt.Sprintf("Failed to create plugin binary at %q: %s", binaryPath, err), - }}) - } - defer outputPlugin.Close() - - _, err = outputPlugin.Write(pluginContents.Bytes()) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to copy plugin binary's contents", - Detail: fmt.Sprintf("Failed to copy plugin binary from %q to %q: %s", args.PluginPath, binaryPath, err), - }}) - } - - // We'll install the SHA256SUM file alongside the plugin, based on the - // contents of the plugin being passed. - shasum := sha256.New() - _, _ = shasum.Write(pluginContents.Bytes()) - - shasumPath := fmt.Sprintf("%s_SHA256SUM", binaryPath) - shaFile, err := os.OpenFile(shasumPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0644) - if err != nil { - return writeDiags(c.Ui, nil, hcl.Diagnostics{&hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Failed to create plugin SHA256SUM file", - Detail: fmt.Sprintf("Failed to create SHA256SUM file at %q: %s", shasumPath, err), - }}) - } - defer shaFile.Close() - - fmt.Fprintf(shaFile, "%x", shasum.Sum([]byte{})) - c.Ui.Say(fmt.Sprintf("Successfully installed plugin %s from %s to %s", args.PluginIdentifier, args.PluginPath, binaryPath)) - - return 0 -} diff --git a/command/plugins_install_test.go b/command/plugins_install_test.go index 5461360c36e..577d8b3f776 100644 --- a/command/plugins_install_test.go +++ b/command/plugins_install_test.go @@ -1,7 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -//go:build amd64 && (darwin || windows || linux) +// SPDX-License-Identifier: MPL-2.0 package command @@ -13,6 +11,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "github.com/mitchellh/cli" "golang.org/x/mod/sumdb/dirhash" ) @@ -108,7 +107,7 @@ func TestPluginsInstallCommand_Run(t *testing.T) { expectedPackerConfigDirHashBeforeInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", packerConfigDir: cfg.dir("4_pkr_plugins_config"), pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.18", "github.com/sylviamoss/comment", "v0.2.19"}, - want: 1, + want: cli.RunResultHelp, dirFiles: nil, expectedPackerConfigDirHashAfterInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", }, @@ -119,7 +118,7 @@ func TestPluginsInstallCommand_Run(t *testing.T) { expectedPackerConfigDirHashBeforeInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", packerConfigDir: cfg.dir("5_pkr_plugins_config"), pluginSourceArgs: []string{}, - want: 1, + want: cli.RunResultHelp, dirFiles: nil, expectedPackerConfigDirHashAfterInstall: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", }, diff --git a/command/plugins_installed.go b/command/plugins_installed.go index b19be4e5c33..58b4381a985 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 @@ -64,6 +64,7 @@ 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 5c13636f5c6..32d77749c08 100644 --- a/command/plugins_remove.go +++ b/command/plugins_remove.go @@ -1,12 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( "context" "crypto/sha256" - "fmt" "os" "runtime" "strings" @@ -75,6 +74,7 @@ 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 { @@ -96,22 +96,8 @@ func (c *PluginsRemoveCommand) RunContext(buildCtx context.Context, args []strin c.Ui.Error(err.Error()) return 1 } - shasumFile := fmt.Sprintf("%s_SHA256SUM", installation.BinaryPath) - if err := os.Remove(shasumFile); err != nil { - c.Ui.Error(fmt.Sprintf("failed to remove %s: %s", shasumFile, err)) - c.Ui.Error("You may need to remove it manually") - } c.Ui.Message(installation.BinaryPath) } - if len(installations) == 0 { - errMsg := fmt.Sprintf("No installed plugin found matching the plugin constraints %s", args[0]) - if len(args) == 2 { - errMsg = fmt.Sprintf("%s %s", errMsg, args[1]) - } - c.Ui.Error(errMsg) - return 1 - } - return 0 } diff --git a/command/plugins_remove_test.go b/command/plugins_remove_test.go index 4149ceaeb9c..41104db7146 100644 --- a/command/plugins_remove_test.go +++ b/command/plugins_remove_test.go @@ -1,7 +1,5 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -//go:build amd64 && (darwin || windows || linux) +// SPDX-License-Identifier: MPL-2.0 package command @@ -47,7 +45,7 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { expectedPackerConfigDirHashBeforeRemove: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", packerConfigDir: cfg.dir("1_pkr_plugins_config"), pluginSourceArgs: []string{"github.com/sylviamoss/comment", "v0.2.19"}, - want: 1, + want: 0, dirFiles: nil, expectedPackerConfigDirHashAfterRemove: "h1:Q5qyAOdD43hL3CquQdVfaHpOYGf0UsZ/+wVA9Ry6cbA=", }, @@ -68,6 +66,7 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { want: 0, dirFiles: map[string][]string{ "darwin": { + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", @@ -76,6 +75,7 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { "linux": { "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", }, @@ -84,12 +84,13 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", }, }[runtime.GOOS], expectedPackerConfigDirHashAfterRemove: map[string]string{ - "darwin": "h1:IKDdst8f0nMAS9T9t85fhuvDCe8lYytiZ/vooW1OWeI=", - "linux": "h1:h3t4iDYGbNtouHAJ1vPsE7d8n+6W5K4VlXTxhrQx2DA=", - "windows": "h1:NpETtGlu1hVMJe5bflPmyAhnL4iDvoIwA//uWhxtkDU=", + "darwin": "h1:IMsWPgJZzRhn80t78zE45003gFKN6EXq562/wjaCrKE=", + "linux": "h1:Ez7SU1GZLvNGJmoTm9PeFIwHv9fvEgzZAZTMl6874iM=", + "windows": "h1:RrXlhy9tG9Bi3c2aOzjx/FLLyVNQolcY+MAr4V1etRI=", }[runtime.GOOS], }, { @@ -115,6 +116,8 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { want: 0, dirFiles: map[string][]string{ "darwin": { + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64", @@ -129,6 +132,8 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_darwin_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_darwin_amd64_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe", @@ -143,12 +148,14 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_linux_amd64_SHA256SUM", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64", "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_linux_amd64_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.18_x5.0_windows_amd64.exe_SHA256SUM", + "github.com/sylviamoss/comment/packer-plugin-comment_v0.2.19_x5.0_windows_amd64.exe_SHA256SUM", }, }[runtime.GOOS], expectedPackerConfigDirHashAfterRemove: map[string]string{ - "darwin": "h1:A6wlL62bUD06NF/1ND5E0o4omXhusB2T8N5ZNe2JVbg=", - "linux": "h1:SuTX0k2sknjDrL3PYgR1JajbGcs1qWIV2XvZAYSMsHw=", - "windows": "h1:NI8aJVAKdIyCXHuGDj6kTu5++6yvCz4oAswIhkL3wFc=", + "darwin": "h1:FBBGQ1SKngN9PvF98awv8TZcKaS+CKzJmQoS7vuSXqY=", + "linux": "h1:F8lN4Q3sv45ig8r1BLOS/wFuQQy6tSfmuIJf3fnbD5k=", + "windows": "h1:DOfH6WR1eJNLJcaL8ar8j1xu2WB7Jcn6oG7LGEvNBZI=", }[runtime.GOOS], }, { @@ -158,7 +165,7 @@ func TestPluginsRemoveCommand_Run(t *testing.T) { expectedPackerConfigDirHashBeforeRemove: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", packerConfigDir: cfg.dir("3_pkr_plugins_config"), pluginSourceArgs: []string{"example.com/sylviamoss/comment", "v0.2.19"}, - want: 1, + want: 0, dirFiles: nil, expectedPackerConfigDirHashAfterRemove: "h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", }, diff --git a/command/plugins_required.go b/command/plugins_required.go index 7776b19210b..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 @@ -54,7 +54,7 @@ func (c *PluginsRequiredCommand) Run(args []string) int { func (c *PluginsRequiredCommand) ParseArgs(args []string) (*PluginsRequiredArgs, int) { var cfg PluginsRequiredArgs - flags := c.Meta.FlagSet("plugins required") + flags := c.Meta.FlagSet("plugins required", 0) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { 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-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl index 8a72f3551b0..72ccb20383c 100644 --- a/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/ami_test/expected.pkr.hcl @@ -1,11 +1,3 @@ -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 8c34e4735b3..9ccbe9dc2fc 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,11 +1,5 @@ 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 15d5a4ad33e..089ce80a781 100644 --- a/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/azure_shg/expected.pkr.hcl @@ -1,11 +1,3 @@ -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 deleted file mode 100644 index cce175b01bd..00000000000 --- a/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/expected.pkr.hcl +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 917c7105e5a..00000000000 --- a/command/test-fixtures/hcl2_upgrade/bundled-plugin-used/input.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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 a6800c67210..bcc669b6438 100644 --- a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl @@ -14,12 +14,6 @@ # 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 316293c39e7..2802e8e18b0 100644 --- a/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/minimal/expected.pkr.hcl @@ -14,12 +14,6 @@ # 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 c4145f7d145..b5adf8ef55b 100644 --- a/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/source-name/expected.pkr.hcl @@ -14,12 +14,6 @@ # 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 16c3c21ca24..a160d0c9eed 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,11 +1,3 @@ -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 414ebc55a96..e332c21e08f 100644 --- a/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/without-annotations/expected.pkr.hcl @@ -1,11 +1,5 @@ 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_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..426ea653eea 100644 --- a/command/utils_test.go +++ b/command/utils_test.go @@ -1,9 +1,10 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package command import ( + "io/ioutil" "log" "os" "path/filepath" @@ -22,7 +23,7 @@ func createFiles(dir string, content map[string]string) { if err := os.MkdirAll(filepath.Dir(contentPath), 0777); err != nil { panic(err) } - if err := os.WriteFile(contentPath, []byte(content), 0666); err != nil { + if err := ioutil.WriteFile(contentPath, []byte(content), 0666); err != nil { panic(err) } log.Printf("created tmp file: %s", contentPath) @@ -38,7 +39,7 @@ func (c *configDirSingleton) dir(key string) string { if v, exists := c.dirs[key]; exists { return v } - c.dirs[key] = mustString(os.MkdirTemp("", "pkr-test-cfg-dir-"+key)) + c.dirs[key] = mustString(ioutil.TempDir("", "pkr-test-cfg-dir-"+key)) return c.dirs[key] } diff --git a/command/validate.go b/command/validate.go index 9747dabf95c..1bc4cc1d7eb 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 @@ -31,7 +31,7 @@ func (c *ValidateCommand) Run(args []string) int { func (c *ValidateCommand) ParseArgs(args []string) (*ValidateArgs, int) { var cfg ValidateArgs - flags := c.Meta.FlagSet("validate") + flags := c.Meta.FlagSet("validate", FlagSetBuildFilter|FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { @@ -65,13 +65,7 @@ func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int return 0 } - diags := packerStarter.DetectPluginBinaries() - ret = writeDiags(c.Ui, nil, diags) - if ret != 0 { - return ret - } - - diags = packerStarter.Initialize(packer.InitializeOptions{ + diags := packerStarter.Initialize(packer.InitializeOptions{ SkipDatasourcesExecution: !cla.EvaluateDatasources, }) ret = writeDiags(c.Ui, nil, diags) 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 new file mode 100644 index 00000000000..0718b91a7c5 --- /dev/null +++ b/command/vendored_plugins.go @@ -0,0 +1,135 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package command + +import ( + packersdk "github.com/hashicorp/packer-plugin-sdk/packer" + + // Previously core-bundled components, split into their own plugins but + // still vendored with Packer for now. Importing as library instead of + // forcing use of packer init. + + amazonchrootbuilder "github.com/hashicorp/packer-plugin-amazon/builder/chroot" + amazonebsbuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebs" + amazonebssurrogatebuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebssurrogate" + amazonebsvolumebuilder "github.com/hashicorp/packer-plugin-amazon/builder/ebsvolume" + amazoninstancebuilder "github.com/hashicorp/packer-plugin-amazon/builder/instance" + amazonamidatasource "github.com/hashicorp/packer-plugin-amazon/datasource/ami" + amazonsecretsmanagerdatasource "github.com/hashicorp/packer-plugin-amazon/datasource/secretsmanager" + anazibimportpostprocessor "github.com/hashicorp/packer-plugin-amazon/post-processor/import" + ansibleprovisioner "github.com/hashicorp/packer-plugin-ansible/provisioner/ansible" + ansiblelocalprovisioner "github.com/hashicorp/packer-plugin-ansible/provisioner/ansible-local" + azurearmbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/arm" + azurechrootbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/chroot" + azuredtlbuilder "github.com/hashicorp/packer-plugin-azure/builder/azure/dtl" + azuredtlartifactprovisioner "github.com/hashicorp/packer-plugin-azure/provisioner/azure-dtlartifact" + dockerbuilder "github.com/hashicorp/packer-plugin-docker/builder/docker" + dockerimportpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-import" + dockerpushpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-push" + dockersavepostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-save" + dockertagpostprocessor "github.com/hashicorp/packer-plugin-docker/post-processor/docker-tag" + 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" + 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" + vagrantcloudpostprocessor "github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant-cloud" + virtualboxisobuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/iso" + virtualboxovfbuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/ovf" + virtualboxvmbuilder "github.com/hashicorp/packer-plugin-virtualbox/builder/virtualbox/vm" + vmwareisobuilder "github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso" + vmwarevmxbuilder "github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx" + vsphereclonebuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone" + vsphereisobuilder "github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso" + vspherepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere" + vspheretemplatepostprocessor "github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template" +) + +// VendoredDatasources are datasource components that were once bundled with the +// Packer core, but are now being imported from their counterpart plugin repos +var VendoredDatasources = map[string]packersdk.Datasource{ + "amazon-ami": new(amazonamidatasource.Datasource), + "amazon-secretsmanager": new(amazonsecretsmanagerdatasource.Datasource), +} + +// VendoredBuilders are builder components that were once bundled with the +// Packer core, but are now being imported from their counterpart plugin repos +var VendoredBuilders = map[string]packersdk.Builder{ + "amazon-ebs": new(amazonebsbuilder.Builder), + "amazon-chroot": new(amazonchrootbuilder.Builder), + "amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder), + "amazon-ebsvolume": new(amazonebsvolumebuilder.Builder), + "amazon-instance": new(amazoninstancebuilder.Builder), + "azure-arm": new(azurearmbuilder.Builder), + "azure-chroot": new(azurechrootbuilder.Builder), + "azure-dtl": new(azuredtlbuilder.Builder), + "docker": new(dockerbuilder.Builder), + "googlecompute": new(googlecomputebuilder.Builder), + "qemu": new(qemubuilder.Builder), + "vagrant": new(vagrantbuilder.Builder), + "vsphere-clone": new(vsphereclonebuilder.Builder), + "vsphere-iso": new(vsphereisobuilder.Builder), + "virtualbox-iso": new(virtualboxisobuilder.Builder), + "virtualbox-ovf": new(virtualboxovfbuilder.Builder), + "virtualbox-vm": new(virtualboxvmbuilder.Builder), + "vmware-iso": new(vmwareisobuilder.Builder), + "vmware-vmx": new(vmwarevmxbuilder.Builder), +} + +// VendoredProvisioners are provisioner components that were once bundled with the +// Packer core, but are now being imported from their counterpart plugin repos +var VendoredProvisioners = map[string]packersdk.Provisioner{ + "azure-dtlartifact": new(azuredtlartifactprovisioner.Provisioner), + "ansible": new(ansibleprovisioner.Provisioner), + "ansible-local": new(ansiblelocalprovisioner.Provisioner), +} + +// VendoredPostProcessors are post-processor components that were once bundled with the +// Packer core, but are now being imported from their counterpart plugin repos +var VendoredPostProcessors = map[string]packersdk.PostProcessor{ + "amazon-import": new(anazibimportpostprocessor.PostProcessor), + "docker-import": new(dockerimportpostprocessor.PostProcessor), + "docker-push": new(dockerpushpostprocessor.PostProcessor), + "docker-save": new(dockersavepostprocessor.PostProcessor), + "docker-tag": new(dockertagpostprocessor.PostProcessor), + "googlecompute-export": new(googlecomputeexportpostprocessor.PostProcessor), + "googlecompute-import": new(googlecomputeimportpostprocessor.PostProcessor), + "vagrant": new(vagrantpostprocessor.PostProcessor), + "vagrant-cloud": new(vagrantcloudpostprocessor.PostProcessor), + "vsphere-template": new(vspheretemplatepostprocessor.PostProcessor), + "vsphere": new(vspherepostprocessor.PostProcessor), +} + +// Upon init lets load up any plugins that were vendored manually into the default +// set of plugins. +func init() { + for k, v := range VendoredDatasources { + if _, ok := Datasources[k]; ok { + continue + } + Datasources[k] = v + } + + for k, v := range VendoredBuilders { + if _, ok := Builders[k]; ok { + continue + } + Builders[k] = v + } + + for k, v := range VendoredProvisioners { + if _, ok := Provisioners[k]; ok { + continue + } + Provisioners[k] = v + } + + for k, v := range VendoredPostProcessors { + if _, ok := PostProcessors[k]; ok { + continue + } + PostProcessors[k] = v + } +} 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 d4dab230e86..6b59b98fe63 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..772fea4fe3b 100644 --- a/config_test.go +++ b/config_test.go @@ -1,11 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package main import ( "encoding/json" "fmt" + "io/ioutil" "os" "path/filepath" "reflect" @@ -121,7 +122,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 := os.CreateTemp(".", "packer-builder-*.exe") + tmpFile, err := ioutil.TempFile(".", "packer-builder-*.exe") if err != nil { t.Fatalf("failed to create test file with error: %s", err) } @@ -159,7 +160,7 @@ func TestLoadSingleComponent(t *testing.T) { } func generateFakePlugins(dirname string, pluginNames []string) (string, []string, func(), error) { - dir, err := os.MkdirTemp("", dirname) + dir, err := ioutil.TempDir("", dirname) if err != nil { return "", nil, nil, fmt.Errorf("failed to create temporary test directory: %v", err) } 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..ec7a1b3e55c 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 @@ -8,7 +8,7 @@ package http import ( "context" "fmt" - "io" + "io/ioutil" "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 := io.ReadAll(resp.Body) + bytes, err := ioutil.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 fdf680b8298..ffad0219048 100644 --- a/datasource/http/data_acc_test.go +++ b/datasource/http/data_acc_test.go @@ -1,12 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package http import ( _ "embed" "fmt" - "io" + "io/ioutil" "os" "os/exec" "regexp" @@ -84,7 +84,7 @@ func TestHttpDataSource(t *testing.T) { } defer logs.Close() - logsBytes, err := io.ReadAll(logs) + logsBytes, err := ioutil.ReadAll(logs) if err != nil { return fmt.Errorf("Unable to read %s", logfile) } 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/go.mod b/go.mod index 19833e27c6a..fa48d7d58da 100644 --- a/go.mod +++ b/go.mod @@ -1,196 +1,215 @@ module github.com/hashicorp/packer require ( - cloud.google.com/go v0.110.8 // indirect + cloud.google.com/go v0.105.0 // indirect github.com/biogo/hts v1.4.3 github.com/cheggaaa/pb v1.0.27 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/dsnet/compress v0.0.1 - github.com/go-git/go-git/v5 v5.11.0 - github.com/go-openapi/runtime v0.26.2 + github.com/go-git/go-git/v5 v5.4.2 + github.com/go-openapi/runtime v0.25.0 github.com/gobwas/glob v0.2.3 github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/go-cmp v0.6.0 + github.com/google/go-cmp v0.5.9 github.com/google/go-github/v33 v33.0.1-0.20210113204525-9318e629ec69 github.com/google/go-querystring v1.1.0 // indirect github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 - github.com/hashicorp/go-getter/v2 v2.2.1 + github.com/hashicorp/go-getter/v2 v2.2.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/go-uuid v1.0.3 + github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/go-version v1.6.0 - github.com/hashicorp/hcl/v2 v2.19.1 - github.com/hashicorp/hcp-sdk-go v0.79.0 + github.com/hashicorp/hcl/v2 v2.14.1 + github.com/hashicorp/hcp-sdk-go v0.36.0 github.com/hashicorp/packer-plugin-amazon v1.2.1 - github.com/hashicorp/packer-plugin-sdk v0.5.2 + github.com/hashicorp/packer-plugin-sdk v0.4.0 github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 github.com/klauspost/compress v1.13.6 // indirect github.com/klauspost/pgzip v1.2.5 github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0 github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 - github.com/mitchellh/cli v1.1.5 + github.com/mitchellh/cli v1.1.2 github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.5.0 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/pkg/sftp v1.13.2 // indirect github.com/posener/complete v1.2.3 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.8.2 github.com/ulikunitz/xz v0.5.10 - github.com/zclconf/go-cty v1.13.3 + github.com/zclconf/go-cty v1.10.0 github.com/zclconf/go-cty-yaml v1.0.1 - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/mod v0.13.0 - golang.org/x/net v0.19.0 - golang.org/x/oauth2 v0.15.0 - golang.org/x/sync v0.4.0 - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.14.0 - google.golang.org/api v0.128.0 // indirect - google.golang.org/grpc v1.59.0 + golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect + golang.org/x/mod v0.8.0 + golang.org/x/net v0.8.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/tools v0.6.0 + google.golang.org/api v0.101.0 // indirect + google.golang.org/grpc v1.50.1 ) require ( - github.com/go-openapi/strfmt v0.21.10 + 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-qemu v1.0.9 + github.com/hashicorp/packer-plugin-vagrant v1.0.3 + github.com/hashicorp/packer-plugin-virtualbox v1.0.4 + 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 ) require ( - cloud.google.com/go/compute v1.23.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.2 // indirect - cloud.google.com/go/storage v1.30.1 // indirect - dario.cat/mergo v1.0.0 // indirect + cloud.google.com/go/compute v1.12.1 // indirect + cloud.google.com/go/compute/metadata v0.1.1 // indirect + cloud.google.com/go/iam v0.6.0 // indirect + cloud.google.com/go/storage v1.27.0 // indirect + github.com/Azure/azure-sdk-for-go v64.0.0+incompatible // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.11.19 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect + github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect + github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 // indirect + github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect + github.com/Azure/go-autorest/logger v0.2.1 // indirect + github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.1.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.1 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/sprig v2.22.0+incompatible // indirect + github.com/Microsoft/go-winio v0.4.16 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect + github.com/acomagu/bufpipe v1.0.3 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-cidr v1.0.1 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect - github.com/armon/go-metrics v0.4.1 // indirect + github.com/armon/go-metrics v0.3.9 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/aws/aws-sdk-go v1.44.114 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bmatcuk/doublestar v1.1.5 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/chzyer/test v1.0.0 // indirect - github.com/cloudflare/circl v1.3.7 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1 // indirect + github.com/digitalocean/go-qemu v0.0.0-20210326154740-ac9e0b687001 // indirect + github.com/dimchansky/utfbom v1.1.1 // indirect github.com/dylanmei/iso8601 v0.1.0 // indirect - github.com/emirpasic/gods v1.18.1 // indirect - github.com/fatih/color v1.14.1 // indirect - github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect - github.com/go-jose/go-jose/v3 v3.0.1 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/emirpasic/gods v1.12.0 // indirect + github.com/fatih/color v1.12.0 // indirect + github.com/go-git/gcfg v1.5.0 // indirect + github.com/go-git/go-billy/v5 v5.3.1 // indirect + github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/analysis v0.21.5 // indirect - github.com/go-openapi/errors v0.21.0 // indirect - github.com/go-openapi/jsonpointer v0.20.1 // indirect - github.com/go-openapi/jsonreference v0.20.3 // indirect - github.com/go-openapi/loads v0.21.3 // indirect - github.com/go-openapi/spec v0.20.12 // indirect - github.com/go-openapi/swag v0.22.5 // indirect - github.com/go-openapi/validate v0.22.4 // indirect + github.com/go-openapi/analysis v0.21.4 // indirect + github.com/go-openapi/errors v0.20.3 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + 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/swag v0.22.3 // indirect + github.com/go-openapi/validate v0.22.1 // indirect github.com/gofrs/uuid v4.0.0+incompatible // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.4.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang-jwt/jwt/v4 v4.2.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.0.1 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect + github.com/googleapis/gax-go/v2 v2.6.0 // indirect github.com/hashicorp/aws-sdk-go-base v0.7.1 // indirect - github.com/hashicorp/consul/api v1.25.1 // indirect + github.com/hashicorp/consul/api v1.10.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-azure-helpers v0.16.5 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter/gcs/v2 v2.2.1 // indirect - github.com/hashicorp/go-getter/s3/v2 v2.2.1 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-getter/gcs/v2 v2.2.0 // indirect + github.com/hashicorp/go-getter/s3/v2 v2.2.0 // indirect + github.com/hashicorp/go-hclog v0.16.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect - github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/serf v0.10.1 // indirect - github.com/hashicorp/vault/api v1.10.0 // indirect - github.com/hashicorp/yamux v0.1.1 // indirect + github.com/hashicorp/serf v0.9.5 // indirect + github.com/hashicorp/vault/api v1.1.1 // indirect + github.com/hashicorp/vault/sdk v0.2.1 // indirect + github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect github.com/kr/fs v0.1.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/matryer/is v1.4.0 // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.13 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/iochan v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/shoenig/go-m1cpu v0.1.5 // indirect - github.com/shopspring/decimal v1.2.0 // indirect - github.com/skeema/knownhosts v1.2.1 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect - github.com/spf13/cast v1.3.1 // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect github.com/ugorji/go/codec v1.2.6 // indirect - github.com/xanzy/ssh-agent v0.3.3 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect + github.com/vmware/govmomi v0.29.0 // indirect + github.com/xanzy/ssh-agent v0.3.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.mongodb.org/mongo-driver v1.13.1 // indirect - go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.17.0 // indirect - go.opentelemetry.io/otel/metric v1.17.0 // indirect - go.opentelemetry.io/otel/trace v1.17.0 // indirect - golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect + go.mongodb.org/mongo-driver v1.11.0 // indirect + go.opencensus.io v0.23.0 // indirect + go.opentelemetry.io/otel v1.11.1 // indirect + go.opentelemetry.io/otel/trace v1.11.1 // indirect + golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect + gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) go 1.20 - -replace github.com/zclconf/go-cty => github.com/nywilken/go-cty v1.13.3 // added by packer-sdc fix as noted in github.com/hashicorp/packer-plugin-sdk/issues/187 diff --git a/go.sum b/go.sum index 33dfdef406d..96c6e63f953 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,59 @@ +bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME= -cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= -cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute/metadata v0.1.1 h1:/sxEbyrm6cw+XOUw1YxBHlatV71z4vpnmO7z2IZ0h3I= +cloud.google.com/go/compute/metadata v0.1.1/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/iam v0.6.0 h1:nsqQC88kT5Iwlm4MeNGTpfMWddp6NB/UOLFTH6m1QfQ= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/longrunning v0.1.1 h1:y50CXG4j0+qvEukslYFBCrzaXX0qpFbBzc3PchSu/LE= +cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go v51.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v64.0.0+incompatible h1:WAA77WBDWYtNfCC95V70VvkdzHe+wM/r2MQ9mG7fnQs= +github.com/Azure/azure-sdk-for-go v64.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest v0.11.19 h1:7/IqD2fEYVha1EPeaiytVKhzmPV223pfkRIQUGOK2IE= +github.com/Azure/go-autorest/autorest v0.11.19/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= +github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= +github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= +github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 h1:dMOmEJfkLKW/7JsokJqkyoYSgmR08hi9KrhjZb+JALY= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= +github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac= +github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= @@ -22,44 +63,58 @@ github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nu github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 h1:w0E0fgc1YafGEh5cROhlROMWXiNoZqApk2PDN0M1+Ns= github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.1 h1:n6EPaDyLSvCEa3frruQvAiHuNp2dhBlMSmkEr+HuzGc= -github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= -github.com/antchfx/xmlquery v1.3.5 h1:I7TuBRqsnfFuL11ruavGm911Awx9IqSdiU6W/ztSmVw= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antchfx/xpath v1.1.11 h1:WOFtK8TVAjLm3lbgqeP0arlHpvCEeTANeWZ/csPpJkQ= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0 h1:JaCC8jz0zdMLk2m+qCCVLLLM/PL93p84w4pK3aJWj60= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= -github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/approvals/go-approval-tests v0.0.0-20210131072903-38d0b0ec12b1 h1:uroQ0JaeVom9Ffv9xFtc7DcqrpGmyQeZCRzHD9FqPBg= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= +github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= +github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.44.114 h1:plIkWc/RsHr3DXBj4MEw9sEW4CcL/e2ryokc+CKyq1I= github.com/aws/aws-sdk-go v1.44.114/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= @@ -75,7 +130,7 @@ github.com/biogo/hts v1.4.3 h1:vir2yUTiRkPvtp6ZTpzh9lWTKQJZXJKZ563rpAQAsRM= github.com/biogo/hts v1.4.3/go.mod h1:eW40HJ1l2ExK9C+yvvoRSftInqWsf3ue+zAEjzCGWjA= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -91,104 +146,177 @@ github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38 github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20200709052629-daa8e1ccc0bc/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1 h1:j6vGflaQ2T7yOWqVgPdiRF73j/U2Zmpbbzab8nyDCRQ= +github.com/digitalocean/go-libvirt v0.0.0-20201209184759-e2a69bcd5bd1/go.mod h1:QS1XzqZLcDniNYrN7EZefq3wIyb/M2WmJbql4ZKoc1Q= +github.com/digitalocean/go-qemu v0.0.0-20210326154740-ac9e0b687001 h1:WAg57gnaAWWjMAELcwHjc2xy0PoXQ5G+vn3+XS6s1jI= +github.com/digitalocean/go-qemu v0.0.0-20210326154740-ac9e0b687001/go.mod h1:IetBE52JfFxK46p2n2Rqm+p5Gx1gpu2hRHsrbnPOWZQ= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= +github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= +github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20200319182547-c7ad2b866182/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= -github.com/dylanmei/winrmtest v0.0.0-20210303004826-fbc9ae56efb6 h1:zWydSUQBJApHwpQ4guHi+mGyQN/8yN6xbKWdDtL3ZNM= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08 h1:0bp6/GrNOrTDtSXe9YYGCwf8jp5Fb/b+4a6MTRm4qzY= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= -github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= -github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= +github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= +github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE= +github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= -github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= +github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/analysis v0.21.5 h1:3tHfEBh6Ia8eKc4M7khOGjPOAlWKJ10d877Cr9teujI= -github.com/go-openapi/analysis v0.21.5/go.mod h1:25YcZosX9Lwz2wBsrFrrsL8bmjjXdlyP6zsr2AMy29M= -github.com/go-openapi/errors v0.21.0 h1:FhChC/duCnfoLj1gZ0BgaBmzhJC2SL/sJr8a2vAobSY= -github.com/go-openapi/errors v0.21.0/go.mod h1:jxNTMUxRCKj65yb/okJGEtahVd7uvWnuWfj53bse4ho= -github.com/go-openapi/jsonpointer v0.20.1 h1:MkK4VEIEZMj4wT9PmjaUmGflVBr9nvud4Q4UVFbDoBE= -github.com/go-openapi/jsonpointer v0.20.1/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.3 h1:EjGcjTW8pD1mRis6+w/gmoBdqv5+RbE9B85D1NgDOVQ= -github.com/go-openapi/jsonreference v0.20.3/go.mod h1:FviDZ46i9ivh810gqzFLl5NttD5q3tSlMLqLr6okedM= -github.com/go-openapi/loads v0.21.3 h1:8sSH2FIm/SnbDUGv572md4YqVMFne/a9Eubvcd3anew= -github.com/go-openapi/loads v0.21.3/go.mod h1:Y3aMR24iHbKHppOj91nQ/SHc0cuPbAr4ndY4a02xydc= -github.com/go-openapi/runtime v0.26.2 h1:elWyB9MacRzvIVgAZCBJmqTi7hBzU0hlKD4IvfX0Zl0= -github.com/go-openapi/runtime v0.26.2/go.mod h1:O034jyRZ557uJKzngbMDJXkcKJVzXJiymdSfgejrcRw= -github.com/go-openapi/spec v0.20.12 h1:cgSLbrsmziAP2iais+Vz7kSazwZ8rsUZd6TUzdDgkVI= -github.com/go-openapi/spec v0.20.12/go.mod h1:iSCgnBcwbMW9SfzJb8iYynXvcY6C/QFrI7otzF7xGM4= -github.com/go-openapi/strfmt v0.21.10 h1:JIsly3KXZB/Qf4UzvzJpg4OELH/0ASDQsyk//TTBDDk= -github.com/go-openapi/strfmt v0.21.10/go.mod h1:vNDMwbilnl7xKiO/Ve/8H8Bb2JIInBnH+lqiw6QWgis= -github.com/go-openapi/swag v0.22.5 h1:fVS63IE3M0lsuWRzuom3RLwUMVI2peDH01s6M70ugys= -github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= -github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= -github.com/go-openapi/validate v0.22.4/go.mod h1:qm6O8ZIcPVdSY5219468Jv7kBdGvkiZLPOmqnqTUZ2A= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= +github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= +github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= +github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= +github.com/go-openapi/runtime v0.25.0 h1:7yQTCdRbWhX8vnIjdzU8S00tBYf7Sg71EBeorlPHvhc= +github.com/go-openapi/runtime v0.25.0/go.mod h1:Ux6fikcHXyyob6LNWxtE96hWwjBPYF0DXgVFuMTneOs= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= +github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4= +github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -198,12 +326,14 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -213,37 +343,39 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v33 v33.0.1-0.20210113204525-9318e629ec69 h1:zL0/Ug5CMhV0XRb3A6vnK1SQ9kJM3VIyRxPQ5t9w8Bg= github.com/google/go-github/v33 v33.0.1-0.20210113204525-9318e629ec69/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.4 h1:uGy6JWR/uMIILU8wbf+OkstIrNiMjGpEIyhx8f6W7s4= -github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= -github.com/hashicorp/consul/api v1.25.1 h1:CqrdhYzc8XZuPnhIYZWH45toM0LB9ZeYr/gvpLVI3PE= -github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= -github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/consul/api v1.10.1 h1:MwZJp86nlnL+6+W1Zly4JUuVn9YHhMggBirMpHGD7kw= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-azure-helpers v0.16.5 h1:rhcpg2Nk1Li6173KTHNnj/i+MGXYNjvYKIdNlg6q3RU= +github.com/hashicorp/go-azure-helpers v0.16.5/go.mod h1:kR7+sTDEb9TOp/O80ss1UEJg1t4/BHLD/U8wHLS4BGQ= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de/go.mod h1:xIwEieBHERyEvaeKF/TcHh1Hu+lxPM+n2vT1+g9I4m4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -252,91 +384,133 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 h1:kgvybwEeu0SXktbB2y3uLHX9lklLo+nzUwh59A3jzQc= github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840/go.mod h1:Abjk0jbRkDaNCzsRhOv2iDCofYpX1eVsjozoiK63qLA= -github.com/hashicorp/go-getter/gcs/v2 v2.2.1 h1:yZgDXYy5m4xogJV8hXzX5S/fM/rjJnBz+EzTeFrfLEM= -github.com/hashicorp/go-getter/gcs/v2 v2.2.1/go.mod h1:xzT3sNmGRipCRMpWz24fYHMvgb4MRn/smg5k2mhJ7Bo= -github.com/hashicorp/go-getter/s3/v2 v2.2.1 h1:Psuhz6iuCxJOd3kGinK46x+4BzcJgwff8BId7CuGPYU= -github.com/hashicorp/go-getter/s3/v2 v2.2.1/go.mod h1:KDqfEPgpwZIy+1sAplFX231CE+M6wdL5Q/j6OMbKSnw= -github.com/hashicorp/go-getter/v2 v2.2.1 h1:2JXqPZs1Jej67RtdTi0YZaEB2hEFB3fkBA4cPYKQwFQ= -github.com/hashicorp/go-getter/v2 v2.2.1/go.mod h1:EcJx6oZE8hmGuRR1l38QrfnyiujQbwsEAn11eHv6l2M= +github.com/hashicorp/go-getter/gcs/v2 v2.2.0 h1:oo6LVXva9I4CZzv531mn/FY5gtRx540I6eWwJVPWA4o= +github.com/hashicorp/go-getter/gcs/v2 v2.2.0/go.mod h1:oDHNhZN2Gf6UqfIol4S9PkbzMFlf8rBctrJvAHDTtOM= +github.com/hashicorp/go-getter/s3/v2 v2.2.0 h1:JGZihrdkZnuw+bDf8BnxuRLPwi0cfL2mwRlWA2lREAg= +github.com/hashicorp/go-getter/s3/v2 v2.2.0/go.mod h1:hj0uM2nGIi0rln/VcvxjaQYQg3WGssfUh/ya5jA555g= +github.com/hashicorp/go-getter/v2 v2.2.0 h1:vLenCsJqB5oNE141xKtT6cajhwAE8dneiNgzZA3oOqs= +github.com/hashicorp/go-getter/v2 v2.2.0/go.mod h1:EcJx6oZE8hmGuRR1l38QrfnyiujQbwsEAn11eHv6l2M= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY= +github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= -github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= -github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/hcp-sdk-go v0.79.0 h1:tcAbyWtRnn7rI306YPMav/VpbzcpDf3yRsHKiCUQtuc= -github.com/hashicorp/hcp-sdk-go v0.79.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= +github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= +github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= +github.com/hashicorp/hcp-sdk-go v0.36.0 h1:B1qvnsStyYQyuEudgPrpMdheEC/zTeHRhyF1UwpYTJQ= +github.com/hashicorp/hcp-sdk-go v0.36.0/go.mod h1:mJHPFD1Rs62bieKNVXUiFQlF76NCGACKqHu9a8ihcFk= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= -github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/memberlist v0.2.2 h1:5+RffWKwqJ71YPu9mWsF7ZOscZmwfasdA8kbdC7AO2g= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/packer-plugin-amazon v1.2.1 h1:0Xqr8KsTJJhIo0vvjqPYrVMgyVxNRuYH4DeB5m/WAtw= github.com/hashicorp/packer-plugin-amazon v1.2.1/go.mod h1:qlp0h5TWVGgcPzN9mSxPiEAwOUOW3XU/zep0pGd0ZsM= -github.com/hashicorp/packer-plugin-sdk v0.5.2 h1:N+9qzkZLkjR0bgY+l5wFvrTN0G/Mf9f7g2yLsrDjmFI= -github.com/hashicorp/packer-plugin-sdk v0.5.2/go.mod h1:0LRUBS6CPClHvq6zPoGRi7C+cZDAIEaW4CeH4LhWWuc= -github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= -github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= -github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= -github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= -github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/hashicorp/packer-plugin-ansible v1.0.3 h1:XjltQVPYnnZdNyBjwHr1QthR413SjZxTtRrmM0sM3VI= +github.com/hashicorp/packer-plugin-ansible v1.0.3/go.mod h1:N4OZtNDq2FSRBknuNU/GSoKtllfxQnHCYYaJUD1p1MA= +github.com/hashicorp/packer-plugin-azure v1.4.0 h1:rxkcGe5pjjnzddfR5/sBJmg8kb+ko+r2M+Ce7OC8sQ4= +github.com/hashicorp/packer-plugin-azure v1.4.0/go.mod h1:7j1q0SNPeZr7xRID0c/Hu9QojE41pSlSJwsNB9/rOTI= +github.com/hashicorp/packer-plugin-docker v1.0.8 h1:UWPG/pl+1RFsaNQVhEuowCeOZuES6/mqy5R6FTyMeQo= +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-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= +github.com/hashicorp/packer-plugin-sdk v0.4.0/go.mod h1:uNhU3pmjM2ejgHYce/g4J+sa5rh81iYQztpGvGa5FOs= +github.com/hashicorp/packer-plugin-vagrant v1.0.3 h1:IUfEdYuAjSjGsgJI2rnZ1qEo5rI0UWoueJ+yq9ysx4M= +github.com/hashicorp/packer-plugin-vagrant v1.0.3/go.mod h1:Ymg8LJrT8N2Dclu91G3ZhXpE67jL7hfbtyDVKeNsKTc= +github.com/hashicorp/packer-plugin-virtualbox v1.0.4 h1:mceFO34yhBU4BUMmCcQAB6KQ98GPjBIXTG3eS22RmZM= +github.com/hashicorp/packer-plugin-virtualbox v1.0.4/go.mod h1:rnDkWJpkbcFPBmsMZcoImWDd9kLjTiXiN0sfHypuHac= +github.com/hashicorp/packer-plugin-vmware v1.0.7 h1:cnc6XRNAkE+P5EoiI4VLXmIUeb2VAqW6zdNFmIW11YY= +github.com/hashicorp/packer-plugin-vmware v1.0.7/go.mod h1:AGeNk9f/qKUP8yGoiofMqvBw8TJLtdhsZgvqannZQS4= +github.com/hashicorp/packer-plugin-vsphere v1.1.1 h1:X4PtYV7TGPqoudjfvHpI2qRl9pAGf1SfkiJ7sMCKAEU= +github.com/hashicorp/packer-plugin-vsphere v1.1.1/go.mod h1:kLbvU4EwRISjhvY3c5pVisCKE0Usn+pOMRkIPnwcPfU= +github.com/hashicorp/serf v0.9.5 h1:EBWvyu9tcRszt3Bxp3KNssBMP1KuHWyO51lz9+786iM= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE= +github.com/hashicorp/vault/api v1.1.1 h1:907ld+Z9cALyvbZK2qUX9cLwvSaEQsMVQB3x2KE8+AI= +github.com/hashicorp/vault/api v1.1.1/go.mod h1:29UXcn/1cLOPHQNMWA7bCz2By4PSd0VKPAydKXS5yN0= +github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= +github.com/hashicorp/vault/sdk v0.2.1 h1:S4O6Iv/dyKlE9AUTXGa7VOvZmsCvg36toPKgV4f2P4M= +github.com/hashicorp/vault/sdk v0.2.1/go.mod h1:WfUiO1vYzfBkz1TmoE4ZGU7HD0T0Cl/rZwaxjBkgN4U= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493 h1:brI5vBRUlAlM34VFmnLPwjnCL/FxAJp9XvOdX6Zt+XE= +github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -344,53 +518,62 @@ github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kortschak/utter v0.0.0-20190412033250-50fe362e6560/go.mod h1:oDr41C7kH9wvAikWyFhr6UFr8R7nelpmCF5XR5rL7I8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0 h1:KqYuDbSr8I2X8H65InN8SafDEa0UaLRy6WEmxDqd0F0= github.com/masterzen/winrm v0.0.0-20210623064412-3b76017826b0/go.mod h1:l31LCh9VvG43RJ83A5JLkFPjuz48cZAxBSLQLaIn1p8= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= +github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= +github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 h1:8YAWbq7rJqfbc6IaAvA2eCQuOQvf6Bs4vHKcOyWw//E= github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= -github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -400,14 +583,21 @@ github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff h1:bFJ74ac7ZK/jyis github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff/go.mod h1:g7SZj7ABpStq3tM4zqHiVEG5un/DZ1+qJJKO7qx1EvU= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed h1:FI2NIv6fpef6BQl2u3IZX/Cj20tfypRF4yd+uaHOMtI= +github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -423,14 +613,24 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -github.com/nywilken/go-cty v1.13.3 h1:03U99oXf3j3g9xgqAE3YGpixCjM8Mg09KZ0Ji9LzX0o= -github.com/nywilken/go-cty v1.13.3/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db h1:9uViuKtx1jrlXLBW/pMnhOfzn3iSEdLase/But/IZRU= @@ -438,44 +638,52 @@ github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db/go.mod h1 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -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/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +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/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= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.2 h1:taJnKntsWgU+qae21Rx52lIwndAdKrj0mfUNQsz1z4Q= github.com/pkg/sftp v1.13.2/go.mod h1:LzqnAvaD5TWeNBsZpfKxSYn1MbjWwOsCIAFFJbpIsK8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= @@ -486,17 +694,17 @@ github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLr github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= -github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -509,12 +717,11 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= @@ -526,211 +733,248 @@ github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxW github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmware/govmomi v0.29.0 h1:SHJQ7DUc4fltFZv16znJNGHR1/XhiDK5iKxm2OqwkuU= +github.com/vmware/govmomi v0.29.0/go.mod h1:F7adsVewLNHsW/IIm7ziFURaXDaHEwcc+ym4r3INMdY= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= +github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= +github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= +github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= -go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= -go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= -go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= -go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= -go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= -go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.mongodb.org/mongo-driver v1.11.0 h1:FZKhBSTydeuffHj9CBjXlR8vQLee1cQyTWYPA6/tqiE= +go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= +go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= +go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= +go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= +go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200422194213-44a606286825/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +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-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +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.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1 h1:t3ZHqovedSY8DEAUmZA99fPJhUhOb176PLACYA1sJ8Y= +golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1/go.mod h1:jFTmtFYCV0MFtXBU+J5V/+5AUeVS0ON/0WkE/KSrl6E= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +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.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +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.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +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= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +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.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= 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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +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= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.128.0 h1:RjPESny5CnQRn9V6siglged+DZCgfu9l6mO9dkX9VOg= -google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= +google.golang.org/api v0.101.0 h1:lJPPeEBIRxGpGLwnBTam1NPEM8Z2BmmXEd3z812pjwM= +google.golang.org/api v0.101.0/go.mod h1:CjxAAWWt3A3VrUE2IGDY2bgK5qhoG/OkyWVlYcP05MY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -742,20 +986,30 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= +gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -763,7 +1017,12 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 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..7e1cab56aa3 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 @@ -7,6 +7,7 @@ import ( "bytes" "fmt" "io" + "io/ioutil" "os" "os/exec" "path/filepath" @@ -75,7 +76,7 @@ func (f *HCL2Formatter) Format(path string) (int, hcl.Diagnostics) { return f.formatFile(path, diags, bytesModified) } - fileInfos, err := os.ReadDir(path) + fileInfos, err := ioutil.ReadDir(path) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -128,7 +129,7 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { } } - inSrc, err := io.ReadAll(in) + inSrc, err := ioutil.ReadAll(in) if err != nil { return nil, fmt.Errorf("failed to read %s: %s", filename, err) } @@ -157,7 +158,7 @@ func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { if filename == "-" { _, _ = f.Output.Write(outSrc) } else { - if err := os.WriteFile(filename, outSrc, 0644); err != nil { + if err := ioutil.WriteFile(filename, outSrc, 0644); err != nil { return nil, err } } @@ -177,14 +178,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 := os.CreateTemp("", "") + f1, err := ioutil.TempFile("", "") if err != nil { return } defer os.Remove(f1.Name()) defer f1.Close() - f2, err := os.CreateTemp("", "") + f2, err := ioutil.TempFile("", "") if err != nil { return } diff --git a/hcl2template/formatter_test.go b/hcl2template/formatter_test.go index 8cb909292a9..42051c0a8d3 100644 --- a/hcl2template/formatter_test.go +++ b/hcl2template/formatter_test.go @@ -1,10 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template import ( "bytes" + "io/ioutil" "os" "os/exec" "strings" @@ -47,12 +48,12 @@ func TestHCL2Formatter_Format_Write(t *testing.T) { f.Output = &buf f.Write = true - unformattedData, err := os.ReadFile("testdata/format/unformatted.pkr.hcl") + unformattedData, err := ioutil.ReadFile("testdata/format/unformatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the unformatted fixture %s", err) } - tf, err := os.CreateTemp("", "*.pkr.hcl") + tf, err := ioutil.TempFile("", "*.pkr.hcl") if err != nil { t.Fatalf("failed to create tempfile for test %s", err) } @@ -67,12 +68,12 @@ func TestHCL2Formatter_Format_Write(t *testing.T) { } //lets re-read the tempfile which should now be formatted - data, err := os.ReadFile(tf.Name()) + data, err := ioutil.ReadFile(tf.Name()) if err != nil { t.Fatalf("failed to open the newly formatted fixture %s", err) } - formattedData, err := os.ReadFile("testdata/format/formatted.pkr.hcl") + formattedData, err := ioutil.ReadFile("testdata/format/formatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the formatted fixture %s", err) } 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 a2b0cc9d17c..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 @@ -12,20 +12,19 @@ import ( "github.com/zclconf/go-cty/cty/function" ) -// initTime is the UTC time when this package was initialized. It is +// InitTime is the UTC time when this package was initialized. It is // used as the timestamp for all configuration templates so that they // match for a single build. -var initTime time.Time +var InitTime time.Time func init() { - initTime = time.Now().UTC() + InitTime = time.Now().UTC() } // TimestampFunc constructs a function that returns a string representation of the current date and time. var TimestampFunc = function.New(&function.Spec{ - Params: []function.Parameter{}, - Type: function.StaticReturnType(cty.String), - RefineResult: refineNotNull, + Params: []function.Parameter{}, + Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(time.Now().UTC().Format(time.RFC3339)), nil }, @@ -41,46 +40,42 @@ func Timestamp() (cty.Value, error) { } // LegacyIsotimeFunc constructs a function that returns a string representation -// of the current date and time using the Go language datetime formatting syntax. +// of the current date and time using golang's datetime formatting. var LegacyIsotimeFunc = function.New(&function.Spec{ Params: []function.Parameter{}, VarParam: &function.Parameter{ Name: "format", Type: cty.String, }, - Type: function.StaticReturnType(cty.String), - RefineResult: refineNotNull, + Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { if len(args) > 1 { return cty.StringVal(""), fmt.Errorf("too many values, 1 needed: %v", args) - } - if len(args) == 0 { - return cty.StringVal(initTime.Format(time.RFC3339)), nil + } else if len(args) == 0 { + return cty.StringVal(InitTime.Format(time.RFC3339)), nil } format := args[0].AsString() - return cty.StringVal(initTime.Format(format)), nil + return cty.StringVal(InitTime.Format(format)), nil }, }) // LegacyStrftimeFunc constructs a function that returns a string representation -// of the current date and time using the Go language strftime datetime formatting syntax. +// of the current date and time using golang's strftime datetime formatting. var LegacyStrftimeFunc = function.New(&function.Spec{ Params: []function.Parameter{}, VarParam: &function.Parameter{ Name: "format", Type: cty.String, }, - Type: function.StaticReturnType(cty.String), - RefineResult: refineNotNull, + Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { if len(args) > 1 { return cty.StringVal(""), fmt.Errorf("too many values, 1 needed: %v", args) - } - if len(args) == 0 { - return cty.StringVal(initTime.Format(time.RFC3339)), nil + } else if len(args) == 0 { + return cty.StringVal(InitTime.Format(time.RFC3339)), nil } format := args[0].AsString() - return cty.StringVal(strftime.Format(format, initTime)), nil + return cty.StringVal(strftime.Format(format, InitTime)), nil }, }) 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 b6c36e68494..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 @@ -21,8 +21,7 @@ var EnvFunc = function.New(&function.Spec{ AllowUnknown: false, }, }, - Type: function.StaticReturnType(cty.String), - RefineResult: refineNotNull, + Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { key := args[0].AsString() value := os.Getenv(key) diff --git a/hcl2template/function/index.go b/hcl2template/function/index.go index 8aade576ded..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 @@ -23,8 +23,7 @@ var IndexFunc = function.New(&function.Spec{ Type: cty.DynamicPseudoType, }, }, - Type: function.StaticReturnType(cty.Number), - RefineResult: refineNotNull, + Type: function.StaticReturnType(cty.Number), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { if !(args[0].Type().IsListType() || args[0].Type().IsTupleType()) { return cty.NilVal, errors.New("argument must be a list or tuple") 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 f2b83dad925..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 @@ -29,7 +29,6 @@ var LengthFunc = function.New(&function.Spec{ return cty.Number, errors.New("argument must be a string, a collection type, or a structural type") } }, - RefineResult: refineNotNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { coll := args[0] collTy := args[0].Type() diff --git a/hcl2template/function/length_test.go b/hcl2template/function/length_test.go index 9bae3886f74..2c6f10c49d6 100644 --- a/hcl2template/function/length_test.go +++ b/hcl2template/function/length_test.go @@ -1,11 +1,10 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package function import ( "fmt" - "math" "testing" "github.com/zclconf/go-cty/cty" @@ -70,15 +69,11 @@ func TestLength(t *testing.T) { }, { cty.UnknownVal(cty.List(cty.Bool)), - cty.UnknownVal(cty.Number).Refine(). - NotNull(). - NumberRangeLowerBound(cty.Zero, true). - NumberRangeUpperBound(cty.NumberIntVal(math.MaxInt), true). - NewValue(), + cty.UnknownVal(cty.Number), }, { cty.DynamicVal, - cty.UnknownVal(cty.Number).RefineNotNull(), + cty.UnknownVal(cty.Number), }, { cty.StringVal("hello"), @@ -123,10 +118,11 @@ func TestLength(t *testing.T) { }, { cty.UnknownVal(cty.String), - cty.UnknownVal(cty.Number).Refine(). - NotNull(). - NumberRangeLowerBound(cty.Zero, true). - NewValue(), + cty.UnknownVal(cty.Number), + }, + { + cty.DynamicVal, + cty.UnknownVal(cty.Number), }, } diff --git a/hcl2template/function/refinements.go b/hcl2template/function/refinements.go deleted file mode 100644 index 99314d7ee48..00000000000 --- a/hcl2template/function/refinements.go +++ /dev/null @@ -1,9 +0,0 @@ -package function - -import ( - "github.com/zclconf/go-cty/cty" -) - -func refineNotNull(b *cty.RefinementBuilder) *cty.RefinementBuilder { - return b.NotNull() -} 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..2246131fa88 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 @@ -163,14 +163,28 @@ func (p *Parser) Parse(filename string, varFiles []string, argVars map[string]st return cfg, diags } - // Decode required_plugins blocks. - // + // 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" + // } + // } // 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 @@ -294,7 +308,19 @@ func filterVarsFromLogs(inputOrLocal Variables) { } func (cfg *PackerConfig) Initialize(opts packer.InitializeOptions) hcl.Diagnostics { - diags := cfg.InputVariables.ValidateValues() + 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 = 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 321616017b6..bd1080b836b 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 @@ -8,7 +8,6 @@ import ( "fmt" "log" "runtime" - "strings" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer-plugin-sdk/didyoumean" @@ -45,6 +44,7 @@ func (cfg *PackerConfig) PluginRequirements() (plugingetter.Requirements, hcl.Di Accessor: name, Identifier: block.Type, VersionConstraints: block.Requirement.Required, + Implicit: block.PluginDependencyReason == PluginDependencyImplicit, }) uniq[name] = block } @@ -54,7 +54,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{ @@ -77,8 +77,6 @@ func (cfg *PackerConfig) DetectPluginBinaries() hcl.Diagnostics { return diags } - uninstalledPlugins := map[string]string{} - for _, pluginRequirement := range pluginReqs { sortedInstalls, err := pluginRequirement.ListInstallations(opts) if err != nil { @@ -90,7 +88,11 @@ func (cfg *PackerConfig) DetectPluginBinaries() hcl.Diagnostics { continue } if len(sortedInstalls) == 0 { - uninstalledPlugins[pluginRequirement.Identifier.String()] = pluginRequirement.VersionConstraints.String() + 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 ?", + }) continue } log.Printf("[TRACE] Found the following %q installations: %v", pluginRequirement.Identifier, sortedInstalls) @@ -106,20 +108,6 @@ 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 } @@ -133,22 +121,10 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { // its body. srcUsage := &(build.Sources[i]) if !cfg.parser.PluginConfig.Builders.Has(srcUsage.Type) { - detail := fmt.Sprintf( - "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - buildSourceLabel, - srcUsage.Type, - strings.Split(srcUsage.Type, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(srcUsage.Type, cfg.parser.PluginConfig.Builders.List()); sugg != "" { - detail = fmt.Sprintf("Did you mean to use %q?", sugg) - } diags = append(diags, &hcl.Diagnostic{ Summary: "Unknown " + buildSourceLabel + " type " + srcUsage.Type, Subject: &build.HCL2Ref.DefRange, - Detail: detail, + Detail: fmt.Sprintf("known builders: %v", cfg.parser.PluginConfig.Builders.List()), Severity: hcl.DiagError, }) continue @@ -181,23 +157,10 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { for _, provBlock := range build.ProvisionerBlocks { if !cfg.parser.PluginConfig.Provisioners.Has(provBlock.PType) { - detail := fmt.Sprintf( - "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - buildProvisionerLabel, - provBlock.PType, - strings.Split(provBlock.PType, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(provBlock.PType, cfg.parser.PluginConfig.Provisioners.List()); sugg != "" { - detail = fmt.Sprintf("Did you mean to use %q?", sugg) - } - diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildProvisionerLabel+" type %q", provBlock.PType), Subject: provBlock.HCL2Ref.TypeRange.Ptr(), - Detail: detail, + Detail: fmt.Sprintf("known "+buildProvisionerLabel+"s: %v", cfg.parser.PluginConfig.Provisioners.List()), Severity: hcl.DiagError, }) } @@ -205,23 +168,10 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { if build.ErrorCleanupProvisionerBlock != nil { if !cfg.parser.PluginConfig.Provisioners.Has(build.ErrorCleanupProvisionerBlock.PType) { - detail := fmt.Sprintf( - "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - buildErrorCleanupProvisionerLabel, - build.ErrorCleanupProvisionerBlock.PType, - strings.Split(build.ErrorCleanupProvisionerBlock.PType, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(build.ErrorCleanupProvisionerBlock.PType, cfg.parser.PluginConfig.Provisioners.List()); sugg != "" { - detail = fmt.Sprintf("Did you mean to use %q?", sugg) - } - diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildErrorCleanupProvisionerLabel+" type %q", build.ErrorCleanupProvisionerBlock.PType), Subject: build.ErrorCleanupProvisionerBlock.HCL2Ref.TypeRange.Ptr(), - Detail: detail, + Detail: fmt.Sprintf("known "+buildErrorCleanupProvisionerLabel+"s: %v", cfg.parser.PluginConfig.Provisioners.List()), Severity: hcl.DiagError, }) } @@ -230,23 +180,10 @@ func (cfg *PackerConfig) initializeBlocks() hcl.Diagnostics { for _, ppList := range build.PostProcessorsLists { for _, ppBlock := range ppList { if !cfg.parser.PluginConfig.PostProcessors.Has(ppBlock.PType) { - detail := fmt.Sprintf( - "The %s %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - buildPostProcessorLabel, - ppBlock.PType, - strings.Split(ppBlock.PType, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(ppBlock.PType, cfg.parser.PluginConfig.PostProcessors.List()); sugg != "" { - detail = fmt.Sprintf("Did you mean to use %q?", sugg) - } - diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildPostProcessorLabel+" type %q", ppBlock.PType), Subject: ppBlock.HCL2Ref.TypeRange.Ptr(), - Detail: detail, + Detail: fmt.Sprintf("known "+buildPostProcessorLabel+"s: %v", cfg.parser.PluginConfig.PostProcessors.List()), Severity: hcl.DiagError, }) } 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 23bc7c5900f..9ae5e995ecc 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 @@ -10,6 +10,7 @@ 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" ) @@ -44,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: "empty value", + Summary: fmt.Sprintf("empty value"), Subject: &datasource.block.DefRange, Severity: hcl.DiagError, }) @@ -64,25 +65,23 @@ func (ds *Datasources) Values() (map[string]cty.Value, hcl.Diagnostics) { return res, diags } -func (cfg *PackerConfig) startDatasource(ds DatasourceBlock) (packersdk.Datasource, hcl.Diagnostics) { +func (cfg *PackerConfig) startDatasource(dataSourceStore packer.DatasourceStore, ref DatasourceRef, secondaryEvaluation bool) (packersdk.Datasource, hcl.Diagnostics) { var diags hcl.Diagnostics - block := ds.block - - dataSourceStore := cfg.parser.PluginConfig.DataSources + block := cfg.Datasources[ref].block if dataSourceStore == nil { diags = append(diags, &hcl.Diagnostic{ - Summary: "Unknown " + dataSourceLabel + " type " + ds.Type, + Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, Subject: block.LabelRanges[0].Ptr(), - Detail: "packer does not currently know any data source.", + Detail: fmt.Sprintf("packer does not currently know any data source."), Severity: hcl.DiagError, }) return nil, diags } - if !dataSourceStore.Has(ds.Type) { + if !dataSourceStore.Has(ref.Type) { diags = append(diags, &hcl.Diagnostic{ - Summary: "Unknown " + dataSourceLabel + " type " + ds.Type, + Summary: "Unknown " + dataSourceLabel + " type " + ref.Type, Subject: block.LabelRanges[0].Ptr(), Detail: fmt.Sprintf("known data sources: %v", dataSourceStore.List()), Severity: hcl.DiagError, @@ -90,7 +89,7 @@ func (cfg *PackerConfig) startDatasource(ds DatasourceBlock) (packersdk.Datasour return nil, diags } - datasource, err := dataSourceStore.Start(ds.Type) + datasource, err := dataSourceStore.Start(ref.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: err.Error(), @@ -100,7 +99,7 @@ func (cfg *PackerConfig) startDatasource(ds DatasourceBlock) (packersdk.Datasour } if datasource == nil { diags = append(diags, &hcl.Diagnostic{ - Summary: fmt.Sprintf("failed to start datasource plugin %q.%q", ds.Type, ds.Name), + Summary: fmt.Sprintf("failed to start datasource plugin %q.%q", ref.Type, ref.Name), Subject: &block.DefRange, Severity: hcl.DiagError, }) 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 10963226160..84d1fe8de7d 100644 --- a/hcl2template/types.packer_config.go +++ b/hcl2template/types.packer_config.go @@ -1,10 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template import ( "fmt" + "log" "sort" "strings" @@ -122,6 +123,8 @@ 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, @@ -310,26 +313,76 @@ 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. - dependencies[ref] = []DatasourceRef{} - - // 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, + // This is essentially creating a very primitive DAG just for data + // source interdependencies. + 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) + if dependencies[ref] != nil { + dependencies[ref] = append(dependencies[ref], dependsOn) + } else { + dependencies[ref] = []DatasourceRef{dependsOn} + } + skipFirstEval = true + } } - dependencies[ref] = append(dependencies[ref], dependsOn) } + + // 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 // 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 { @@ -344,9 +397,10 @@ 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) { +func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, dependencies map[DatasourceRef][]DatasourceRef, skipExecution bool, depth int) (map[DatasourceRef][]DatasourceRef, hcl.Diagnostics, bool) { var diags hcl.Diagnostics var moreDiags hcl.Diagnostics + shouldContinue := true if depth > 10 { // Add a comment about recursion. @@ -357,9 +411,8 @@ 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 + return dependencies, diags, false } ds := cfg.Datasources[ref] @@ -370,28 +423,28 @@ 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 = cfg.recursivelyEvaluateDatasources(dep, dependencies, skipExecution, depth) + dependencies, moreDiags, shouldContinue = cfg.recursivelyEvaluateDatasources(dep, dependencies, skipExecution, depth) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { diags = append(diags, moreDiags...) - return dependencies, diags + return dependencies, diags, shouldContinue } } } // 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(ds) + datasource, startDiags := cfg.startDatasource(cfg.parser.PluginConfig.DataSources, ref, true) if startDiags.HasErrors() { diags = append(diags, startDiags...) - return dependencies, diags + return dependencies, diags, shouldContinue } if skipExecution { placeholderValue := cty.UnknownVal(hcldec.ImpliedType(datasource.OutputSpec())) ds.value = placeholderValue cfg.Datasources[ref] = ds - return dependencies, diags + return dependencies, diags, shouldContinue } opts, _ := decodeHCL2Spec(ds.block.Body, cfg.EvalContext(DatasourceContext, nil), datasource) @@ -404,14 +457,14 @@ func (cfg *PackerConfig) recursivelyEvaluateDatasources(ref DatasourceRef, depen Subject: &cfg.Datasources[ref].block.DefRange, Severity: hcl.DiagError, }) - return dependencies, diags + return dependencies, diags, shouldContinue } ds.value = realValue cfg.Datasources[ref] = ds // remove ref from the dependencies map. delete(dependencies, ref) - return dependencies, diags + return dependencies, diags, shouldContinue } // getCoreBuildProvisioners takes a list of provisioner block, starts according 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..01c090428f8 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 @@ -9,6 +9,7 @@ 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" ) @@ -43,6 +44,127 @@ 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 { @@ -55,8 +177,24 @@ 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 0329d1505ff..3a1fabd4bf7 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 @@ -46,6 +46,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, + PluginDependencyReason: PluginDependencyExplicit, }, }}, }, @@ -76,13 +77,19 @@ 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) {})}, ` + parser: getBasicParser(func(p *Parser) { + p.PluginConfig.BuilderRedirects = map[string]string{ + "amazon-chroot": "github.com/hashicorp/amazon", + } + }, + )}, ` packer { required_plugins { amazon = { @@ -107,13 +114,19 @@ 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) {})}, + parser: getBasicParser(func(p *Parser) { + p.PluginConfig.BuilderRedirects = map[string]string{ + "amazon-ebs": "github.com/hashicorp/amazon", + } + }, + )}, ` packer { }`, ` @@ -130,6 +143,202 @@ 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) { @@ -142,10 +351,13 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { t.Fatal(diags) } - _, diags = cfg.parser.ParseHCL([]byte(tt.restOfTemplate), "rest.pkr.hcl") + rest, 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/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 b3754e8f111..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 @@ -741,6 +741,7 @@ func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.F Severity: hcl.DiagError, Summary: "Invalid argument value for -var variable", Detail: fmt.Sprintf("The received arg value for %s is not compatible with the variable's type constraint: %s.", name, err), + Subject: expr.Range().Ptr(), }) val = cty.DynamicVal } 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 ce9486ed676..b74093b23fe 100644 --- a/hcl2template/utils.go +++ b/hcl2template/utils.go @@ -1,17 +1,17 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package hcl2template import ( "fmt" + "io/ioutil" "os" "path/filepath" "strings" "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" @@ -74,7 +74,7 @@ func GetHCL2Files(filename, hclSuffix, jsonSuffix string) (hclFiles, jsonFiles [ return nil, nil, diags } - fileInfos, err := os.ReadDir(filename) + fileInfos, err := ioutil.ReadDir(filename) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -187,48 +187,3 @@ 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 { - 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 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 -} 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 97a749a33bf..21a07156cc2 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 @@ -7,14 +7,14 @@ package api import ( "fmt" "log" - "net/http" "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/stable/2019-12-10/client/organization_service" - projectSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" - rmmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" + 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" "github.com/hashicorp/packer/version" @@ -44,58 +44,32 @@ func NewClient() (*Client, error) { } } - hcpClientCfg := httpclient.Config{ + cl, err := httpclient.New(httpclient.Config{ SourceChannel: fmt.Sprintf("packer/%s", version.PackerVersion.FormattedVersion()), - } - 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), } - // 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 - - return client, nil - } - if client.OrganizationID == "" { - err := client.loadOrganizationID() - if err != nil { - return nil, &ClientError{ - StatusCode: InvalidClientConfig, - Err: err, - } + if err := client.loadOrganizationID(); 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, - } + if err := client.loadProjectID(); err != nil { + return nil, &ClientError{ + StatusCode: InvalidClientConfig, + Err: err, } } @@ -103,10 +77,6 @@ func NewClient() (*Client, error) { } func (c *Client) loadOrganizationID() error { - 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) @@ -122,81 +92,63 @@ func (c *Client) loadOrganizationID() error { } func (c *Client) loadProjectID() error { - 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. listProjParams := projectSvc.NewProjectServiceListParams() listProjParams.ScopeID = &c.OrganizationID scopeType := string(rmmodels.HashicorpCloudResourcemanagerResourceIDResourceTypeORGANIZATION) listProjParams.ScopeType = &scopeType listProjResp, err := c.Project.ProjectServiceList(listProjParams, nil) - if err != nil { - //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) + 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 } - if serviceErr.Code() == http.StatusForbidden { - return fmt.Errorf("unable to fetch project\n\n"+ - "If the provided credentials are tied to a specific project try setting the %s environment variable to one you want to use.", env.HCPProjectID) + + 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 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 := findOldestProject(listProjResp.Payload.Projects) + if err != nil { + return err + } - proj, err := getOldestProject(listProjResp.Payload.Projects) - if err != nil { - return err + c.ProjectID = proj.ID } - c.ProjectID = proj.ID + return nil } -// getOldestProject retrieves the oldest project from a list based on its created_at time. -func getOldestProject(projects []*rmmodels.HashicorpCloudResourcemanagerProject) (*rmmodels.HashicorpCloudResourcemanagerProject, error) { - if len(projects) == 0 { +func findOldestProject(projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { + if len(projs) == 0 { return nil, fmt.Errorf("no project found") } - oldestTime := time.Now() - var oldestProj *rmmodels.HashicorpCloudResourcemanagerProject - for _, proj := range projects { - projTime := time.Time(proj.CreatedAt) - if projTime.Before(oldestTime) { - oldestProj = proj - oldestTime = projTime + 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 oldestProj, 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 := packerSvc.NewPackerServiceGetRegistryParams() - params.LocationOrganizationID = client.OrganizationID - params.LocationProjectID = client.ProjectID - resp, err := client.Packer.PackerServiceGetRegistry(params, nil) - if err != nil { - return err - } + return proj, nil +} - 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) +func findProjectByID(projID string, projs []*models.HashicorpCloudResourcemanagerProject) (*models.HashicorpCloudResourcemanagerProject, error) { + for _, proj := range projs { + if proj.ID == projID { + return proj, nil + } } - return 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 index 7868feca440..47ff2b5fd98 100644 --- a/internal/hcp/api/client_test.go +++ b/internal/hcp/api/client_test.go @@ -1,6 +1,3 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 - package api import ( @@ -8,10 +5,93 @@ import ( "time" "github.com/go-openapi/strfmt" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" ) -func TestGetOldestProject(t *testing.T) { +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 @@ -68,7 +148,7 @@ func TestGetOldestProject(t *testing.T) { for _, tt := range testcases { t.Run(tt.Name, func(t *testing.T) { - proj, err := getOldestProject(tt.ProjectList) + proj, err := findOldestProject(tt.ProjectList) if (err != nil) != tt.ExpectErr { t.Errorf("test findProjectByID, expected %t, got %t", tt.ExpectErr, 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 ac01c94d002..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 @@ -9,6 +9,7 @@ import ( "strconv" "github.com/go-openapi/runtime" + "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" "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" "google.golang.org/grpc/codes" @@ -51,7 +52,7 @@ func NewMockPackerClientService() *MockPackerClientService { return &m } -func (svc *MockPackerClientService) PackerServiceCreateBucket(params *packerSvc.PackerServiceCreateBucketParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceCreateBucketOK, error) { +func (svc *MockPackerClientService) PackerServiceCreateBucket(params *packerSvc.PackerServiceCreateBucketParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceCreateBucketOK, error) { if svc.BucketAlreadyExist { return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.AlreadyExists, codes.AlreadyExists.String())) @@ -78,7 +79,7 @@ func (svc *MockPackerClientService) PackerServiceCreateBucket(params *packerSvc. return ok, nil } -func (svc *MockPackerClientService) PackerServiceUpdateBucket(params *packerSvc.PackerServiceUpdateBucketParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceUpdateBucketOK, error) { +func (svc *MockPackerClientService) PackerServiceUpdateBucket(params *packerSvc.PackerServiceUpdateBucketParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceUpdateBucketOK, error) { if svc.TrackCalledServiceMethods { svc.UpdateBucketCalled = true } @@ -86,7 +87,7 @@ func (svc *MockPackerClientService) PackerServiceUpdateBucket(params *packerSvc. return packerSvc.NewPackerServiceUpdateBucketOK(), nil } -func (svc *MockPackerClientService) PackerServiceCreateIteration(params *packerSvc.PackerServiceCreateIterationParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceCreateIterationOK, error) { +func (svc *MockPackerClientService) PackerServiceCreateIteration(params *packerSvc.PackerServiceCreateIterationParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceCreateIterationOK, error) { if svc.IterationAlreadyExist { return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.AlreadyExists, codes.AlreadyExists.String())) } @@ -115,7 +116,7 @@ func (svc *MockPackerClientService) PackerServiceCreateIteration(params *packerS return ok, nil } -func (svc *MockPackerClientService) PackerServiceGetIteration(params *packerSvc.PackerServiceGetIterationParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceGetIterationOK, error) { +func (svc *MockPackerClientService) PackerServiceGetIteration(params *packerSvc.PackerServiceGetIterationParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceGetIterationOK, error) { if !svc.IterationAlreadyExist { return nil, status.Error(codes.AlreadyExists, fmt.Sprintf("Code:%d %s", codes.Aborted, codes.Aborted.String())) } @@ -163,7 +164,7 @@ func (svc *MockPackerClientService) PackerServiceGetIteration(params *packerSvc. return ok, nil } -func (svc *MockPackerClientService) PackerServiceCreateBuild(params *packerSvc.PackerServiceCreateBuildParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceCreateBuildOK, error) { +func (svc *MockPackerClientService) PackerServiceCreateBuild(params *packerSvc.PackerServiceCreateBuildParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceCreateBuildOK, error) { if params.BucketSlug == "" { return nil, errors.New("No valid BucketSlug was passed in") } @@ -196,7 +197,7 @@ func (svc *MockPackerClientService) PackerServiceCreateBuild(params *packerSvc.P return ok, nil } -func (svc *MockPackerClientService) PackerServiceUpdateBuild(params *packerSvc.PackerServiceUpdateBuildParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceUpdateBuildOK, error) { +func (svc *MockPackerClientService) PackerServiceUpdateBuild(params *packerSvc.PackerServiceUpdateBuildParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceUpdateBuildOK, error) { if params.BuildID == "" { return nil, errors.New("No valid BuildID was passed in") } @@ -222,7 +223,7 @@ func (svc *MockPackerClientService) PackerServiceUpdateBuild(params *packerSvc.P return ok, nil } -func (svc *MockPackerClientService) PackerServiceListBuilds(params *packerSvc.PackerServiceListBuildsParams, _ runtime.ClientAuthInfoWriter, opts ...packerSvc.ClientOption) (*packerSvc.PackerServiceListBuildsOK, error) { +func (svc *MockPackerClientService) PackerServiceListBuilds(params *packerSvc.PackerServiceListBuildsParams, _ runtime.ClientAuthInfoWriter, opts ...packer_service.ClientOption) (*packerSvc.PackerServiceListBuildsOK, error) { status := models.HashicorpCloudPackerBuildStatusUNSET images := make([]*models.HashicorpCloudPackerImage, 0) 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..0cf459015e8 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 @@ -13,10 +13,6 @@ func HasProjectID() bool { return hasEnvVar(HCPProjectID) } -func HasOrganizationID() bool { - return hasEnvVar(HCPOrganizationID) -} - func HasClientID() bool { return hasEnvVar(HCPClientID) } 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..71258c13be3 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 @@ -7,7 +7,6 @@ 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" 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..728f56860af 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. @@ -9,6 +9,7 @@ package main import ( "fmt" "io" + "io/ioutil" "log" "math/rand" "os" @@ -64,13 +65,13 @@ func realMain() int { return 1 } if logWriter == nil { - logWriter = io.Discard + logWriter = ioutil.Discard } packersdk.LogSecretFilter.SetOutput(logWriter) // Disable logging here - log.SetOutput(io.Discard) + log.SetOutput(ioutil.Discard) // We always send logs to a temporary file that we use in case // there is a panic. Otherwise, we delete it. @@ -251,16 +252,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, @@ -334,6 +325,72 @@ 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/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..f9a1483ff87 100644 --- a/packer/client_test.go +++ b/packer/client_test.go @@ -1,10 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer import ( "bytes" + "io/ioutil" "os" "strings" "testing" @@ -101,7 +102,7 @@ func TestClient_Stderr(t *testing.T) { func TestClient_Stdin(t *testing.T) { // Overwrite stdin for this test with a temporary file - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } 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 7a56dc06cc5..4d62cce6bc3 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 @@ -18,7 +18,6 @@ import ( multierror "github.com/hashicorp/go-multierror" version "github.com/hashicorp/go-version" hcl "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/packer-plugin-sdk/didyoumean" packersdk "github.com/hashicorp/packer-plugin-sdk/packer" "github.com/hashicorp/packer-plugin-sdk/template" "github.com/hashicorp/packer-plugin-sdk/template/interpolate" @@ -133,12 +132,6 @@ 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 { @@ -219,33 +212,15 @@ func (c *Core) BuildNames(only, except []string) []string { func (c *Core) generateCoreBuildProvisioner(rawP *template.Provisioner, rawName string) (CoreBuildProvisioner, error) { // Get the provisioner cbp := CoreBuildProvisioner{} - - if !c.components.PluginConfig.Provisioners.Has(rawP.Type) { - err := fmt.Errorf( - "The provisioner %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - rawP.Type, - strings.Split(rawP.Type, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(rawP.Type, c.components.PluginConfig.Provisioners.List()); sugg != "" { - err = fmt.Errorf("Did you mean to use %q?", sugg) - } - - return cbp, err - } - provisioner, err := c.components.PluginConfig.Provisioners.Start(rawP.Type) if err != nil { return cbp, fmt.Errorf( "error initializing provisioner '%s': %s", rawP.Type, err) } - // Seems unlikely that a provisioner doesn't start successfully without error if provisioner == nil { return cbp, fmt.Errorf( - "provisioner failed to be started and did not error: %s", rawP.Type) + "provisioner type not found: %s", rawP.Type) } // Get the configuration @@ -354,22 +329,6 @@ func (c *Core) Build(n string) (packersdk.Build, error) { // For reference, the builtin BuilderStore is generated in // packer/config.go in the Discover() func. - if !c.components.PluginConfig.Builders.Has(configBuilder.Type) { - err := fmt.Errorf( - "The builder %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - configBuilder.Type, - strings.Split(configBuilder.Type, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(configBuilder.Type, c.components.PluginConfig.Builders.List()); sugg != "" { - err = fmt.Errorf("Did you mean to use %q?", sugg) - } - - return nil, err - } - // the Start command launches the builder plugin of the given type without // calling Prepare() or passing any build-specific details. builder, err := c.components.PluginConfig.Builders.Start(configBuilder.Type) @@ -431,22 +390,6 @@ func (c *Core) Build(n string) (packersdk.Build, error) { break } - if !c.components.PluginConfig.PostProcessors.Has(rawP.Type) { - err := fmt.Errorf( - "The post-processor %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+ - "You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+ - "https://developer.hashicorp.com/packer/integrations?filter=%s", - rawP.Type, - strings.Split(rawP.Type, "-")[0], - ) - - if sugg := didyoumean.NameSuggestion(rawP.Type, c.components.PluginConfig.PostProcessors.List()); sugg != "" { - err = fmt.Errorf("Did you mean to use %q?", sugg) - } - - return nil, err - } - // Get the post-processor postProcessor, err := c.components.PluginConfig.PostProcessors.Start(rawP.Type) if err != nil { 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..c094a33e332 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 @@ -11,6 +11,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "log" "net/http" "os" @@ -70,7 +71,7 @@ func transformChecksumStream() func(in io.ReadCloser) (io.ReadCloser, error) { } } _, _ = buffer.WriteString("]") - return io.NopCloser(buffer), nil + return ioutil.NopCloser(buffer), nil } } @@ -102,7 +103,7 @@ func transformVersionStream(in io.ReadCloser) (io.ReadCloser, error) { return nil, err } - return io.NopCloser(buf), nil + return ioutil.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 d6f52ebcc22..09acf7052c8 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 @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "log" "os" "path/filepath" @@ -42,6 +43,9 @@ 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 { @@ -177,7 +181,7 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL continue } - res = append(res, &Installation{ + res.InsertSortedUniq(&Installation{ BinaryPath: path, Version: pluginVersionStr, }) @@ -206,6 +210,22 @@ func (l InstallList) String() string { return v.String() } +// InsertSortedUniq inserts the installation in the right spot in the list by +// comparing the version lexicographically. +// A Duplicate version will replace any already present version. +func (l *InstallList) InsertSortedUniq(install *Installation) { + pos := sort.Search(len(*l), func(i int) bool { return (*l)[i].Version >= install.Version }) + if len(*l) > pos && (*l)[pos].Version == install.Version { + // already detected, let's ignore any new foundings, this way any plugin + // close to cwd or the packer exec takes precedence; this will be better + // for plugin development/tests. + return + } + (*l) = append((*l), nil) + copy((*l)[pos+1:], (*l)[pos:]) + (*l)[pos] = install +} + // Installation describes a plugin installation type Installation struct { // path to where binary is installed, if installed. @@ -228,9 +248,6 @@ type InstallOptions struct { // folder of this list. InFolders []string - // Forces installation of the plugin, even if already installed. - Force bool - BinaryInstallationOptions } @@ -569,7 +586,7 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) log.Printf("[TRACE] found a pre-exising %q checksum file", potentialChecksumer.Type) // if outputFile is there and matches the checksum: do nothing more. - if err := localChecksum.ChecksumFile(localChecksum.Expected, potentialOutputFilename); err == nil && !opts.Force { + if err := localChecksum.ChecksumFile(localChecksum.Expected, potentialOutputFilename); err == nil { log.Printf("[INFO] %s v%s plugin is already correctly installed in %q", pr.Identifier, version, potentialOutputFilename) return nil, nil // success } @@ -700,7 +717,7 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error) log.Printf("[WARNING] %v, ignoring", err) } - if err := os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0644); err != nil { + if err := ioutil.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 e13f8cb3825..3105fb1e667 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 @@ -10,6 +10,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "log" "os" "path/filepath" @@ -27,8 +28,6 @@ var ( pluginFolderTwo = filepath.Join("testdata", "plugins_2") - pluginFolderThree = filepath.Join("testdata", "plugins_3") - pluginFolderWrongChecksums = filepath.Join("testdata", "wrong_checksums") ) @@ -108,8 +107,8 @@ func TestPlugin_ListInstallations(t *testing.T) { BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_windows_amd64.exe"), }, { - Version: "v4.5.6", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), + Version: "v4.5.6", }, { Version: "v4.5.7", @@ -119,22 +118,10 @@ func TestPlugin_ListInstallations(t *testing.T) { Version: "v4.5.8", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.8_x5.0_windows_amd64.exe"), }, - { - Version: "v4.5.6", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), - }, { Version: "v4.5.9", BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), }, - { - Version: "v4.5.6", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp copy", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), - }, - { - Version: "v4.5.9", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp copy", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), - }, }, }, @@ -202,10 +189,6 @@ func TestPlugin_ListInstallations(t *testing.T) { Version: "v1.2.3", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.0_darwin_amd64"), }, - { - Version: "v1.2.3", - BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.3_x5.1_darwin_amd64"), - }, { Version: "v1.2.4", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.4_x5.0_darwin_amd64"), @@ -294,48 +277,12 @@ func TestPlugin_ListInstallations(t *testing.T) { Version: "v4.5.8", BinaryPath: filepath.Join(pluginFolderOne, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.8_x5.0_windows_amd64.exe"), }, - { - Version: "v4.5.6", - BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.6_x5.0_windows_amd64.exe"), - }, { Version: "v4.5.9", BinaryPath: filepath.Join(pluginFolderTwo, "github.com", "hashicorp", "google", "packer-plugin-google_v4.5.9_x5.0_windows_amd64.exe"), }, }, }, - { - "test nil identifier - multiple plugins with same version", - fields{ - Identifier: "", - }, - ListInstallationsOptions{ - []string{ - pluginFolderThree, - }, - BinaryInstallationOptions{ - APIVersionMajor: "5", APIVersionMinor: "0", - OS: "linux", ARCH: "amd64", - Checksummers: []Checksummer{ - { - Type: "sha256", - Hash: sha256.New(), - }, - }, - }, - }, - false, - []*Installation{ - { - Version: "v1.2.5", - BinaryPath: filepath.Join(pluginFolderThree, "github.com", "hashicorp", "alazon", "packer-plugin-alazon_v1.2.5_x5.0_linux_amd64"), - }, - { - Version: "v1.2.5", - BinaryPath: filepath.Join(pluginFolderThree, "github.com", "hashicorp", "amazon", "packer-plugin-amazon_v1.2.5_x5.0_linux_amd64"), - }, - }, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -403,7 +350,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "5", APIVersionMinor: "0", OS: "darwin", ARCH: "amd64", @@ -440,7 +386,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "5", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -486,7 +431,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "5", APIVersionMinor: "0", OS: "darwin", ARCH: "amd64", @@ -534,7 +478,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -585,7 +528,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -636,7 +578,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "linux", ARCH: "amd64", @@ -681,7 +622,6 @@ func TestRequirement_InstallLatest(t *testing.T) { pluginFolderOne, pluginFolderTwo, }, - false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -723,7 +663,6 @@ func TestRequirement_InstallLatest(t *testing.T) { []string{ pluginFolderWrongChecksums, }, - false, BinaryInstallationOptions{ APIVersionMajor: "6", APIVersionMinor: "1", OS: "darwin", ARCH: "amd64", @@ -815,7 +754,7 @@ func (g *mockPluginGetter) Get(what string, options GetOptions) (io.ReadCloser, panic(err) } }() - return io.NopCloser(read), nil + return ioutil.NopCloser(read), nil } func zipFile(content map[string]string) io.ReadCloser { @@ -839,7 +778,7 @@ func zipFile(content map[string]string) io.ReadCloser { if err != nil { panic(err) } - return io.NopCloser(buff) + return ioutil.NopCloser(buff) } var _ Getter = &mockPluginGetter{} diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 deleted file mode 100644 index 7813681f5b4..00000000000 --- a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64 +++ /dev/null @@ -1 +0,0 @@ -5 \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM deleted file mode 100644 index 2ef9d7d4c35..00000000000 --- a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/alazon/packer-plugin-alazon_v1.2.5_x5.0_linux_amd64_SHA256SUM +++ /dev/null @@ -1 +0,0 @@ -ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 deleted file mode 100644 index 7813681f5b4..00000000000 --- a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64 +++ /dev/null @@ -1 +0,0 @@ -5 \ No newline at end of file diff --git a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM b/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM deleted file mode 100644 index 2ef9d7d4c35..00000000000 --- a/packer/plugin-getter/testdata/plugins_3/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64_SHA256SUM +++ /dev/null @@ -1 +0,0 @@ -ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d \ No newline at end of file diff --git a/packer/plugin.go b/packer/plugin.go index 86e02289f5c..1b64482a89b 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 @@ -16,15 +16,11 @@ 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" ) -var defaultChecksummer = plugingetter.Checksummer{ - Type: "sha256", - Hash: sha256.New(), -} - // PluginConfig helps load and use packer plugins type PluginConfig struct { KnownPluginFolders []string @@ -34,6 +30,23 @@ 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 @@ -67,36 +80,192 @@ func (c *PluginConfig) Discover() error { return nil } - if len(c.KnownPluginFolders) == 0 { - //PluginFolders should match the call in github.com/hahicorp/packer/main.go#loadConfig - c.KnownPluginFolders = PluginFolders(".") + // 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 + } } - // 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 { + // 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 { + return err + } + } + + // Next, look in the CWD. + if err := c.discoverExternalComponents("."); err != nil { return err } - // 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-*")) + // 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 = ";" + } + plugPaths := strings.Split(packerPluginPath, sep) + for _, plugPath := range plugPaths { + if err := c.discoverExternalComponents(plugPath); err != nil { + return err + } + } + } + + 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 } - 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) + } + 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) + } + + //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" + } + + pluginPaths, err = c.discoverSingle(filepath.Join(path, "*", "*", "*", fmt.Sprintf("packer-plugin-*%s", binInstallOpts.FilenameSuffix()))) + 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 := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { - return err + + 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 + } + + if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { + return err + } + } + + // 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-*")) + if err != nil { + return err + } + + for pluginName, pluginPath := range pluginPaths { + if err := c.DiscoverMultiPlugin(pluginName, pluginPath); err != nil { + return err } } + return nil } @@ -122,19 +291,11 @@ 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( - "[TRACE] Ignoring plugin match %s, no exe extension", + "[DEBUG] Ignoring plugin match %s, no exe extension", match) 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] @@ -146,12 +307,8 @@ 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("[INFO] Discovered potential plugin: %s = %s", pluginName, match) - pluginPath, err := filepath.Abs(match) - if err != nil { - pluginPath = match - } - res[pluginName] = pluginPath + log.Printf("[DEBUG] Discovered plugin: %s = %s", pluginName, match) + res[pluginName] = match } return res, nil @@ -269,9 +426,9 @@ func (c *PluginConfig) Client(path string, args ...string) *PluginClient { } if strings.Contains(originalPath, PACKERSPACE) { - log.Printf("[INFO] Starting internal plugin %s", args[len(args)-1]) + log.Printf("[TRACE] Starting internal plugin %s", args[len(args)-1]) } else { - log.Printf("[INFO] Starting external plugin %s %s", path, strings.Join(args, " ")) + log.Printf("[TRACE] Starting external plugin %s %s", path, strings.Join(args, " ")) } var config PluginClientConfig config.Cmd = exec.Command(path, args...) @@ -280,57 +437,3 @@ 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{ - defaultChecksummer, - }, - } - - 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_client.go b/packer/plugin_client.go index 01e899e2813..f1d127497be 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 @@ -8,6 +8,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "log" "net" "os" @@ -113,7 +114,7 @@ func NewClient(config *PluginClientConfig) (c *PluginClient) { } if config.Stderr == nil { - config.Stderr = io.Discard + config.Stderr = ioutil.Discard } c = &PluginClient{config: config} diff --git a/packer/plugin_discover_test.go b/packer/plugin_discover_test.go index 6dbe8589b2e..91e8ba6b318 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 @@ -42,230 +42,115 @@ func TestDiscoverReturnsIfMagicCookieSet(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() +func TestEnvVarPackerPluginPath(t *testing.T) { + // Create a temporary directory to store plugins in + dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", + []string{"packer-provisioner-partyparrot"}) if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) + t.Fatalf("Error creating fake custom plugins: %s", err) } - for mockPluginName, plugin := range mockPlugins { - for mockBuilderName := range plugin.Builders { - expectedBuilderName := mockPluginName + "-" + mockBuilderName + defer cleanUpFunc() - 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) - } - } - } -} + // Add temp dir to path. + t.Setenv("PACKER_PLUGIN_PATH", dir) -func TestMultiPlugin_describe_installed(t *testing.T) { - createMockInstalledPlugins(t, mockInstalledPlugins, createMockChecksumFile) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) + config := newPluginConfig() - c := PluginConfig{} - err := c.Discover() + err = config.Discover() if err != nil { - t.Fatalf("error discovering plugins; %s", err.Error()) + t.Fatalf("Should not have errored: %s", err) } - 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) - } - } + if len(config.Provisioners.List()) == 0 { + t.Fatalf("Should have found partyparrot provisioner") + } + if !config.Provisioners.Has("partyparrot") { + t.Fatalf("Should have found partyparrot provisioner.") } } -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) - }, - }, +func TestEnvVarPackerPluginPath_MultiplePaths(t *testing.T) { + // Create a temporary directory to store plugins in + dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", + []string{"packer-provisioner-partyparrot"}) + if err != nil { + t.Fatalf("Error creating fake custom plugins: %s", err) } - 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) + defer cleanUpFunc() - 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) - } - } - } - }) + pathsep := ":" + if runtime.GOOS == "windows" { + pathsep = ";" } -} -func TestMultiPlugin_defaultName(t *testing.T) { - createMockPlugins(t, defaultNameMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) - - c := PluginConfig{} - err := c.Discover() + // Create a second dir to look in that will be empty + decoyDir, err := os.MkdirTemp("", "decoy") if err != nil { - t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + t.Fatalf("Failed to create a temporary test dir.") } + defer os.Remove(decoyDir) - 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) - } - } -} + pluginPath := dir + pathsep + decoyDir -// 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() + // Add temp dir to path. + t.Setenv("PACKER_PLUGIN_PATH", pluginPath) + + config := newPluginConfig() + + err = config.Discover() if err != nil { - t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + t.Fatalf("Should not have errored: %s", err) } - 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) - } + + if len(config.Provisioners.List()) == 0 { + t.Fatalf("Should have found partyparrot provisioner") + } + if !config.Provisioners.Has("partyparrot") { + t.Fatalf("Should have found partyparrot provisioner.") } } -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")) +func TestDiscoverDatasource(t *testing.T) { + // Create a temporary directory to store plugins in + dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", + []string{"packer-datasource-partyparrot"}) if err != nil { - t.Fatal(err.Error()) + t.Fatalf("Error creating fake custom plugins: %s", err) } - // 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) + + defer cleanUpFunc() + + pathsep := ":" + if runtime.GOOS == "windows" { + pathsep = ";" } - c := PluginConfig{} - err = c.Discover() + // Create a second dir to look in that will be empty + decoyDir, err := os.MkdirTemp("", "decoy") if err != nil { - t.Fatalf("error discovering plugins; %s ; mocks are %#v", err.Error(), defaultNameMock) + t.Fatalf("Failed to create a temporary test dir.") } - 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) - } - } -} + defer os.Remove(decoyDir) -func TestMultiPlugin_defaultName_each_plugin_type(t *testing.T) { - createMockPlugins(t, doubleDefaultMock) - pluginDir := os.Getenv("PACKER_PLUGIN_PATH") - defer os.RemoveAll(pluginDir) + pluginPath := dir + pathsep + decoyDir - c := PluginConfig{} - err := c.Discover() + // Add temp dir to path. + t.Setenv("PACKER_PLUGIN_PATH", pluginPath) + + config := newPluginConfig() + + err = config.Discover() if err != nil { - t.Fatal("Should not have error because pluginsdk.DEFAULT_NAME is used twice but only once per plugin type.") + t.Fatalf("Should not have errored: %s", err) + } + + if len(config.DataSources.List()) == 0 { + t.Fatalf("Should have found partyparrot datasource") + } + if !config.DataSources.Has("partyparrot") { + t.Fatalf("Should have found partyparrot datasource.") } } @@ -411,15 +296,6 @@ 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(), @@ -427,20 +303,19 @@ func generateMockChecksumFile(filePath string) (string, error) { f, err := os.Open(filePath) if err != nil { - return "", fmt.Errorf("failed to open fake plugin binary: %v", err) + t.Fatalf("failed to open fake plugin binary: %v", err) } defer f.Close() sum, err := cs.Sum(f) if err != nil { - return "", fmt.Errorf("failed to checksum fake plugin binary: %v", err) + t.Fatalf("failed to 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) + 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) } - return sumfile, nil } func createMockInstalledPlugins(t *testing.T, plugins map[string]pluginsdk.Set, opts ...func(tb testing.TB, filePath string)) { @@ -586,3 +461,180 @@ 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.") + } +} diff --git a/packer/plugin_folders.go b/packer/plugin_folders.go index e1d4dbea4a2..07e74d19121 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 @@ -16,15 +16,10 @@ 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 { - res = append(res, filepath.Dir(path)) + res = append(res, path) } res = append(res, dirs...) @@ -35,5 +30,9 @@ 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 } 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..a50049cf908 100644 --- a/packer/progressbar_test.go +++ b/packer/progressbar_test.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer import ( "bytes" - "io" + "io/ioutil" "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, io.NopCloser(nil)) + tracker := bar.TrackProgress("1,", 1, 42, ioutil.NopCloser(nil)) tracker.Close() - tracker = bar.TrackProgress("2,", 1, 42, io.NopCloser(nil)) + tracker = bar.TrackProgress("2,", 1, 42, ioutil.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, io.NopCloser(nil)) + tracker := bar.TrackProgress("file,", 1, 42, ioutil.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, io.NopCloser(b)) + tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(b)) for i := 0; i < 42; i++ { tracker.Read([]byte("i")) 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..5bf1151529c 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 @@ -40,12 +40,6 @@ 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 @@ -59,7 +53,6 @@ type Handler interface { BuildGetter ConfigFixer ConfigInspector - PluginBinaryDetector } //go:generate enumer -type FixConfigMode diff --git a/packer/telemetry.go b/packer/telemetry.go index c3d0573ef5e..d4e20696649 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 @@ -26,7 +26,7 @@ const ( JSONTemplate PackerTemplateType = "JSON" ) -const TelemetryVersion string = "beta/packer/7" +const TelemetryVersion string = "beta/packer/6" const TelemetryPanicVersion string = "beta/packer_panic/4" var CheckpointReporter *CheckpointTelemetry @@ -37,7 +37,6 @@ type PackerReport struct { Error string `json:"error"` Command string `json:"command"` TemplateType PackerTemplateType `json:"template_type"` - UseBundled bool `json:"use_bundled"` } type CheckpointTelemetry struct { @@ -45,7 +44,6 @@ type CheckpointTelemetry struct { signatureFile string startTime time.Time templateType PackerTemplateType - useBundled bool } func NewCheckpointReporter(disableSignature bool) *CheckpointTelemetry { @@ -130,14 +128,6 @@ func (c *CheckpointTelemetry) SetTemplateType(t PackerTemplateType) { c.templateType = t } -// SetBundledUsage marks the template as using bundled plugins -func (c *CheckpointTelemetry) SetBundledUsage() { - if c == nil { - return - } - c.useBundled = true -} - func (c *CheckpointTelemetry) Finalize(command string, errCode int, err error) error { if c == nil { return nil @@ -155,7 +145,6 @@ 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, "", " ") diff --git a/packer/telemetry_test.go b/packer/telemetry_test.go index 7abc600cda1..4d1dee3e7f5 100644 --- a/packer/telemetry_test.go +++ b/packer/telemetry_test.go @@ -1,10 +1,9 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer import ( - "errors" "testing" "github.com/stretchr/testify/assert" @@ -34,24 +33,3 @@ 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") - } -} diff --git a/packer/testing.go b/packer/testing.go index b0ebc04b95f..0b2449593c2 100644 --- a/packer/testing.go +++ b/packer/testing.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package packer import ( "bytes" - "io" + "io/ioutil" "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: io.Discard, - ErrorWriter: io.Discard, + Writer: ioutil.Discard, + ErrorWriter: ioutil.Discard, } } 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..97ab201f7f8 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 @@ -7,7 +7,7 @@ import ( "bytes" "context" "fmt" - "io" + "io/ioutil" "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, _ := io.ReadAll(f); !bytes.Equal(buf, []byte("d3486ae9136e7856bc42212385ea797094475802\tpackage.txt\n")) { + if buf, _ := ioutil.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/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..f853c85104f 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 @@ -18,7 +18,7 @@ import ( "github.com/biogo/hts/bgzf" "github.com/klauspost/pgzip" - "github.com/pierrec/lz4/v4" + "github.com/pierrec/lz4" "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.Apply(lz4.ChecksumOption(false)) + cw.Header.NoChecksum = true 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 07a74e813d0..9d2a32e57d5 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 @@ -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/v4" + "github.com/pierrec/lz4" "github.com/ulikunitz/xz" ) @@ -333,27 +333,8 @@ 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 { - 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 + if compressionLevel > 0 { + lzwriter.Header.CompressionLevel = compressionLevel } return lzwriter, nil } diff --git a/post-processor/compress/post-processor_test.go b/post-processor/compress/post-processor_test.go index 00b8a1377ca..f91a1178f2f 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 @@ -9,7 +9,7 @@ import ( "compress/gzip" "context" "fmt" - "io" + "io/ioutil" "os" "strings" "testing" @@ -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/v4" + "github.com/pierrec/lz4" ) func TestDetectFilename(t *testing.T) { @@ -84,7 +84,7 @@ func TestCompressOptions(t *testing.T) { filename := "package.gz" archive, _ := os.Open(filename) gzipReader, _ := gzip.NewReader(archive) - data, _ := io.ReadAll(gzipReader) + data, _ := ioutil.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, _ := io.ReadAll(gzipReader) + data, _ := ioutil.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 io.ReadAll(bzipReader) + return ioutil.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 io.ReadAll(ctt) + return ioutil.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 io.ReadAll(tarReader) + return ioutil.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 io.ReadAll(tarReader) + return ioutil.ReadAll(tarReader) }, "gz": func(archive *os.File) ([]byte, error) { gzipReader, _ := gzip.NewReader(archive) - return io.ReadAll(gzipReader) + return ioutil.ReadAll(gzipReader) }, "lz4": func(archive *os.File) ([]byte, error) { lz4Reader := lz4.NewReader(archive) - return io.ReadAll(lz4Reader) + return ioutil.ReadAll(lz4Reader) }, } 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..f911f734b5c 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 @@ -10,6 +10,7 @@ import ( "context" "encoding/json" "fmt" + "io/ioutil" "log" "os" "path/filepath" @@ -142,7 +143,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source // Read the current manifest file from disk contents := []byte{} - if contents, err = os.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) { + if contents, err = ioutil.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) } @@ -166,7 +167,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 = os.WriteFile(p.config.OutputPath, out, 0664); err != nil { + if err = ioutil.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/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..eb8481772d1 100644 --- a/post-processor/shell-local/post-processor_test.go +++ b/post-processor/shell-local/post-processor_test.go @@ -1,9 +1,10 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_local import ( + "io/ioutil" "os" "runtime" "testing" @@ -94,7 +95,7 @@ func TestPostProcessorPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -162,7 +163,7 @@ func TestPostProcessorPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -181,7 +182,7 @@ func TestPostProcessorPrepare_ScriptAndScripts(t *testing.T) { raws := testConfig() // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -207,7 +208,7 @@ func TestPostProcessorPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } 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..fc833fb47bc 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 @@ -67,7 +67,8 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe ui.Say("Pausing at breakpoint provisioner.") } - message := "Press enter to continue." + message := fmt.Sprintf( + "Press enter to continue.") var g errgroup.Group result := make(chan string, 1) 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..e3ecd7294f7 100644 --- a/provisioner/file/provisioner_test.go +++ b/provisioner/file/provisioner_test.go @@ -1,11 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package file import ( "bytes" "context" + "io/ioutil" "os" "path/filepath" "regexp" @@ -61,7 +62,7 @@ func TestProvisionerPrepare_InvalidSource(t *testing.T) { func TestProvisionerPrepare_ValidSource(t *testing.T) { var p Provisioner - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -106,7 +107,7 @@ func TestProvisionerPrepare_EmptyDestination(t *testing.T) { func TestProvisionerProvision_SendsFile(t *testing.T) { var p Provisioner - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -194,7 +195,7 @@ func TestProvisionerProvision_SendsContent(t *testing.T) { func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { var p Provisioner - tf1, err := os.CreateTemp("", "packer") + tf1, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -204,7 +205,7 @@ func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := os.CreateTemp("", "packer") + tf2, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -247,13 +248,13 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { var p Provisioner // Prepare the first directory - td1, err := os.MkdirTemp("", "packerdir") + td1, err := ioutil.TempDir("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td1) - tf1, err := os.CreateTemp(td1, "packer") + tf1, err := ioutil.TempFile(td1, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -263,13 +264,13 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { } // Prepare the second directory - td2, err := os.MkdirTemp("", "packerdir") + td2, err := ioutil.TempDir("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td2) - tf2, err := os.CreateTemp(td2, "packer") + tf2, err := ioutil.TempFile(td2, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -316,7 +317,7 @@ func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { var p Provisioner - tf1, err := os.CreateTemp("", "packer") + tf1, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -326,7 +327,7 @@ func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := os.CreateTemp("", "packer") + tf2, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -387,7 +388,7 @@ func TestProvisionerProvision_DownloadsMultipleFilesToFolder(t *testing.T) { func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { var p Provisioner - tf1, err := os.CreateTemp("", "packer") + tf1, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -397,7 +398,7 @@ func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { t.Fatalf("error writing tempfile: %s", err) } - tf2, err := os.CreateTemp("", "packer") + tf2, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -453,12 +454,12 @@ func TestProvisionDownloadMkdirAll(t *testing.T) { {"path/to/dir"}, {"path/to/dir/"}, } - tmpDir, err := os.MkdirTemp("", "packer-file") + tmpDir, err := ioutil.TempDir("", "packer-file") if err != nil { t.Fatalf("error tempdir: %s", err) } defer os.RemoveAll(tmpDir) - tf, err := os.CreateTemp(tmpDir, "packer") + tf, err := ioutil.TempFile(tmpDir, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } 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..379b14f9b8f 100644 --- a/provisioner/powershell/provisioner_acc_test.go +++ b/provisioner/powershell/provisioner_acc_test.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package powershell_test import ( "fmt" - "io" + "io/ioutil" "os" "os/exec" "path/filepath" @@ -35,7 +35,7 @@ func LoadProvisionerFragment(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := io.ReadAll(fragmentFile) + fragmentString, err := ioutil.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 024b0585fa2..d94a56fa23b 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 @@ -7,6 +7,7 @@ import ( "bytes" "context" "fmt" + "io/ioutil" "os" "regexp" "strings" @@ -34,7 +35,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) { } // File contents should contain 2 lines concatenated by newlines: foo\nbar - readFile, err := os.ReadFile(file) + readFile, err := ioutil.ReadFile(file) expectedContents := "foo\nbar\n" if err != nil { t.Fatalf("Should not be error: %s", err) @@ -186,7 +187,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -213,7 +214,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -233,7 +234,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -260,7 +261,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -511,7 +512,7 @@ func TestProvisionerProvision_Inline(t *testing.T) { } func TestProvisionerProvision_Scripts(t *testing.T) { - tempFile, _ := os.CreateTemp("", "packer") + tempFile, _ := ioutil.TempFile("", "packer") defer os.Remove(tempFile.Name()) defer tempFile.Close() @@ -541,7 +542,7 @@ func TestProvisionerProvision_Scripts(t *testing.T) { } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { - tempFile, _ := os.CreateTemp("", "packer") + tempFile, _ := ioutil.TempFile("", "packer") ui := testUi() defer os.Remove(tempFile.Name()) defer tempFile.Close() @@ -578,7 +579,7 @@ func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { } func TestProvisionerProvision_SkipClean(t *testing.T) { - tempFile, _ := os.CreateTemp("", "packer") + tempFile, _ := ioutil.TempFile("", "packer") defer func() { tempFile.Close() os.Remove(tempFile.Name()) 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..f53990d0d2f 100644 --- a/provisioner/shell-local/provisioner_acc_test.go +++ b/provisioner/shell-local/provisioner_acc_test.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_test import ( "fmt" - "io" + "io/ioutil" "os" "os/exec" "path/filepath" @@ -31,7 +31,7 @@ func loadFile(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := io.ReadAll(fragmentFile) + fragmentString, err := ioutil.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } 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..8ffc58b8d14 100644 --- a/provisioner/shell/provisioner_acc_test.go +++ b/provisioner/shell/provisioner_acc_test.go @@ -1,11 +1,11 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell_test import ( "fmt" - "io" + "io/ioutil" "os" "os/exec" "path/filepath" @@ -31,7 +31,7 @@ func loadFile(templateFragmentPath string) (string, error) { } defer fragmentFile.Close() - fragmentString, err := io.ReadAll(fragmentFile) + fragmentString, err := ioutil.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 40da9b5ea2b..73a4ac248f5 100644 --- a/provisioner/shell/provisioner_test.go +++ b/provisioner/shell/provisioner_test.go @@ -1,9 +1,10 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell import ( + "io/ioutil" "os" "regexp" "strings" @@ -122,7 +123,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -148,7 +149,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -167,7 +168,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -193,7 +194,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } 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..e01af9e7b06 100644 --- a/provisioner/windows-shell/provisioner_test.go +++ b/provisioner/windows-shell/provisioner_test.go @@ -1,11 +1,12 @@ // Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-License-Identifier: MPL-2.0 package shell import ( "bytes" "context" + "io/ioutil" "log" "os" "strings" @@ -36,7 +37,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) { } // File contents should contain 2 lines concatenated by newlines: foo\nbar - readFile, err := os.ReadFile(file) + readFile, err := ioutil.ReadFile(file) if err != nil { t.Fatalf("Should not be error: %s", err) } @@ -101,7 +102,7 @@ func TestProvisionerPrepare_Script(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -128,7 +129,7 @@ func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { } // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -148,7 +149,7 @@ func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { config := testConfig() // Test with both - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -175,7 +176,7 @@ func TestProvisionerPrepare_Scripts(t *testing.T) { } // Test with a good one - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -324,7 +325,7 @@ func TestProvisionerProvision_Inline(t *testing.T) { } func TestProvisionerProvision_Scripts(t *testing.T) { - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } @@ -356,7 +357,7 @@ func TestProvisionerProvision_Scripts(t *testing.T) { } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { - tf, err := os.CreateTemp("", "packer") + tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } 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..e52c063b3fe 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. @@ -12,6 +12,7 @@ import ( "go/ast" "go/parser" "go/token" + "io/ioutil" "log" "os" "path/filepath" @@ -141,7 +142,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 := os.ReadDir(path) + items, err := ioutil.ReadDir(path) if err != nil { return names, err } 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 a10b9972b6a..3f776034b1d 100755 --- a/scripts/prepare_changelog.sh +++ b/scripts/prepare_changelog.sh @@ -1,56 +1,81 @@ #!/bin/zsh # Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: BUSL-1.1 +# SPDX-License-Identifier: MPL-2.0 LAST_RELEASE=$1 +DO_PR_CHECK=1 set -o pipefail +is_doc_or_tech_debt_pr(){ + if ! (($+commands[jq])); then + DO_PR_CHECK=0 + echo "jq not found" + return 1 + fi + out=$(python3 -m json.tool < pull.json \ + | jq '[.labels[].name == "docs" or .labels[].name == "tech-debt" or .labels[].name == "website"] | any') + grep -q true <<< $out + return $? +} + if [ -z $LAST_RELEASE ]; then echo "you need to give the previous release version. prepare_changelog.sh v" exit 1 fi -if [ -z "$(which jq)" ]; then - echo "jq command not found" - return 1 -fi - -if [ -z "$(which jq)" ]; then - echo "gh command not found" - return 1 -fi - get_prs(){ - release_time="$(gh release view --json "createdAt" --jq '.createdAt' ${LAST_RELEASE})" - gh pr list -s merged -S "merged:>=$release_time -label:documentation -label:automated -label:tech-debt -label:website -label:legal -label:docs -author:hc-github-team-packer" --json "number" --jq '.[]|.number' \ - | while read line + # git log v0.10.2...c3861d167533fb797b0fae0c380806625712e5f7 | + git log HEAD...${LAST_RELEASE} --first-parent --oneline --grep="Merge pull request #[0-9]\+" --grep="(#[0-9]\+)$" | + grep -o "#\([0-9]\+\)" | awk -F\# '{print $2}' | while read line do - if grep -q "GH-${line}" CHANGELOG.md; then - continue + grep -q "GH-${line}" CHANGELOG.md + if [ $? -ne 0 ]; then + echo $line fi - echo $line done | while read PR_NUM do - out=$(gh pr view ${PR_NUM} --json "title,labels,url" > pull.json) - if [ "$?" -ne 0 ]; then + if [[ -z "${GITHUB_TOKEN}" ]] || [[ -z "${GITHUB_USERNAME}" ]] ; then + out=$(curl -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" -o pull.json) + else + # authenticated call + out=$(curl -u ${GITHUB_USERNAME}:${GITHUB_TOKEN} -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" -o pull.json) + fi + exy="$?" + if [ $exy -ne 0 ]; then echo "bad response from github: manually check PR ${PR_NUM}" continue fi - echo "$(jq -r '.title' < pull.json) - [GH-${PR_NUM}](https://github.com/hashicorp/packer/pull/${PR_NUM})" - rm -f pull.json + if (($DO_PR_CHECK)) && is_doc_or_tech_debt_pr; then + echo "Skipping PR ${PR_NUM}: labeled as tech debt, docs or website. (waiting a second so we don't get rate-limited...)" + continue + fi + echo "$(python3 -m json.tool < pull.json | jq -r '.title') - [GH-${PR_NUM}](https://github.com/hashicorp/packer/pull/${PR_NUM})" done } +#is_doc_or_tech_debt_pr 52061111 +# is_doc_or_tech_debt_pr 5206 # non-doc pr +#is_doc_or_tech_debt_pr 5434 # doc pr +#echo $? +#exit + +# prpid=$! +# trap 'kill -9 ${prpid}; exit' INT TERM + get_prs | while read line; do echo $line if [[ "$line" =~ "bad" ]]; then exit 1 + elif [[ "$line" =~ "Skipping" ]]; then + sleep 1 # GH will rate limit us if we have several in a row + continue fi - echo "Press enter to continue with next entry." + rm -f pull.json vared -ch ok done + #TODO: just generate it automatically using PR titles and tags 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 new file mode 100755 index 00000000000..3ca2885f178 --- /dev/null +++ b/scripts/upgrade_plugins.sh @@ -0,0 +1,68 @@ +#!/bin/zsh +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + + +## This script is to be run before a Packer release in order to update +## all vendored plugins to the latest available release. +## The SDK is included in the plugin list and will be upgraded as well if a +## newest version is available. +## This script should be run in packer's root. + +declare -a plugins=( + "hashicorp/packer-plugin-alicloud" + "hashicorp/packer-plugin-amazon" + "hashicorp/packer-plugin-ansible" + "hashicorp/packer-plugin-azure" + "hashicorp/packer-plugin-chef" + "hashicorp/packer-plugin-cloudstack" + "hashicorp/packer-plugin-converge" + "digitalocean/packer-plugin-digitalocean" + "hashicorp/packer-plugin-docker" + "hashicorp/packer-plugin-googlecompute" + "hashicorp/packer-plugin-hcloud" + "hashicorp/packer-plugin-hyperone" + "hashicorp/packer-plugin-hyperv" + "hashicorp/packer-plugin-jdcloud" + "hashicorp/packer-plugin-linode" + "hashicorp/packer-plugin-lxc" + "hashicorp/packer-plugin-lxd" + "hashicorp/packer-plugin-ncloud" + "hashicorp/packer-plugin-openstack" + "hashicorp/packer-plugin-oneandone" + "hashicorp/packer-plugin-parallels" + "hashicorp/packer-plugin-profitbricks" + "hashicorp/packer-plugin-proxmox" + "hashicorp/packer-plugin-puppet" + "hashicorp/packer-plugin-qemu" + "hashicorp/packer-plugin-sdk" + "hashicorp/packer-plugin-tencentcloud" + "hashicorp/packer-plugin-triton" + "hashicorp/packer-plugin-ucloud" + "hashicorp/packer-plugin-vagrant" + "hashicorp/packer-plugin-virtualbox" + "hashicorp/packer-plugin-vmware" + "hashicorp/packer-plugin-vsphere" + "hashicorp/packer-plugin-yandex" +) + +## now loop through the above plugin array +## update the plugins and the SDK to the latest available version +for i in "${plugins[@]}" +do + happy=false + while ! $happy + do + echo "upgrading $i" + output=$(go get -d github.com/$i) + happy=true + if [[ $output == *"443: Connection refused"* ]]; then + echo "Try again after 5 seconds" + sleep 5 + happy=false + fi + done + sleep 1 +done + +go mod tidy -compat=1.18 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 169f19b4901..6f2d3653d5a 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -1.11.0 \ No newline at end of file +1.9.2 \ No newline at end of file diff --git a/version/version.go b/version/version.go index a7eec6fd4bc..c0817d4b4b2 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.11.0" + Version = "1.9.2" // 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..52b72eb8151 100644 --- a/website/content/docs/commands/init.mdx +++ b/website/content/docs/commands/init.mdx @@ -19,26 +19,6 @@ 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. @@ -70,7 +50,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 @@ -87,6 +67,18 @@ 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 diff --git a/website/content/docs/community-tools.mdx b/website/content/docs/community-tools.mdx index 3a222f17a75..61feb217ae9 100644 --- a/website/content/docs/community-tools.mdx +++ b/website/content/docs/community-tools.mdx @@ -19,7 +19,7 @@ vendors. These plugins are not officially tested nor officially maintained by HashiCorp, and are listed here in order to help users find them easily. To learn more about how to use community plugins, or how to build your own, -check out the docs on [extending Packer](https://developer.hashicorp.com/packer/docs/plugins/install-plugins) +check out the docs on [extending Packer](/packer/docs/plugins/install-plugins) If you have built a plugin and would like to add it to this community list, please make a pull request so that we can document your 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/docs/plugins/install-plugins.mdx b/website/content/docs/plugins/install-plugins.mdx index b2d97975216..1c2b602823f 100644 --- a/website/content/docs/plugins/install-plugins.mdx +++ b/website/content/docs/plugins/install-plugins.mdx @@ -227,15 +227,5 @@ If you have a `required_plugins` for the plugin you're manually installing, make it respects the constraints described in the [Plugin loading workflow](#plugin-loading-workflow) section, otherwise Packer will not be able to load it. -Starting with v1.10.0 of Packer, you can also use `packer plugins install` with the -`--path` flag to install a plugin from a binary, following the layout that is required to -work with `required_plugins` block. - -```shell -packer plugins install --path github.com/hashicorp/vagrant -``` - --> packer plugins install --path only works with release versions of plugins. - 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 55458aed469..09bd084d46a 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -32,80 +32,17 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", @@ -155,20 +92,28 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", + "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", "dev": true, "dependencies": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@babel/helper-compilation-targets": { "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", @@ -197,34 +142,37 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", "dev": true, "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -283,30 +231,21 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true, "engines": { "node": ">=6.9.0" @@ -336,13 +275,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, "engines": { @@ -387,13 +326,13 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, "engines": { "node": ">=4" @@ -412,9 +351,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", + "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -635,33 +574,33 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", + "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.9", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.9", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -679,13 +618,12 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1545,52 +1483,29 @@ "node": ">= 10.14.2" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", + "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", + "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.8.tgz", + "integrity": "sha512-zdpaWDz5IEyHlu1EO+B+qRHmJkSxMVV6SXngDry9n1ZqslLXFH9Dw6lRqDidm/sOJAWdRltJsmZ1SK28/uZKsw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@mdx-js/util": { @@ -13811,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" @@ -14066,65 +13981,12 @@ } }, "@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "requires": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "@babel/highlight": "^7.16.7" } }, "@babel/compat-data": { @@ -14165,15 +14027,22 @@ } }, "@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.9.tgz", + "integrity": "sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ==", "dev": true, "requires": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } } }, "@babel/helper-compilation-targets": { @@ -14197,28 +14066,31 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "dev": true + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } }, "@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", "dev": true, "requires": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" } }, "@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-imports": { @@ -14262,24 +14134,18 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.16.7" } }, - "@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", - "dev": true - }, "@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true }, "@babel/helper-validator-option": { @@ -14300,13 +14166,13 @@ } }, "@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, "dependencies": { @@ -14342,13 +14208,13 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { @@ -14363,9 +14229,9 @@ } }, "@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.9.tgz", + "integrity": "sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==", "dev": true }, "@babel/plugin-proposal-object-rest-spread": { @@ -14526,30 +14392,30 @@ } }, "@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.9.tgz", + "integrity": "sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.9", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.9", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -14563,13 +14429,12 @@ } }, "@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" } }, @@ -15236,43 +15101,26 @@ "chalk": "^4.0.0" } }, - "@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, "@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", + "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", + "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.8.tgz", + "integrity": "sha512-zdpaWDz5IEyHlu1EO+B+qRHmJkSxMVV6SXngDry9n1ZqslLXFH9Dw6lRqDidm/sOJAWdRltJsmZ1SK28/uZKsw==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "@mdx-js/util": { @@ -24541,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": {