-
Notifications
You must be signed in to change notification settings - Fork 867
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
keep ResourceBinding when removing PropagationPolicy #601
Conversation
b10bcd9
to
47a83be
Compare
I haven't dig into why the E2E failing. Just echo the logs here and try again.
|
Do you know when the crd of ServiceImport CRD is created. Is it created in advance? I only found the creation of ClusterPropagationPolicy in this test. |
The karmada/hack/deploy-karmada.sh Lines 115 to 116 in 51233e5
|
You may need to modify the e2e test: Lines 265 to 296 in 51233e5
the original logic will check whether |
So just remove this check? |
I think so. |
eb197b2
to
ef67c09
Compare
/assign |
@@ -258,41 +258,6 @@ var _ = ginkgo.Describe("[MCS] Multi-Cluster Service testing", func() { | |||
err := karmadaClient.PolicyV1alpha1().ClusterPropagationPolicies().Delete(context.TODO(), serviceImportPolicy.Name, metav1.DeleteOptions{}) | |||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) | |||
}) |
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.
Can you add some comment to record why not wait ServiceExport
and ServiceImport
disappear on member clusters?
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.
OK, I will add it.
ef67c09
to
bfd8142
Compare
@@ -866,20 +866,14 @@ func (d *ResourceDetector) HandlePropagationPolicyDeletion(policyNS string, poli | |||
return err | |||
} | |||
|
|||
for itemIndex, binding := range rbs.Items { | |||
for _, binding := range rbs.Items { |
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.
The method's comments should be updated as well, e.g.
// HandlePropagationPolicyDeletion handles PropagationPolicy delete event.
// After a policy is removed, the label marked on relevant resource template will be removed(which gives
// the resource template a change to match another policy).
//
// Note: The relevant ResourceBinding will continue to exist until the resource template is gone.
func (d *ResourceDetector) HandlePropagationPolicyDeletion(policyNS string, policyName string) error {
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.
OK, I will change it.
@@ -894,48 +888,36 @@ func (d *ResourceDetector) HandleClusterPropagationPolicyDeletion(policyName str | |||
policyv1alpha1.ClusterPropagationPolicyLabel: policyName, | |||
} | |||
|
|||
// load and remove the ClusterResourceBindings which labeled with current policy | |||
// load the ClusterResourceBindings which labeled with current policy |
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.
The method's comments should be updated as well, e.g.:
// HandleClusterPropagationPolicyDeletion handles ClusterPropagationPolicy delete event.
// After a policy is removed, the label marked on relevant resource template will be removed(which gives
// the resource template a change to match another policy).
//
// Note: The relevant ClusterResourceBinding or ResourceBinding will continue to exist until the resource template is gone.
func (d *ResourceDetector) HandleClusterPropagationPolicyDeletion(policyName string) error {
I'm considering a case,
Will the deployment be removed from |
Signed-off-by: junqian <junqian@tencent.com>
bfd8142
to
bf7f4bf
Compare
The deployment will be removed from member1 |
I found this issue twice today. Let's re-trigger it.
|
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
stop delete resourcebinding when the related policy is deleted
Which issue(s) this PR fixes:
Fixes #505
Special notes for your reviewer:
Does this PR introduce a user-facing change?: