Skip to content

Commit

Permalink
Annotate task bundles with version
Browse files Browse the repository at this point in the history
STONEBLD-2821

Signed-off-by: Chenxiong Qi <[email protected]>
  • Loading branch information
tkdchen committed Oct 15, 2024
1 parent 82dc8d4 commit 42e1207
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hack/build-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ do
ANNOTATIONS+=("org.opencontainers.image.source=${VCS_URL}")
ANNOTATIONS+=("org.opencontainers.image.revision=${VCS_REF}")
ANNOTATIONS+=("org.opencontainers.image.url=${VCS_URL}/tree/${VCS_REF}/${task_dir}")
# Ensure an empty string is set rather than string "null" if the version label is not present
concrete_task_version=$(yq '.metadata.labels."app.kubernetes.io/version"' "$prepared_task_file" | sed '/null/d')
ANNOTATIONS+=("org.opencontainers.image.version=${concrete_task_version}")
# yq will return null if the element is missing.
if [[ "${task_description}" != "null" ]]; then
ANNOTATIONS+=("org.opencontainers.image.description=${task_description}")
Expand Down

1 comment on commit 42e1207

@tkdchen
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/retest

Please sign in to comment.