Skip to content

fix: handle empty PLATFORM_ARGS array under bash set -u#35

Merged
ptone merged 1 commit intoGoogleCloudPlatform:mainfrom
fijimunkii:fix/build-images-empty-platform-array
Apr 10, 2026
Merged

fix: handle empty PLATFORM_ARGS array under bash set -u#35
ptone merged 1 commit intoGoogleCloudPlatform:mainfrom
fijimunkii:fix/build-images-empty-platform-array

Conversation

@fijimunkii
Copy link
Copy Markdown
Contributor

Summary

  • build-images.sh uses set -euo pipefail, which causes ${PLATFORM_ARGS[@]} to fail with "unbound variable" when no --platform flag is passed and the array is empty
  • Fixes all three docker buildx build call sites using the ${array[@]+"${array[@]}"} idiom, which expands only when the array is non-empty

Test plan

  • Verified build-images.sh --registry local/test --target core-base now runs without error (previously failed immediately with unbound variable)
  • --platform flag still works correctly when provided

${array[@]} with set -euo pipefail fails when the array is empty on
some bash versions. Use the ${array[@}+"${array[@]}"} idiom to expand
only when the array is non-empty.
@ptone ptone merged commit 69dda7e into GoogleCloudPlatform:main Apr 10, 2026
1 check passed
scion-gteam Bot pushed a commit to ptone/scion that referenced this pull request Apr 12, 2026
…latform#35)

${array[@]} with set -euo pipefail fails when the array is empty on
some bash versions. Use the ${array[@}+"${array[@]}"} idiom to expand
only when the array is non-empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants