Skip to content

cloudbuild: limit image release tags to semver only #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

BlaineEXE
Copy link
Contributor

When doing cloudbuilds for tagged releases, limit images to only a single tag that represents the semver tag.

The registry.k8s.io tooling uses scripts to coordinate which images and tags are promoted from staging to release. The script don't handle image digests with multiple tags, and COSI can assume less release breakage by not relying on more advanced handling.

When the cloudbuild script detects a release is happening, it will now apply only the semver tag to the image.

When doing cloudbuilds for tagged releases, limit images to only a
single tag that represents the semver tag.

The registry.k8s.io tooling uses scripts to coordinate which images and
tags are promoted from staging to release. The script don't handle image
digests with multiple tags, and COSI can assume less release breakage by
not relying on more advanced handling.

When the cloudbuild script detects a release is happening, it will now
apply only the semver tag to the image.

Signed-off-by: Blaine Gardner <[email protected]>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BlaineEXE

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 7, 2025
@BlaineEXE
Copy link
Contributor Author

For example, this is what the generate.sh script generates for the COSI controller image today. It is working, but the tag formatting including a semicolon (;) will likely not work.

gcloud container images list-tags gcr.io/k8s-staging-sig-storage/objectstorage-controller '--format=get(digest, tags)' --sort-by=tags '--filter=tags~^v\d+\.\d+\.\d+$' 2>/dev/null | sed -e 's/\([^ ]*\)\t\(.*\)/    "\1": [ "\2" ]/' 
    "sha256:7cc744d49fb9174abb8bc871dce59759dc71b3c63f98c460b707ec120f3d665e": [ "v0.2.0;v20250206-v0.2.0" ]

We want the image to come back with only a single tag -- the semver tag -- like all the rest of the sig-storage images, like this

gcloud container images list-tags gcr.io/k8s-staging-sig-storage/objectstorage-controller '--format=get(digest, tags)' --sort-by=tags '--filter=tags~^v\d+\.\d+\.\d+$' 2>/dev/null | sed -e 's/\([^ ]*\)\t\(.*\)/    "\1": [ "\2" ]/' 
    "sha256:7cc744d49fb9174abb8bc871dce59759dc71b3c63f98c460b707ec120f3d665e": [ "v0.2.0" ]

@xing-yang
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 8, 2025
@k8s-ci-robot k8s-ci-robot merged commit 4347978 into kubernetes-sigs:main Feb 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants