-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛Requeue while cluster's control plane object is being deleted #2519
Conversation
@vincepri: GitHub didn't allow me to assign the following users: sedefsavas. Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
controllers/cluster_controller.go
Outdated
@@ -219,6 +219,9 @@ func (r *ClusterReconciler) reconcileDelete(ctx context.Context, cluster *cluste | |||
"failed to delete %v %q for Cluster %q in namespace %q", | |||
obj.GroupVersionKind(), obj.GetName(), cluster.Name, cluster.Namespace) | |||
} | |||
default: | |||
logger.Info("Cluster still has descendants - need to requeue", "controlPlaneRef", cluster.Spec.ControlPlaneRef.Name) | |||
return ctrl.Result{RequeueAfter: deleteRequeueAfter}, nil |
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.
I don't think we can do this here - we have code in the KCP controller that defers deletion of the control plane machines if there are any non-control plane machines still around. Making this change here would cause a deadlock, I think.
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.
I forget why the ControlPlaneRef is handled first, shouldn't that be the last object to be deleted?
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.
I'm sure we must have had a reason for doing it first...
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.
Original PR #2094, trying to dig through the comments, I might just test it moving it down though
/hold |
71d1218
to
3720fde
Compare
The latest code change behaves as we want, the main changes are:
Deleting a cluster with
Then after all the workers are gone, the control plane machines in KCP gets a deletion timestamp:
And machines associated with it get deleted:
After a little, the cluster is gone without errors:
|
Signed-off-by: Vince Prignano <[email protected]>
/hold cancel |
/lgtm |
Signed-off-by: Vince Prignano [email protected]
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2507
/assign @sedefsavas @ncdc
/milestone v0.3.0-rc.3