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

Antrea NetworkPolicy and K8s NetworkPolicy collides if have the same name and namespace #1173

Closed
Dyanngg opened this issue Aug 28, 2020 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Dyanngg
Copy link
Contributor

Dyanngg commented Aug 28, 2020

Describe the bug
Between controller and agent, Antrea NetworkPolicy and K8s NetworkPolicy are both converted to internal networkpolicy type for consumption. The keyFunc for the internal np store is defined as 'namespace/name' (L125, pkg/controller/networkpolicy/store/networkpolicy.go). Since both resources are namespaced, K8s NP and ANP with the same name in the same namespace will result in the same key generated for internal networkpolicy, while the spec of those two policies will be different. Hence, the controller will not be able to distinguish a ADD event for a new, same named policy and a UPDATE event for the original policy.

Proposed Solution
#1084 (comment)

@Dyanngg Dyanngg added the kind/bug Categorizes issue or PR as related to a bug. label Aug 28, 2020
@abhiraut
Copy link
Contributor

@tnqn do you have bandwidth to tackle this? or want me to take a crack on it. not sure if you already started work

@tnqn
Copy link
Member

tnqn commented Aug 31, 2020

@abhiraut I can work on this, I needed this to help distinguish policies for status and stats report.

@antoninbas
Copy link
Contributor

Moving this to the v0.11 milestone as discussed in #1258

@tnqn
Copy link
Member

tnqn commented Nov 3, 2020

Closed by #1445

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants