mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 09:40:17 -04:00
This change adds a simple hostname validation check to validate that a plugins source address is github.com before continuing with the Get call. An issue was encountered when using a hostname different from github.com, where the getter would continue to pull a plugin from GitHub even if the hostname was something like "example.com". See log details below. Before change ``` 2021/02/16 12:49:41 [TRACE] fetching checksums file for the "0.0.2" version of the example.com/hashicorp/docker plugin in "/home/wilken/.packer.d/plugins/example.com/hashicorp/docker"... 2021/02/16 12:49:41 [DEBUG] github-getter: getting "https://github.com/hashicorp/packer-plugin-docker/releases/download/v0.0.2/packer-plugin-docker_v0.0.2_SHA256SUMS" 2021/02/16 12:49:42 [TRACE] Ignoring remote binary packer-plugin-docker_v0.0.2_x5.0_linux_arm64.zip, wrong system, expected 2021/02/16 12:49:42 [TRACE] About to get: packer-plugin-docker_v0.0.2_x5.0_linux_amd64.zip 2021/02/16 12:49:42 [DEBUG] github-getter: getting "https://github.com/hashicorp/packer-plugin-docker/releases/download/v0.0.2/packer-plugin-docker_v0.0.2_x5.0_linux_amd64.zip" ``` After change ``` 2021/02/16 13:36:32 [TRACE] for plugin example.com/hashicorp/docker found 0 matching installation(s) 2021/02/16 13:36:32 [TRACE] getting available versions for the the example.com/hashicorp/docker plugin 2021/02/16 13:36:32 [TRACE] &{%!q(*github.Client=<nil>) "packer-getter-github-1.7.0-dev"} getter could not get release: example.com/hashicorp/docker doesn't appear to be a valid github.com source address; check source and try again. 2021/02/16 13:36:32 [DEBUG] will try to install: [] 2021/02/16 13:36:32 [INFO] (telemetry) Finalizing. no release version found for the example.com/hashicorp/docker plugin matching the constraint(s): ">=v0.0.2" 2021/02/16 13:36:32 waiting for all plugin processes to complete... ``` |
||
|---|---|---|
| .. | ||
| plugin-getter | ||
| test-fixtures | ||
| build.go | ||
| build_test.go | ||
| builder_test.go | ||
| client_test.go | ||
| cmd_builder.go | ||
| cmd_builder_test.go | ||
| cmd_datasource.go | ||
| cmd_datasource_test.go | ||
| cmd_hook.go | ||
| cmd_hook_test.go | ||
| cmd_post_processor.go | ||
| cmd_post_processor_test.go | ||
| cmd_provisioner.go | ||
| cmd_provisioner_test.go | ||
| core.go | ||
| core_test.go | ||
| fixconfigmode_enumer.go | ||
| maps.go | ||
| packer_test.go | ||
| plugin.go | ||
| plugin_client.go | ||
| plugin_discover_test.go | ||
| plugin_folders.go | ||
| plugin_test.go | ||
| post_processor_mock.go | ||
| post_processor_mock.hcl2spec.go | ||
| progressbar.go | ||
| progressbar_solaris.go | ||
| progressbar_test.go | ||
| provisioner.go | ||
| provisioner_test.go | ||
| provisioner_timeout.go | ||
| run_interfaces.go | ||
| telemetry.go | ||
| telemetry_test.go | ||
| testing.go | ||
| ui.go | ||
| ui_test.go | ||