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

Support rule appliedTo in Antrea NetworkPolicy #227

Merged
merged 1 commit into from
May 20, 2023
Merged

Conversation

reachjainrahul
Copy link
Contributor

With this PR, we can now support both RuleLevel AppliedTo and PolicyLevel AppliedTo configuration in Antrea NetworkPolicy.

@reachjainrahul
Copy link
Contributor Author

/nephe-test-e2e-kind, /nephe-test-e2e-aws, /nephe-test-e2e-azure

@reachjainrahul
Copy link
Contributor Author

/nephe-test-e2e-eks, /nephe-test-e2e-aks

@reachjainrahul
Copy link
Contributor Author

/nephe-test-e2e-aws

@reachjainrahul
Copy link
Contributor Author

/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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

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

@reachjainrahul reachjainrahul force-pushed the rulelevel branch 2 times, most recently from 6dc08d9 to 1e62ea1 Compare May 19, 2023 17:43
@reachjainrahul
Copy link
Contributor Author

/nephe-test-e2e-kind, /nephe-test-e2e-aks, /nephe-test-e2e-eks

@reachjainrahul
Copy link
Contributor Author

/nephe-test-e2e-aks

shenmo3
shenmo3 previously approved these changes May 19, 2023
Copy link
Contributor

@shenmo3 shenmo3 left a 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]>
@reachjainrahul
Copy link
Contributor Author

/nephe-test-e2e-kind, /nephe-test-e2e-aks, /nephe-test-e2e-eks

@reachjainrahul reachjainrahul merged commit 25964e5 into main May 20, 2023
@reachjainrahul reachjainrahul deleted the rulelevel branch May 20, 2023 00:41
@reachjainrahul reachjainrahul added this to the Nephe v0.5 release milestone Jun 1, 2023
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 this pull request may close these issues.

3 participants