fix(buildah): define IMAGE shell variable from params to fix multi-arch builds - #738
Closed
ArthurVardevanyan wants to merge 1 commit into
Closed
ArthurVardevanyan wants to merge 1 commit into
ArthurVardevanyan wants to merge 1 commit into
Conversation
…ch 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.
Contributor
GitOps CI ResultsLast Updated: 2026-09-22T19:44:51Z ✅ Expand: PR Checks✅ PR TitlePassed. ✅ Signed CommitsPassed. ✅ PR ChecklistPassed. ✅ Expand: Linting✅ MarkdownlintNo markdown files changed. ✅ PrettierPassed. ✅ ShellcheckPassed. ✅ golangci-lintNo Go files changed. ✅ KubeconformPassed. ✅ Expand: Static Checks✅ Large FilePassed. ✅ YAML SyntaxPassed. ✅ Config Sort OrderPassed. ✅ Starting CSVPassed. ✅ Scaffold TableDisabled. ✅ Expand: Kustomize Build✅ Overlay Build0 overlay(s) built successfully. ✅ HooksNo hooks defined. ✅ Kustomize FixAll kustomization.yaml files are up to date. ✅ Ghost PatchesNone detected. ✅ Expand: Scaffold Validation✅ Scaffold DriftNo drift detected. ✅ Scaffold ExecAll scaffold runs succeeded. ✅ Disabled OverlaysNo modified overlay is disabled. ✅ Pre-Existing Scaffold DriftNone detected. ✅ Cluster CoverageAll clusters accounted for. ✅ Expand: Scaffold Drift ProtectionAll modified overlays with a scaffold template have drift protection enabled. ✅ Expand: Resource ComplianceNo compliance findings. ✅ Expand: CI NotesPipeline completed.
k8s-gitops-ci pipeline --url="https://github.com/ArthurVardevanyan/HomeLab" --pr=738 --assume-openshift |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
⚙️ Agent run details
|
PR Code Suggestions ✨No code suggestions found for the PR. ⚙️ Agent run details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Fixes multi-arch build failures caused by undefined
\${IMAGE}variable in the buildah task script.Problem
Line 125 used
\${IMAGE%:*}to extract the image name without the tag, but\${IMAGE}was never defined in the script. The task receivesparams: IMAGE, but the script referenced\${IMAGE}(undefined/empty) instead of\$(params.IMAGE).This caused per-arch image names to be
:amd64and:arm64(invalid references), which failed when buildah tried to create manifests.Root cause in k8s-gitops-ci
This bug was masked in k8s-gitops-ci because the top-level params never set
IMAGE_TAGfor PR events, soIMAGE_TAGdefaulted to"". This resulted inIMAGEbeingregistry.arthurvardevanyan.com/homelab/k8s-gitops-ci:(with an empty tag), which exposed the bug when the buildah task tried to extract the image name.Fix
Added
IMAGE="$(params.IMAGE)"at the top of the script to resolve the IMAGE param into a shell variable. 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.Impact
tag amd64:-amd64: invalid reference formaterrors in multi-arch builds\${IMAGE})PR Type
Bug fix
Description
Define
IMAGEshell variable from task parametersFix invalid image reference errors in multi-arch builds
Resolve undefined variable causing buildah manifest failures
Diagram Walkthrough
File Walkthrough
buildah.yaml
Define IMAGE shell variable from task parameterstekton/tasks/buildah/0.8.0/buildah.yaml
IMAGE="$(params.IMAGE)"to resolve task parameter⚙️ Agent run details