-
Notifications
You must be signed in to change notification settings - Fork 387
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 child group existence validation for ClusterGroup #2443
Conversation
Signed-off-by: Yang Ding <dingyang@vmware.com>
Codecov Report
@@ Coverage Diff @@
## main #2443 +/- ##
==========================================
+ Coverage 59.82% 64.84% +5.01%
==========================================
Files 284 284
Lines 22170 25524 +3354
==========================================
+ Hits 13264 16551 +3287
+ Misses 7487 7418 -69
- Partials 1419 1555 +136
Flags with carried forward coverage won't be shown. Click here to find out more.
|
the following cases are most likely handled by the controllers but would like to verify:
maybe we can add e2e tests for above too |
Yes those cases are covered and I have added E2E tests for those |
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.
Question - we do not need NetworkPolicyController changes to support child group creation after parent?
We don't. Before this change, any updates in the childGroup selectors also need to propagate to the parent ClusterGroups, and if those ClusterGroups are used in ACNPs, the effective appliedTo/addressGroups will be updated. Hence the logic is already there. |
Great!
|
/test-all |
/test-e2e |
@Dyanngg the e2e test failure actually seems to be because of this PR
|
Signed-off-by: Yang Ding <dingyang@vmware.com>
b116be6
to
d0b5321
Compare
Thanks for the reminder. Yes this is an out of date testcase since we do not validate childGroup existence anymore. Forgot to update the testcase for legacy testgroup. Fixed now. /test-all |
/test-all |
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
I think this is not true? Creating cg3 after cg2 or creating cg2 after cg3 will fail? |
Signed-off-by: Yang Ding <dingyang@vmware.com> (cherry picked from commit 9222647)
This is the first of two PRs that relaxes admission validations for ClusterGroup references. This PR removes the restriction that a child ClusterGroup must exist before it can be referred to as
childGroup
in other ClusterGroups. With this change, the effective member of a nested ClusterGroup will be calculated as the union of its childGroup members, for each childGroup that exist in the cluster.Note that this PR does not change the max nested level of ClusterGroups, which is 1 at the moment. This means that any ClusterGroup that has a parent cannot be a nested ClusterGroup itself; and reversely, a ClusterGroup cannot select another nested ClusterGroup as its
childGroup
. This is validated upon creation/update of a ClusterGroup. The order of events matter in this case, as any update which would cause a ClusterGroup nesting over the order of 1 will be rejected.i.e. if we have 3 ClusterGroups: cg1; cg2: child=cg1; cg3: child=cg2
Tests done: