-
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
Adding labels only to .metadata.labels
#330
Comments
We will consider supporting this use case when design #91. It should provide an approach for users to add or remove different fields that they want to kustomize by transformers. |
@mikebryant I'm thinking if |
@Liujingfang1 I think that would work for the use-case I mentioned. |
I don't think that would work for our use-case. Specifically, we are deploying based on some labels, this includes a common label that is un-applied via patch from specific resources(to prevent from deleting certain resources). |
Supporting this kind of functionality would be really neat. I was going to implement dangling resources cleanup (that were left after prev. deployments) using |
@mylokin @Benjamintf1 @mikebryant Please have a look at:
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Just in case someone is looking for a workaround: Here is an example of a transformer to add labels only to the metadata block. https://github.com/viadee/kustomize-examples/tree/master/overlays/custom-metadata-labels |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'd like to be able to add labels to the metadata of all objects, without them being part of the selectors.
One use case would be in our deployment pipeline, adding a label of the current git commit hash, so we can easily see which pipeline actually ran, trace back issues, stuff like that.
Currently
commonLabels
applies to selectors as well, which makes it unsuitable (As we don't want to force a rollout of all Deployments on every change, for example)Is this something kustomize can/should support? Presumably using a different field name to
commonLabels
.The text was updated successfully, but these errors were encountered: