mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
error in setNodeStatus func should not abort node status update
This commit is contained in:
parent
b6f466ac61
commit
a40b15d8bd
@ -299,9 +299,7 @@ func (kl *Kubelet) initialNode() (*v1.Node, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := kl.setNodeStatus(node); err != nil {
|
kl.setNodeStatus(node)
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return node, nil
|
return node, nil
|
||||||
}
|
}
|
||||||
@ -375,9 +373,7 @@ func (kl *Kubelet) tryUpdateNodeStatus(tryNumber int) error {
|
|||||||
|
|
||||||
kl.updatePodCIDR(node.Spec.PodCIDR)
|
kl.updatePodCIDR(node.Spec.PodCIDR)
|
||||||
|
|
||||||
if err := kl.setNodeStatus(node); err != nil {
|
kl.setNodeStatus(node)
|
||||||
return err
|
|
||||||
}
|
|
||||||
// Patch the current status on the API server
|
// Patch the current status on the API server
|
||||||
updatedNode, err := nodeutil.PatchNodeStatus(kl.kubeClient, types.NodeName(kl.nodeName), originalNode, node)
|
updatedNode, err := nodeutil.PatchNodeStatus(kl.kubeClient, types.NodeName(kl.nodeName), originalNode, node)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -902,13 +898,12 @@ func (kl *Kubelet) setNodeVolumesInUseStatus(node *v1.Node) {
|
|||||||
// any fields that are currently set.
|
// any fields that are currently set.
|
||||||
// TODO(madhusudancs): Simplify the logic for setting node conditions and
|
// TODO(madhusudancs): Simplify the logic for setting node conditions and
|
||||||
// refactor the node status condition code out to a different file.
|
// refactor the node status condition code out to a different file.
|
||||||
func (kl *Kubelet) setNodeStatus(node *v1.Node) error {
|
func (kl *Kubelet) setNodeStatus(node *v1.Node) {
|
||||||
for _, f := range kl.setNodeStatusFuncs {
|
for _, f := range kl.setNodeStatusFuncs {
|
||||||
if err := f(node); err != nil {
|
if err := f(node); err != nil {
|
||||||
return err
|
glog.Warningf("Failed to set some node status fields: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// defaultNodeStatusFuncs is a factory that generates the default set of
|
// defaultNodeStatusFuncs is a factory that generates the default set of
|
||||||
|
Loading…
Reference in New Issue
Block a user