Commit 177d6421 authored by David Ashpole's avatar David Ashpole

fix outofdisk condition not reported

parent 1284d78c
...@@ -865,14 +865,16 @@ func (kl *Kubelet) setNodeOODCondition(node *v1.Node) { ...@@ -865,14 +865,16 @@ func (kl *Kubelet) setNodeOODCondition(node *v1.Node) {
} }
newOODCondition := nodeOODCondition == nil newOODCondition := nodeOODCondition == nil
if newOODCondition || nodeOODCondition.Status == v1.ConditionUnknown { if newOODCondition {
nodeOODCondition = &v1.NodeCondition{ nodeOODCondition = &v1.NodeCondition{}
Type: v1.NodeOutOfDisk, }
Status: v1.ConditionFalse, if nodeOODCondition.Status != v1.ConditionFalse {
Reason: "KubeletHasSufficientDisk", nodeOODCondition.Type = v1.NodeOutOfDisk
Message: "kubelet has sufficient disk space available", nodeOODCondition.Status = v1.ConditionFalse
LastTransitionTime: currentTime, nodeOODCondition.Reason = "KubeletHasSufficientDisk"
} nodeOODCondition.Message = "kubelet has sufficient disk space available"
nodeOODCondition.LastTransitionTime = currentTime
kl.recordNodeStatusEvent(v1.EventTypeNormal, "NodeHasSufficientDisk")
} }
// Update the heartbeat time irrespective of all the conditions. // Update the heartbeat time irrespective of all the conditions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment