From 26ea420c0e694b1f5906af90a6995ace213404cc Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Fri, 10 Jan 2020 00:30:06 -0800 Subject: [PATCH] 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. --- test/images/image-util.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/images/image-util.sh b/test/images/image-util.sh index e08f47b8a57..99e91f4d803 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -133,6 +133,8 @@ push() { # The manifest command is still experimental as of Docker 18.09.2 export DOCKER_CLI_EXPERIMENTAL="enabled" + # reset manifest list; needed in case multiple images are being built / pushed. + manifest=() # Make archs list into image manifest. Eg: 'amd64 ppc64le' to '${REGISTRY}/${image}-amd64:${TAG} ${REGISTRY}/${image}-ppc64le:${TAG}' while IFS='' read -r line; do manifest+=("$line"); done < <(echo "$archs" | ${SED} -e "s~[^ ]*~$REGISTRY\/$image\-&:$TAG~g") docker manifest create --amend "${REGISTRY}/${image}:${TAG}" "${manifest[@]}"