Skip to content

Commit

Permalink
packer: fix version string variable name typo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lbajolet-hashicorp committed Mar 26, 2024
1 parent 0e6ee70 commit 132e3d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packer/plugin-getter/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit 132e3d2

Please sign in to comment.