Skip to content
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

Document labels field #4147

Closed
terion-name opened this issue Aug 26, 2021 · 5 comments
Closed

Document labels field #4147

terion-name opened this issue Aug 26, 2021 · 5 comments
Labels
kind/documentation Categorizes issue or PR as related to documentation. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@terion-name
Copy link

terion-name commented Aug 26, 2021

UPD
After days of struggling I've found this merge: #3743
So it is posible with labels field, but this is not documented anywhere :(

Leaving the issue for others to find this

===========================
Orignal text:

Hello.

This is a discussion topic that I want to rise.

Despite being a feature,commonLabelss behaviour was reported as a bug numerous times for years already. This kinda should've tell that such behaviour is counter-intutivie and is not what community wait and want from it.

As pointed here one should use LabelTransforners to set labels only for labels, but this is very bad approach, because requires a huge amount of configs written for every case (ruining the purpose of Kustomize to make small and convenient overlays) and those configs aren't reusable at all, because being used as a resource they can't inherit properties from kustomization.yaml

Very simple example:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
  app.kubernetes.io/name: "app-name"
  app.kubernetes.io/version: "1.0.1"
resources:
  - ../../../cluster/regcred/
  - ./base
images:
  - name: app-image
    newTag: 1.0.1
    newName: registry.example.com/app-name/master

The main app config is in ./base, this overlay alters image to new build and labels all resources to new version.

And this is impossible and will not work, because In API version apps/v1, a Deployment’s label selector is immutable after it gets created and commonLabels changes selector. And to overcome this one should create each time a new set of cumbersome huge configs in separate files just to make the thing commonLabels are supposed to do.

commonLabels — even semantically is common LABELS, not selectors. Labels and selectors are not the same and not always match each other entirely. This behaviour makes commonLabels literally immutable and forces to dance around it.

It would be much better if there were separate props like commonLabels and commonSelectors or commonMatchers that each do what the name says they should.

@terion-name terion-name added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 26, 2021
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 26, 2021
@terion-name terion-name changed the title commonLabels should not alter matchLabels commonLabels should not alter matchLabels [upd: present, undocumented] Aug 27, 2021
@KnVerey
Copy link
Contributor

KnVerey commented Sep 1, 2021

/kind documentation
/triage accepted

@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 1, 2021
@KnVerey KnVerey removed the kind/feature Categorizes issue or PR as related to a new feature. label Sep 1, 2021
@KnVerey KnVerey changed the title commonLabels should not alter matchLabels [upd: present, undocumented] Document labels field Sep 1, 2021
@KnVerey
Copy link
Contributor

KnVerey commented Oct 1, 2021

Actually this is a duplicate of #3756. The original issue lists the places to be updated.

/kind duplicate
/close

@k8s-ci-robot
Copy link
Contributor

@KnVerey: The label(s) kind/duplicate cannot be applied, because the repository doesn't have them.

In response to this:

Actually this is a duplicate of #3756. The original issue lists the places to be updated.

/kind duplicate
/close

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.

@k8s-ci-robot
Copy link
Contributor

@KnVerey: Closing this issue.

In response to this:

Actually this is a duplicate of #3756. The original issue lists the places to be updated.

/kind duplicate
/close

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.

@KnVerey KnVerey added triage/duplicate Indicates an issue is a duplicate of other open issue. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Oct 1, 2021
@k8s-ci-robot
Copy link
Contributor

@terion-name: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

3 participants