Skip to content

fix(chart): keep the chart version out of pod labels - #7192

Open
DrFaust92 wants to merge 1 commit into
akuity:mainfrom
DrFaust92:fix/pod-labels-chart-version
Open

DrFaust92 wants to merge 1 commit into
akuity:mainfrom
DrFaust92:fix/pod-labels-chart-version

Conversation

@DrFaust92

@DrFaust92 DrFaust92 commented Sep 12, 2026

Copy link
Copy Markdown

Description

Closes #7191

kargo.labels includes helm.sh/chart — the chart version — and it was applied to the pod templates as well as to the objects. Every chart version bump therefore rewrote the pod specs and Kubernetes restarted all Kargo pods on helm upgrade, even when nothing functional had changed.

This adds kargo.podLabels, the same label set without helm.sh/chart, and uses it in the six deployments (api, controller, management-controller, dex-server, kubernetes-webhooks-server, external-webhooks-server) and the garbage-collector CronJob's pod template. The objects keep the full kargo.labels, so the chart version is still visible where it belongs, and pods keep app.kubernetes.io/version, name, instance, managed-by and component.

The CronJob's jobTemplate.metadata.labels is deliberately left alone — those are Job object labels and don't cause restarts.

Verified by rendering the chart against a bumped version: no helm.sh/chart remains inside any pod template. helm unittest passes (154 tests, 48 suites).

Checklist

Eligibility

  • Linked to an existing issue with no blocking labels (kind/proposal, needs discussion, needs research, maintainer only, area/security, size/large, size/x-large, size/xx-large).
  • Changes documentation only.
  • Changes ten lines or fewer.

Quality

  • Adds or updates corresponding tests.
  • Adds or updates corresponding documentation.

AI Use Disclosure

This PR was written:

  • By a human without AI assistance.
  • By a human with AI assistance. A human has reviewed every line prior to opening the PR.
  • By an AI with human supervision. A human has reviewed every line prior to opening the PR.
  • Entirely by an AI. No human has reviewed this prior to opening the PR.

Sign-Off

All commits:

  • Are signed off by their author (git commit -s) (required)
  • Are cryptographically signed (git commit -S) (encouraged)

kargo.labels includes helm.sh/chart, and it was applied to the pod templates
as well as to the objects, so every chart version bump rewrote the pod specs
and restarted all Kargo pods on upgrade with nothing else changed.

Add kargo.podLabels, the same label set without helm.sh/chart, and use it in
the six deployments and the garbage-collector CronJob pod template.

Signed-off-by: Ilia Lazebnik <[email protected]>
@DrFaust92
DrFaust92 requested a review from a team as a code owner September 12, 2026 14:59
@netlify

netlify Bot commented Sep 12, 2026

Copy link
Copy Markdown

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit bc01ada
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/6aa568e965b9ae0008eae977
😎 Deploy Preview https://deploy-preview-7192.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kargo-governance-bot kargo-governance-bot Bot added needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/kind Issue or PR needs to be labeled to clarify its nature needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed labels Sep 12, 2026
@krancour

Copy link
Copy Markdown
Member

You're not wrong here, but I swear we already fixed this ages ago. I want to research a bit and see if that regressed somehow.

@krancour krancour self-assigned this Sep 14, 2026
@krancour
krancour self-requested a review September 14, 2026 00:03
@jessesuen

Copy link
Copy Markdown
Member

You're not wrong here, but I swear we already fixed this ages ago. I want to research a bit and see if that regressed somehow.

I recall fixing this in our enterprise distribution, but not OSS, so that might be what you are thinking.

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

Labels

needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/kind Issue or PR needs to be labeled to clarify its nature needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chart version in pod labels restarts all Kargo pods on every chart upgrade

3 participants