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

Replacing app.kubernetes.io/name with kubernetes.io/metadata.name in mutatingwebhook #2913

Closed
HatchBV opened this issue Dec 1, 2022 · 0 comments · Fixed by #2936
Closed
Assignees

Comments

@HatchBV
Copy link

HatchBV commented Dec 1, 2022

Please describe your use case / problem.
Interception not working with namespace-scoped traffic manager installation with default labels of namespace even with k8s version > 1.21 because the mutating webhook use app.kubernetes.io/name label for namespaces scoping which is not added by default to namespaces by k8s controller

Describe the solution you'd like
I would recommend replacing app.kubernetes.io/name with kubernetes.io/metadata.name because according to the K8s documentation app.kubernetes.io/name is used for workload resources and namespace is not part of workload resources, and kubernetes.io/metadata.name is set by the K8s API on all namespaces and can't be changed and can be used for targeting namespace

@HatchBV HatchBV changed the title Replacing app.kubernetes.io/name with kubernetes.io/metadata.name Replacing app.kubernetes.io/name with kubernetes.io/metadata.name in mutatingwebhook Dec 1, 2022
@thallgren thallgren self-assigned this Dec 8, 2022
thallgren added a commit that referenced this issue Dec 8, 2022
The `kubernetes.io/metadata.name` is always set in Kubernetes versions
1.21 and higher. This commit ensures that it is used in favor of
`app.kubernetes.io/name` on such versions.

Closes #2913

Signed-off-by: Thomas Hallgren <thomas@datawire.io>
thallgren added a commit that referenced this issue Dec 9, 2022
The `kubernetes.io/metadata.name` is always set in Kubernetes versions
1.21 and higher. This commit ensures that it is used in favor of
`app.kubernetes.io/name` on such versions.

Closes #2913

Signed-off-by: Thomas Hallgren <thomas@datawire.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants