Skip to content

Commit 26ea420

Browse files
committed
Image Promoter: Cleans manifest list
The manifest list is stateful, which means that the same list will get amended with each successive image published. That's unintended, and can lead to the wrong image being pulled from the manifest list. Resets the manifest list before amending new images into it.
1 parent 52d7614 commit 26ea420

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/images/image-util.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ push() {
133133

134134
# The manifest command is still experimental as of Docker 18.09.2
135135
export DOCKER_CLI_EXPERIMENTAL="enabled"
136+
# reset manifest list; needed in case multiple images are being built / pushed.
137+
manifest=()
136138
# Make archs list into image manifest. Eg: 'amd64 ppc64le' to '${REGISTRY}/${image}-amd64:${TAG} ${REGISTRY}/${image}-ppc64le:${TAG}'
137139
while IFS='' read -r line; do manifest+=("$line"); done < <(echo "$archs" | ${SED} -e "s~[^ ]*~$REGISTRY\/$image\-&:$TAG~g")
138140
docker manifest create --amend "${REGISTRY}/${image}:${TAG}" "${manifest[@]}"

0 commit comments

Comments
 (0)