Skip to content

Commit 535ad75

Browse files
authored
Merge pull request #5422 from pperiyasamy/gcp-network-unavailable-taint
Remove NetworkUnavailable condition from node
2 parents aab04ad + c0fad85 commit 535ad75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

go-controller/pkg/clustermanager/network_cluster_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
cache "k8s.io/client-go/tools/cache"
1717
"k8s.io/client-go/tools/record"
1818
"k8s.io/client-go/util/retry"
19+
k8snodeutil "k8s.io/component-helpers/node/util"
1920
"k8s.io/klog/v2"
2021

2122
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/allocator/id"
@@ -576,7 +577,10 @@ func (h *networkClusterControllerEventHandler) UpdateResource(oldObj, newObj int
576577
// 1. we missed an add event (bug in kapi informer code)
577578
// 2. a user removed the annotation on the node
578579
// Either way to play it safe for now do a partial json unmarshal check
579-
if !nodeFailed && util.NoHostSubnet(oldNode) == util.NoHostSubnet(newNode) && !h.ncc.nodeAllocator.NeedsNodeAllocation(newNode) {
580+
_, nodeCondition := k8snodeutil.GetNodeCondition(&newNode.Status, corev1.NodeNetworkUnavailable)
581+
nodeNetworkUnavailable := nodeCondition != nil && nodeCondition.Status == corev1.ConditionTrue
582+
if !nodeFailed && util.NoHostSubnet(oldNode) == util.NoHostSubnet(newNode) &&
583+
!h.ncc.nodeAllocator.NeedsNodeAllocation(newNode) && !nodeNetworkUnavailable {
580584
// no other node updates would require us to reconcile again
581585
return nil
582586
}

0 commit comments

Comments
 (0)