mirror of https://github.com/k3s-io/k3s
Merge pull request #34368 from jingxu97/Oct/statusupdate-10-7
Automatic merge from submit-queue Node status updater should SetNodeStatusUpdateNeeded if it fails to update status When volume controller tries to update the node status, if it fails to update the nodes status, it should call SetNodeStatusUpdateNeeded so that the volume list could be updated next time.pull/6/head
commit
453bfa1f0f
|
@ -63,11 +63,14 @@ func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error {
|
|||
for nodeName, attachedVolumes := range nodesToUpdate {
|
||||
nodeObj, exists, err := nsu.nodeInformer.GetStore().GetByKey(string(nodeName))
|
||||
if nodeObj == nil || !exists || err != nil {
|
||||
// If node does not exist, its status cannot be updated, log error and move on.
|
||||
glog.V(5).Infof(
|
||||
// If node does not exist, its status cannot be updated, log error and
|
||||
// reset flag statusUpdateNeeded back to true to indicate this node status
|
||||
// needs to be udpated again
|
||||
glog.V(2).Infof(
|
||||
"Could not update node status. Failed to find node %q in NodeInformer cache. %v",
|
||||
nodeName,
|
||||
err)
|
||||
nsu.actualStateOfWorld.SetNodeStatusUpdateNeeded(nodeName)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -123,11 +126,12 @@ func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error {
|
|||
nodeName,
|
||||
err)
|
||||
}
|
||||
|
||||
glog.V(3).Infof(
|
||||
"Updating status for node %q succeeded. patchBytes: %q",
|
||||
glog.V(2).Infof(
|
||||
"Updating status for node %q succeeded. patchBytes: %q VolumesAttached: %v",
|
||||
nodeName,
|
||||
string(patchBytes))
|
||||
string(patchBytes),
|
||||
node.Status.VolumesAttached)
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue