Skip to content

Commit 34bd11e

Browse files
committed
Fix base AMI hash calculation mismatch
Base AMI lookup failed because main packer hash didn't include variant, causing hash mismatch between building and looking up base images. Fixes "No golden base AMI found" errors. Base AMI files can be properly located in S3.
1 parent 46ac6fa commit 34bd11e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.buildkite/steps/packer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ packer_files_sha=$(find Makefile "packer/${os}" plugins/ -type f -print0 | xargs
2222
internal_files_sha=$(find go.mod go.sum internal/ -type f -print0 | xargs -0 sha256sum | awk '{print $1}' | sort | sha256sum | awk '{print $1}')
2323
stable_agent_sha=$(curl -Lfs "https://download.buildkite.com/agent/stable/latest/${agent_binary}.sha256")
2424
unstable_agent_sha=$(curl -Lfs "https://download.buildkite.com/agent/unstable/latest/${agent_binary}.sha256")
25-
packer_hash=$(echo "$packer_files_sha" "$internal_files_sha" "$arch" "$stable_agent_sha" "$unstable_agent_sha" | sha256sum | awk '{print $1}')
25+
packer_hash=$(echo "$packer_files_sha" "$internal_files_sha" "$arch" "$stable_agent_sha" "$unstable_agent_sha" "$variant" | sha256sum | awk '{print $1}')
2626

2727
# Include variant in the hash so base and full images don’t clash
2828
echo "Packer image hash for ${os}/${arch} (${variant}) is ${packer_hash}"

0 commit comments

Comments
 (0)