From 640d22b2099fe3dde37d24981271e3ba5df03c5c Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Mon, 25 Mar 2024 17:25:36 -0400 Subject: [PATCH] packer: fix version string variable name typo When introduced back in January, the version variable extracted from the binary name had a typo in its name, and was named `protocolVerionStr' instead of `protocolVersionStr'. This commit was already merged into main, so it's too late to fix at introduction site, but we can fix it today as a separate commit ontop the stack. --- packer/plugin-getter/plugins.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packer/plugin-getter/plugins.go b/packer/plugin-getter/plugins.go index 7829a6d453e..b86a75432ed 100644 --- a/packer/plugin-getter/plugins.go +++ b/packer/plugin-getter/plugins.go @@ -179,7 +179,7 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL // versionsStr now looks like v1.2.3_x5.1 or amazon_v1.2.3_x5.1 parts := strings.SplitN(versionsStr, "_", 2) - pluginVersionStr, protocolVerionStr := parts[0], parts[1] + pluginVersionStr, protocolVersionStr := parts[0], parts[1] ver, err := version.NewVersion(pluginVersionStr) if err != nil { // could not be parsed, ignoring the file @@ -220,8 +220,8 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL } // Check the API version matches between path and describe - if describeInfo.APIVersion != protocolVerionStr { - log.Printf("plugin %q reported API version %q while its name implies version %q, ignoring", path, describeInfo.APIVersion, protocolVerionStr) + if describeInfo.APIVersion != protocolVersionStr { + log.Printf("plugin %q reported API version %q while its name implies version %q, ignoring", path, describeInfo.APIVersion, protocolVersionStr) continue } @@ -236,9 +236,9 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL continue } - if err := opts.CheckProtocolVersion(protocolVerionStr); err != nil { + if err := opts.CheckProtocolVersion(protocolVersionStr); err != nil { log.Printf("[NOTICE] binary %s requires protocol version %s that is incompatible "+ - "with this version of Packer. %s", path, protocolVerionStr, err) + "with this version of Packer. %s", path, protocolVersionStr, err) continue }