-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[CA-1.18] #3034 cherry-pick: Improve delete node mechanisms for cluster-api autoscaler provider #3034 #3346
[CA-1.18] #3034 cherry-pick: Improve delete node mechanisms for cluster-api autoscaler provider #3034 #3346
Conversation
This change adds a function to remove the annotations associated with marking a node for deletion. It also adds logic to unmark a node in the event that an error is returned after the node has been annotated but before it has been removed. In the case where a node cannot be removed (eg due to minimum size), the node is unmarked before we return from the error condition.
This change removes a few nil checks against resources returned in the Mark and Unmark deletion functions of the cluster-autoscaler CAPI provider. These checks look to see if the returned value for a resource are nil, but the function will not return nil if it returns an error[0]. We only need to check the error return as discussed here[1]. [0] https://github.com/kubernetes/client-go/blob/master/dynamic/simple.go#L234 [1] https://github.com/openshift/kubernetes-autoscaler/pull/141/files#r414480960
/assign @elmiko |
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.
thanks for backporting Jason!
/approve
@enxebre @JoelSpeed ptal
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elmiko 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 |
/lgtm |
Backports #3034 to cluster-autoscaler-release-1.18:
From the original PR: