mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Don't panic in NodeController if pod update fails
Previously it was trying to use a nil pod variable if error was returned from the pod update call.
This commit is contained in:
@@ -1005,9 +1005,9 @@ func (nc *NodeController) markAllPodsNotReady(nodeName string) error {
|
|||||||
if cond.Type == api.PodReady {
|
if cond.Type == api.PodReady {
|
||||||
pod.Status.Conditions[i].Status = api.ConditionFalse
|
pod.Status.Conditions[i].Status = api.ConditionFalse
|
||||||
glog.V(2).Infof("Updating ready status of pod %v to false", pod.Name)
|
glog.V(2).Infof("Updating ready status of pod %v to false", pod.Name)
|
||||||
pod, err := nc.kubeClient.Core().Pods(pod.Namespace).UpdateStatus(&pod)
|
_, err := nc.kubeClient.Core().Pods(pod.Namespace).UpdateStatus(&pod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Warningf("Failed to update status for pod %q: %v", format.Pod(pod), err)
|
glog.Warningf("Failed to update status for pod %q: %v", format.Pod(&pod), err)
|
||||||
errMsg = append(errMsg, fmt.Sprintf("%v", err))
|
errMsg = append(errMsg, fmt.Sprintf("%v", err))
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user