Skip to content

[bitnami/common] app.kubernetes.io/version` label fails with SemVer appVersion containing "+" #34112

@jakuboskera

Description

@jakuboskera

Name and Version

bitnami/common 2.31.2

What architecture are you using?

None

What steps will reproduce the bug?

When using a valid appVersion with a + symbol in Chart.yaml, for example:

appVersion: "1.2.3+build7"

the value is passed directly into the app.kubernetes.io/version label by the standard Bitnami label helper:

{{- with .Chart.AppVersion }}
app.kubernetes.io/version: {{ . | quote }}
{{- end -}}

This causes Helm to generate Kubernetes manifests with an invalid label value, since Kubernetes does not allow + characters in label values.

Kubernetes returns an error such as:

Invalid value: "1.2.3+build7": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character

However, the + symbol is perfectly valid according to Semantic Versioning, where it is used to denote build metadata.

Are you using any custom parameters or values?

No response

What is the expected behavior?

The app.kubernetes.io/version label should accept any valid appVersion from Chart.yaml, including SemVer values with +, by sanitizing them to match Kubernetes label requirements.

What do you see instead?

When appVersion contains a + (e.g. 1.2.3+build7), Helm renders it directly into the label, causing a Kubernetes validation error because + is not allowed in label values.

Additional information

Suggested Fix

In the app.kubernetes.io/version label, apply the same sanitization logic used in helm.sh/chart label (see common.names.chart).

Metadata

Metadata

Assignees

Labels

commonsolvedstale15 days without activitytech-issuesThe user has a technical issue about an applicationtriageTriage is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions