-
Notifications
You must be signed in to change notification settings - Fork 2.3k
network policy rules are incorrectly updated with kustomization labels #5912
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
Comments
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 The 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-sigs/prow repository. |
the default list includes those paths to podselectors. I guess you can overcome that with some reorganization of your netpol files. edit: kustomize/plugin/builtin/labeltransformer/LabelTransformer_test.go Lines 19 to 37 in 616c084
|
sure... i'm aware that this is an option. but if i have a kustomization with 50 different resources ( plus, every time i add a new resource or remove a resource i have to remember to update the label transformer... not a great ux. kustomize modifying a it would make much more sense if i had to do something out of the ordinary for such a rare setup vs for something that is the norm: allow traffic from/to different workloads to/from the workload i'm kustomize'ing. ...just my opinion. 🤷 but i realize that there's probably no way to do this in a way that won't break existing kustomizations that rely on this odd behavior. 😞 so feel free to close this issue. i just wanted to point out that this behavior is a bit... suboptimal. 🤷 |
actually, come to think of it... i guess the following could be done to make this change backward compatible: just like apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: foo
labels:
- includeSelectors: true
includeNetworkPolicyIngressRules: false # default to `true`
includeNetworkPolicyEgressRules: false # default to `true
pairs:
key1: val1
key2: val2
- includeTemplates: true
pairs:
key3: val3
resources:
- netpol.yaml it's kinda kludgy but it's the only thing i can think of to disable the less-than-perfect existing behavior in a backward-compatible way. 🤷 |
What happened?
kustomize incorrectly updates network policy rules (rather than just the
podSelector
) when usinglabels
withincludeSelectors: true
orcommonLabels
in the kustomization.What did you expect to happen?
i expect the network policy rules to remain unaltered.
How can we reproduce it (as minimally and precisely as possible)?
kustomization.yaml
:netpol.yaml
:Expected output
Actual output
Kustomize version
v5.6.0
Operating system
None
The text was updated successfully, but these errors were encountered: