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

remove user rules in Azure that are in Nephe priority range #256

Merged
merged 2 commits into from
Jul 4, 2023

Conversation

shenmo3
Copy link
Contributor

@shenmo3 shenmo3 commented Jun 21, 2023

Description
Currently, Nephe preserves all user custom rules in Azure, even if they fall within the priority range designated for Nephe (2000-4096). This approach can lead to issues and confusions with rule priority computation. To address this, this PR introduces a restriction on Azure user custom rules, removing user custom rules within the Nephe priority range.

Changes

  1. The cloud sync process now adds a dummy rule in sync content when user rules within the Nephe priority range are detected, triggering a rule update.
  2. The rule update logic has been modified to remove user rules within the Nephe priority range.
  3. The sync function has been adjusted to handle the dummy rule appropriately.

@shenmo3 shenmo3 self-assigned this Jun 21, 2023
@shenmo3 shenmo3 marked this pull request as ready for review June 21, 2023 23:54
@reachjainrahul
Copy link
Contributor

/nephe-test-e2e-agentless

reachjainrahul
reachjainrahul previously approved these changes Jul 3, 2023
Copy link
Contributor

@reachjainrahul reachjainrahul left a comment

Choose a reason for hiding this comment

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

/LGTM

@@ -15,14 +15,14 @@
package networkpolicy

import (
runtimev1alpha1 "antrea.io/nephe/apis/runtime/v1alpha1"
Copy link
Contributor

Choose a reason for hiding this comment

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

sort

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

@@ -45,7 +45,10 @@ func (s *securityGroupImpl) syncImpl(csg cloudSecurityGroup, syncContent *cloudr
if len(syncMembers) > 0 && syncMembers[0].Type == cloudresource.CloudResourceTypeNIC {
cachedMembers, _ = r.getNICsOfCloudResources(s.members)
}
if compareCloudResources(cachedMembers, syncMembers) {
if !membershipOnly && len(syncContent.MembersWithOtherSGAttached) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove dead code at line 57

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

@reachjainrahul
Copy link
Contributor

/nephe-test-e2e-agentless

Copy link
Contributor

@reachjainrahul reachjainrahul left a comment

Choose a reason for hiding this comment

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

/LGTM

@reachjainrahul reachjainrahul merged commit 1a74654 into main Jul 4, 2023
12 checks passed
@reachjainrahul reachjainrahul deleted the remove-user-rule branch July 24, 2023 18:10
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.

2 participants