This repository was archived by the owner on Jul 13, 2026. It is now read-only.
fix: replace deprecated commonLabels with labels in kustomizations - #3
Open
triuzzi wants to merge 1 commit into
Open
fix: replace deprecated commonLabels with labels in kustomizations#3triuzzi wants to merge 1 commit into
triuzzi wants to merge 1 commit into
Conversation
Recent kustomize versions (bundled with modern kubectl) deprecate `commonLabels` in favor of `labels`, emitting a warning for every occurrence during `kubectl kustomize`. Migrate all base and component kustomization.yml files to `labels`. `commonLabels` injects its labels into resource selectors (Deployment `spec.selector.matchLabels`, Service `spec.selector`, StatefulSet selectors), whereas `labels` does not do so by default, so each entry sets `includeSelectors: true` to preserve the exact prior behavior. The generated manifest is byte-for-byte identical before and after; only the deprecation warnings are removed. Addresses spinnaker/spinnaker#7716 Co-Authored-By: Claude <noreply@anthropic.com>
Author
Contributor
|
Hi @triuzzi, thank you and I'm sorry but this repository should be archived because the code was moved and since modified in the monorepo here: https://github.com/spinnaker/spinnaker/tree/main/spinnaker-kustomize It would be ideal if you could close this PR and port/refactor the changes in a PR against the monorepo. Would you mind? I'll ask in the community slack about archiving this repo. |
Member
|
Yeah I'll get those closed/archived shortly & README updated to point to the new location. Thanks and hope you can move this into the core repo! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Migrates every
kustomization.ymlin this repo from the deprecatedcommonLabelsfield to the modernlabelsfield.Addresses spinnaker/spinnaker#7716. (Cross-repo, so it won't auto-close — please close manually on merge.)
Why
Recent kustomize versions (bundled with modern
kubectl) deprecatecommonLabels. Runningkubectl kustomizetoday prints a warning for every occurrence:13 occurrences → 13 warnings.
The one subtlety (why not a plain rename)
commonLabelsinjects its labels into selectors as well as metadata — Deploymentspec.selector.matchLabels, Servicespec.selector, and StatefulSet selectors. The modernlabelsfield does not touch selectors unless you opt in. SincematchLabelsis immutable on a live Deployment, dropping the label from selectors would be a breaking change on upgrade.Each entry therefore sets
includeSelectors: true:Verification — output is unchanged
I compared
kubectl kustomize .(kustomize v5.8.1) before and after:commonLabelsin repodiffof the generated manifests is empty — this change is behavior-neutral and only removes the deprecation warnings.🤖 Generated with Claude Code