-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
labels' includeSelectors doesn't do what it implies #3937
Comments
Yeah, maybe |
I'm not sure |
|
We also want labels to be applied everywhere except in selectors, so that frequently changing labels (like a version label) do not attempt to update Deployment selectors. This means that these labels should still be applied to Pod templates, just not the selectors that match on them. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
…s true (#4209) * add labels in template/metadata by default * update comment * fix kustomization labels test * Add spec/template/metadata/labels when includeTemplate is true * remove unnecessary test changes * add error wrap * Revert "add error wrap" This reverts commit 0a203df. * add error wrap at template fieldSpec merge
Describe the bug
The new labels feature introduced in 4.1.0 includes a boolean flag called
includeSelectors
, which does not do what one might assume from the name. Examining the source code reveals that when includeSelectors is enabled, the label pairs are added just like commonLabels would be, and whenincludeSelectors
is disabled, onlymetadata.labels
is updated. This of course excludes selectors, but also other parts of the output that are not selectors, such asspec.template.metadata.labels
.includeSelectors
should in my mind be updated to only include/exclude selectors, or it should be renamed to onlyMetadata or something to better reflect its actual behaviour.Files that can reproduce the issue
kustomization.yaml
deployment.yaml
Expected output
Actual output
Kustomize version
kustomize/v4.1.3
Platform
macOS
The text was updated successfully, but these errors were encountered: