From 0668f2c0edeb2d29ba96d65190c8ed81c6187e1c Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 22 Sep 2026 19:44:02 +0000 Subject: [PATCH] fix(buildah): define IMAGE shell variable from params to fix multi-arch builds Line 125 used ${IMAGE%:*} to extract the image name without the tag, but ${IMAGE} was never defined in the script - the task receives params: IMAGE but the script referenced ${IMAGE} (undefined/empty) instead of $(params.IMAGE). This caused per-arch image names to be ":amd64" and ":arm64" (invalid references), which failed when buildah tried to create manifests. Fix: resolve IMAGE=$(params.IMAGE) at the top of the script so ${IMAGE%:*} works correctly. This is a single-source fix that covers all downstream ${IMAGE} usages (lines 137, 141, 153, 154, 180) which rely on the variable being defined. --- tekton/tasks/buildah/0.8.0/buildah.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tekton/tasks/buildah/0.8.0/buildah.yaml b/tekton/tasks/buildah/0.8.0/buildah.yaml index 03cb78cf3..7bc201c7a 100644 --- a/tekton/tasks/buildah/0.8.0/buildah.yaml +++ b/tekton/tasks/buildah/0.8.0/buildah.yaml @@ -106,6 +106,10 @@ spec: [ "$(workspaces.sslcertdir.bound)" = "true" ] && CERT_DIR_FLAG="--cert-dir=$(workspaces.sslcertdir.path)" [ "$(workspaces.dockerconfig.bound)" = "true" ] && DOCKER_CONFIG="$(workspaces.dockerconfig.path)" && export DOCKER_CONFIG + # Resolve the IMAGE param into a shell variable so string operations + # like ${IMAGE%:*} work correctly. + IMAGE="$(params.IMAGE)" + # Detect if multi-arch mode is enabled (IMAGE_REPOSITORIES is non-empty) MULTI_ARCH=false if [ -n "$(params.IMAGE_REPOSITORIES)" ]; then