-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
implement InstanceShutdownByProviderID to openstack #67982
Conversation
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, one question
server, err := servers.Get(i.compute, instanceID).Extract() | ||
if err != nil { | ||
if isNotFound(err) { | ||
return false, 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.
Why not return NotFound err here
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.
To avoid misleading log print https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/cloud/node_controller.go#L257-L259 the notfound thing is checked again in row https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/cloud/node_controller.go#L274
These two calls could be combined but its not that easy when we have many cloudproviders and things are not working in similar way.
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 NotFound error message is printed twice, i don't think that is misleading, they just meet the same error.
Since the NotFound error is still a kind of error, i'd prefer returning that...
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.
+1 @NickrenREN
/test pull-kubernetes-integration |
return error if instance does not exist do not export instanceshutoff
/milestone v1.12 |
/sig openstack |
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
@dims can you approve ?
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, yastij, zetaab 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 |
Automatic merge from submit-queue (batch tested with PRs 66577, 67948, 68001, 67982). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. |
What this PR does / why we need it: without this openstack cannot get shutdown taint when instance is shutdown (original pr where this feature was added #60009)
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 #
Special notes for your reviewer:
Release note: