Skip to content

[kube-prometheus-stack] apply upgradeJob.labels to all CRD upgrade resources - #7126

Open
dpacgdm wants to merge 2 commits into
prometheus-community:mainfrom
dpacgdm:fix/crd-upgrade-job-labels-all-resources
Open

[kube-prometheus-stack] apply upgradeJob.labels to all CRD upgrade resources#7126
dpacgdm wants to merge 2 commits into
prometheus-community:mainfrom
dpacgdm:fix/crd-upgrade-job-labels-all-resources

Conversation

@dpacgdm

@dpacgdm dpacgdm commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • Render crds.upgradeJob.labels on ClusterRole, ClusterRoleBinding, ConfigMap, and ServiceAccount (previously only the Job)
  • Fold those labels into the existing kube-prometheus-stack.crd.upgradeJob.labels helper so each upgrade resource includes them from one place
  • Clarify the values.yaml comment so the label scope matches the templates

Addresses #7071

Test plan

  • helm template with crds.upgradeJob.enabled=true and a custom upgradeJob.labels entry; confirm the label appears on Job + RBAC + SA + ConfigMap

@dpacgdm
dpacgdm force-pushed the fix/crd-upgrade-job-labels-all-resources branch 2 times, most recently from 5fe877e to e1ace47 Compare July 21, 2026 15:34
…sources

upgradeJob.labels were only rendered on the Job. ClusterRole,
ClusterRoleBinding, ConfigMap, and ServiceAccount ignored them even
though the values comment suggested job-wide labeling.

Signed-off-by: dpacgdm <dpac.gdm@gmail.com>
@dpacgdm
dpacgdm force-pushed the fix/crd-upgrade-job-labels-all-resources branch from e1ace47 to cf3d563 Compare July 21, 2026 15:36
@jkroepke

Copy link
Copy Markdown
Member

Does it make sense to put them into kube-prometheus-stack.crd.upgradeJob.labels helper?

@dpacgdm

dpacgdm commented Jul 22, 2026

Copy link
Copy Markdown
Author

Yes — that would be cleaner. I'll move the shared label set into a kube-prometheus-stack.crd.upgradeJob.labels helper and have the Job / ClusterRole / ClusterRoleBinding / ServiceAccount / ConfigMap templates include it.

Move crds.upgradeJob.labels into kube-prometheus-stack.crd.upgradeJob.labels
so Job, RBAC, ConfigMap, and ServiceAccount all pick them up from one place.

Signed-off-by: dpacgdm <dpac.gdm@gmail.com>

@jkroepke jkroepke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please add an helm unittest test case to cover this change. - the PR checklist request this?

app.kubernetes.io/name: {{ template "kube-prometheus-stack.name" . }}-prometheus-operator
app.kubernetes.io/component: crds-upgrade
{{- with .Values.upgradeJob.labels }}
{{ toYaml . }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
{{ toYaml . }}
{{- toYaml . }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants