mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
fix outofdisk condition not reported
This commit is contained in:
parent
1284d78c92
commit
177d64213c
@ -865,14 +865,16 @@ func (kl *Kubelet) setNodeOODCondition(node *v1.Node) {
|
||||
}
|
||||
|
||||
newOODCondition := nodeOODCondition == nil
|
||||
if newOODCondition || nodeOODCondition.Status == v1.ConditionUnknown {
|
||||
nodeOODCondition = &v1.NodeCondition{
|
||||
Type: v1.NodeOutOfDisk,
|
||||
Status: v1.ConditionFalse,
|
||||
Reason: "KubeletHasSufficientDisk",
|
||||
Message: "kubelet has sufficient disk space available",
|
||||
LastTransitionTime: currentTime,
|
||||
}
|
||||
if newOODCondition {
|
||||
nodeOODCondition = &v1.NodeCondition{}
|
||||
}
|
||||
if nodeOODCondition.Status != v1.ConditionFalse {
|
||||
nodeOODCondition.Type = v1.NodeOutOfDisk
|
||||
nodeOODCondition.Status = v1.ConditionFalse
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user