-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Assume volume is detached if node doesn't exist #29485
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,10 +62,12 @@ func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error { | |
for nodeName, attachedVolumes := range nodesToUpdate { | ||
nodeObj, exists, err := nsu.nodeInformer.GetStore().GetByKey(nodeName) | ||
if nodeObj == nil || !exists || err != nil { | ||
return fmt.Errorf( | ||
"failed to find node %q in NodeInformer cache. %v", | ||
// If node does not exist, its status cannot be updated, log error and move on. | ||
glog.Warningf( | ||
"Could not update node status. Failed to find node %q in NodeInformer cache. %v", | ||
nodeName, | ||
err) | ||
return nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be continuing (as per the comment), rather than returning from the whole func? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The behavior is correct. Perhaps the comment can be clarified. "Move on" in this case means abandon trying to update the status of a node (since it no longer exists). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, wasn't sure if it was intending to also short-circuit and not update any of the other remaining nodes, or if a bad nodeName could permanently block ever getting to update those nodes' status |
||
} | ||
|
||
node, ok := nodeObj.(*api.Node) | ||
|
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.
Yes, we have to be really careful with when we return InstanceNotFound. According to the comments on cloudprovider.Instances, we must return InstanceNotFound, but actually that's wrong and it only applies to ExternalID (AFAICT), and you didn't wrap it there. I'll put in a separate PR to fix the comments.
To (try to) be clear: But what you're done here is right, though it would be wrong if the docs were right. At least I think so!