diff --git a/pkg/controller/node/nodecontroller.go b/pkg/controller/node/nodecontroller.go index 50d5a4f6705..a4739763312 100644 --- a/pkg/controller/node/nodecontroller.go +++ b/pkg/controller/node/nodecontroller.go @@ -833,8 +833,8 @@ func (nc *NodeController) setLimiterInZone(zone string, zoneSize int, state zone } } -// For a given node checks its conditions and tries to update it. Returns grace period to which given node -// is entitled, state of current and last observed Ready Condition, and an error if it occurred. +// tryUpdateNodeStatus checks a given node's conditions and tries to update it. Returns grace period to +// which given node is entitled, state of current and last observed Ready Condition, and an error if it occurred. func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1.NodeCondition, *v1.NodeCondition, error) { var err error var gracePeriod time.Duration @@ -910,7 +910,6 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1. // otherwise we leave it as it is. if savedCondition.LastTransitionTime != observedCondition.LastTransitionTime { glog.V(3).Infof("ReadyCondition for Node %s transitioned from %v to %v", node.Name, savedCondition.Status, observedCondition) - transitionTime = nc.now() } else { transitionTime = savedNodeStatus.readyTransitionTimestamp @@ -955,7 +954,16 @@ func (nc *NodeController) tryUpdateNodeStatus(node *v1.Node) (time.Duration, v1. } // remaining node conditions should also be set to Unknown - remainingNodeConditionTypes := []v1.NodeConditionType{v1.NodeOutOfDisk, v1.NodeMemoryPressure, v1.NodeDiskPressure} + remainingNodeConditionTypes := []v1.NodeConditionType{ + v1.NodeOutOfDisk, + v1.NodeMemoryPressure, + v1.NodeDiskPressure, + // We don't change 'NodeInodePressure' condition, as it'll be removed in future. + // v1.NodeInodePressure, + // We don't change 'NodeNetworkUnavailable' condition, as it's managed on a control plane level. + // v1.NodeNetworkUnavailable, + } + nowTimestamp := nc.now() for _, nodeConditionType := range remainingNodeConditionTypes { _, currentCondition := v1node.GetNodeCondition(&node.Status, nodeConditionType) @@ -1091,7 +1099,7 @@ func (nc *NodeController) ReducedQPSFunc(nodeNum int) float32 { return 0 } -// This function is expected to get a slice of NodeReadyConditions for all Nodes in a given zone. +// ComputeZoneState returns a slice of NodeReadyConditions for all Nodes in a given zone. // The zone is considered: // - fullyDisrupted if there're no Ready Nodes, // - partiallyDisrupted if at least than nc.unhealthyZoneThreshold percent of Nodes are not Ready,