-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support rule appliedTo in Antrea NetworkPolicy #227
Conversation
/nephe-test-e2e-kind, /nephe-test-e2e-aws, /nephe-test-e2e-azure |
/nephe-test-e2e-eks, /nephe-test-e2e-aks |
/nephe-test-e2e-aws |
/nephe-test-e2e-aws |
var err error | ||
nps, err = r.networkPolicyIndexer.ByIndex(networkPolicyIndexerByAppliedToGrp, s.id.Name) | ||
if err != nil { | ||
return fmt.Errorf("get networkpolicy indexer with index=%v, name=%v: %w", networkPolicyIndexerByAppliedToGrp, s.id.Name, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
return fmt.Errorf("get networkpolicy indexer with index=%v, name=%v: %w", networkPolicyIndexerByAppliedToGrp, s.id.Name, err) | |
return fmt.Errorf("get networkpolicy indexer with index=%v, name=%v: %v", networkPolicyIndexerByAppliedToGrp, s.id.Name, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually %w can and should be used for errors in format.
https://stackoverflow.com/questions/61283248/format-errors-in-go-s-v-or-w
6dc08d9
to
1e62ea1
Compare
/nephe-test-e2e-kind, /nephe-test-e2e-aks, /nephe-test-e2e-eks |
/nephe-test-e2e-aks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
Added one integration test for rule level appliedToGroup. Signed-off-by: Rahul Jain <[email protected]>
/nephe-test-e2e-kind, /nephe-test-e2e-aks, /nephe-test-e2e-eks |
With this PR, we can now support both RuleLevel AppliedTo and PolicyLevel AppliedTo configuration in Antrea NetworkPolicy.