Skip to content

buildah: add feature to allow pushing additional tags#1388

Open
johanneskastl wants to merge 3 commits into
tektoncd:mainfrom
johanneskastl:20260713_additional_tags_buildah_task
Open

buildah: add feature to allow pushing additional tags#1388
johanneskastl wants to merge 3 commits into
tektoncd:mainfrom
johanneskastl:20260713_additional_tags_buildah_task

Conversation

@johanneskastl

Copy link
Copy Markdown

Changes

buildah task: add feature to allow pushing additional tags

This feature allows specifying additional tags like the commit hash or the date or similar, that will be used in addition to "latest".

Please note, those tags need to be strings, not commands like $(date +%Y%m%d).

Discussion see #1373

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Follows the [authoring recommendations][authoring]
  • Includes [docs][docs] (if user facing)
  • Includes [tests][tests] (for new tasks or changed functionality)
    • See the [end-to-end testing documentation][e2e] for guidance and CI details.
  • Meets the [Tekton contributor standards][contributor] (including functionality, content, code)
  • Commit messages follow [commit message best practices][commit]
  • Has a kind label. You can add one by adding a comment on this PR that
    contains /kind <type>. Valid types are bug, cleanup, design, documentation,
    feature, flake, misc, question, tep

…umber

Signed-off-by: Johannes Kastl <git@johannes-kastl.de>
Signed-off-by: Johannes Kastl <git@johannes-kastl.de>
…al tags

Signed-off-by: Johannes Kastl <git@johannes-kastl.de>
@tekton-robot
tekton-robot requested review from chmouel and imjasonh July 13, 2026 11:08
@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign chmouel after the PR has been reviewed.
You can assign the PR to them by writing /assign @chmouel in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 13, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 13, 2026
@johanneskastl

Copy link
Copy Markdown
Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 13, 2026
@chmouel
chmouel requested a review from Copilot July 16, 2026 09:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new task/buildah version (0.10) adding support for pushing the same built image under additional tags (e.g., commit SHA/date-derived tags), alongside existing push behavior, and includes accompanying samples and e2e test scaffolding.

Changes:

  • Add ADDITIONAL_TAGS parameter and implement pushing those additional tags.
  • Add versioned documentation and sample PipelineRuns (dockerconfig + OpenShift internal registry).
  • Add e2e test manifests and internal registry setup for the new version.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
task/buildah/0.10/buildah.yaml Adds ADDITIONAL_TAGS param and push logic for extra tags.
task/buildah/0.10/README.md Documents the 0.10 task version and parameters including ADDITIONAL_TAGS.
task/buildah/0.10/samples/dockerconfig.yaml Example PipelineRun showing docker config workspace usage.
task/buildah/0.10/samples/openshift-internal-registry.yaml Example PipelineRun for OpenShift internal registry + custom CA.
task/buildah/0.10/tests/run.yaml Defines e2e PipelineRuns for push and skip-push scenarios.
task/buildah/0.10/tests/pre-apply-task-hook.sh Test hook to add secure registry sidecar and git-clone task.
task/buildah/0.10/tests/internal-registry/internal-registry.yaml Deploys an internal TLS registry for e2e tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +127 to +135
# push additional tags, if PARAMS_ADDITIONAL_TAGS is not empty
# shellcheck disable=SC2046,SC2086
if [ -n "${PARAMS_ADDITIONAL_TAGS}" ]; then
for tag in ${PARAMS_ADDITIONAL_TAGS};do
buildah ${CERT_DIR_FLAG} "--storage-driver=${PARAM_STORAGE_DRIVER}" push \
"--tls-verify=${PARAM_TLSVERIFY}" --digestfile /tmp/image-digest ${PARAM_PUSH_EXTRA_ARGS} \
"${PARAM_IMAGE}" "docker://${PARAM_IMAGE}":${tag}
done
fi
Comment on lines +108 to +112
script: |
BUILD_ARGS=()
for buildarg in "$@"
do
BUILD_ARGS+=("--build-arg=$buildarg")
Comment on lines +56 to +60
- name: ADDITIONAL_TAGS
type: string
default: ""
description: |
Additional tags for pushing the image.
Comment on lines +50 to +54
- name: evaluate
image: alpine
script: |
#!/usr/bin/env sh
[[ "$(params.ORIGINAL_IMAGE)" = "$(params.OUTPUT_IMAGE)" ]] && exit 0 || exit 1
Comment on lines +26 to +38
- name: buildah
taskRef:
name: buildah
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: shared-workspace
- name: sslcertdir
workspace: sslcertdir
params:
- name: IMAGE
value: registry:5000/nocode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants