Skip to content

[bitnami/redis] bugfix: honor custom labels on PVCs#36542

Closed
initharrington wants to merge 2 commits into
bitnami:mainfrom
initharrington:fix/redis/pvc-custom-labels-dropped
Closed

[bitnami/redis] bugfix: honor custom labels on PVCs#36542
initharrington wants to merge 2 commits into
bitnami:mainfrom
initharrington:fix/redis/pvc-custom-labels-dropped

Conversation

@initharrington

Copy link
Copy Markdown

Description of the change

Custom labels supplied via master.persistence.labels, replica.persistence.labels, sentinel.persistence.labels, and commonLabels were silently dropped from rendered PVCs in volumeClaimTemplates. The templates used common.labels.matchLabels, which picks only app.kubernetes.io/name and app.kubernetes.io/instance out of the input — filtering every other user-supplied label.

Switched the three PVC templates to common.labels.standard, which merges custom labels with the standard set. This matches how every other non-selector labels: field in the chart is already rendered.

Two adjacent bugs fixed in the same change:

  • The replica PVC template was reading .Values.master.persistence.labels instead of .Values.replica.persistence.labels — a copy-paste from the master template.
  • The sentinel redis-data PVC ignored replica.persistence.labels entirely, even though it inherits every other field from replica.persistence.*.

Benefits

Custom labels on PVCs now work as documented in values.yaml. This unblocks label-selector-based tooling (Prometheus alert routing, cost allocation, ownership tags) that previously had no way to land labels on PVCs without manually patching them post-install. Important because volumeClaimTemplates are immutable after StatefulSet creation.

Possible drawbacks

PVCs will now carry the full set of standard labels (app.kubernetes.io/name, instance, managed-by, version, helm.sh/chart) plus user-supplied labels, where previously they only carried name and instance. Anyone with external selectors matching PVCs on the absence of those keys would be affected, but that would be an unusual setup.

Applicable issues

Additional information

Validated by rendering each architecture (standalone, replication, sentinel) with custom *.persistence.labels + commonLabels and confirming the labels appear on the rendered PVCs. Also rendered with defaults to confirm the no-custom-labels case still produces the expected standard label set. helm lint passes.

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • [X Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

Switched PVC labels from common.labels.matchLabels to common.labels.standard so master/replica/sentinel persistence.labels and commonLabels are no longer filtered out.

Fixes bitnami#36536

Signed-off-by: Sean Harrington <8240651+initharrington@users.noreply.github.com>
@github-actions github-actions Bot added redis triage Triage is needed labels May 30, 2026
@github-actions github-actions Bot requested a review from javsalgar May 30, 2026 20:14
@carrodher carrodher added verify Execute verification workflow for these changes in-progress labels Jun 1, 2026
@github-actions github-actions Bot removed the triage Triage is needed label Jun 1, 2026
@github-actions github-actions Bot removed the request for review from javsalgar June 1, 2026 07:00
@github-actions github-actions Bot requested a review from juan131 June 1, 2026 07:00
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>

@juan131 juan131 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would open the door for introducing mutable labels (e.g. those depending on chart version) that would break upgrading in the future given these fields are considered inmutable by K8s

@github-actions

Copy link
Copy Markdown

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions Bot added the stale 15 days without activity label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot added stale 15 days without activity and removed stale 15 days without activity labels Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

redis solved stale 15 days without activity verify Execute verification workflow for these changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bitnami/redis] Custom labels on PVCs are silently dropped — master.persistence.labels/replica.persistence.labels not honored

5 participants