[bitnami/common] Sanitize truncated chart label values#36558
Merged
Conversation
Ensure helm.sh/chart and app.kubernetes.io/version labels still end with an alphanumeric character after replacing + and truncating to Kubernetes' 63-character label limit. Resolves bitnami#36452 Signed-off-by: Peter Schiffer <3899107+pschiffe@users.noreply.github.com>
dgomezleon
approved these changes
Jun 29, 2026
dgomezleon
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks for contributing
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.
Description of the change
This updates the bitnami/common label helpers so generated Kubernetes label values remain valid after SemVer build metadata is normalized and truncated.
Specifically:
This prevents labels such as helm.sh/chart from ending in _ when a long chart version with build metadata is truncated.
Benefits
Charts can use long SemVer versions containing build metadata without rendering Kubernetes-invalid labels.
Example fixed case:
Previously this could truncate to a label ending in _, which Kubernetes rejects. The helper now trims that trailing invalid character while preserving the valid prefix.
Possible drawbacks
If a generated helm.sh/chart or app.kubernetes.io/version label would previously have ended with a non-alphanumeric character after truncation, the rendered label value is now slightly shorter. The chart version and appVersion themselves are unchanged.
Applicable issues
Additional information
Validation performed:
Checklist
Chart.yamlaccording to semver. This is not necessary when the changes only affect README.md files.README.mdusing readme-generator-for-helm