You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fafa12f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(chart): make the derived version label total over every OCI tag
Review finding on PR #7876: `image.tag` is an unconstrained string, but
`buzz.imageVersionLabel` only stripped the digest prefix, truncated to 63, and
trimmed at most one trailing `-`, `.`, and `_`. That is not a mapping onto the
Kubernetes label grammar, and three chart-valid inputs produced a CronJob the
API server rejects or mis-attributes. Reproduced at 5105892 by rendering the
chart:
- `image.tag=_foo` -> label `_foo`; a label must start alphanumeric.
- a 67-byte tag ending `-_.` -> label `aaa…-`; the one-pass trim order
(`-`, then `.`, then `_`) removes the `.` and the `_` and leaves the `-`.
- two 67-byte tags sharing their first 63 bytes -> one identical label, so
two builds report the same telemetry version.
The image reference and `BUZZ_STORAGE_SNAPSHOT_CODE_SHA` were correct in all
three; only the label was wrong.
The helper is now total by construction, in three cases: a `sha256:<64 hex>`
digest keeps 63 hex characters (unchanged, and two digests sharing a 252-bit
prefix do not occur); a revision that is already a valid label value is emitted
byte for byte, so `1.2.3-rc.4` stays readable; anything else becomes a
sanitized prefix of at most 52 bytes plus 10 hex characters of the revision's
SHA-256. The hash restores what truncation destroys and always ends the label
on a hex digit, which removes the trailing-delimiter trimming entirely rather
than adding another pass to it.
No new value, flag, or configurable concept, and the existing image-tag
contract is not narrowed: nothing is rejected that the chart used to accept.
`BUZZ_STORAGE_SNAPSHOT_CODE_SHA` is never sanitized, so the snapshot row keeps
the exact revision while the label stays a valid, distinct telemetry key.
Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: tornquist <[email protected]>
0 commit comments