Merge pull request #110469 from prasita123/pr_branch

add missing error handling steps
This commit is contained in:
Kubernetes Prow Robot 2022-06-14 12:07:33 -07:00 committed by GitHub
commit e08bf9cce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -163,7 +163,12 @@ func (cnc *CloudNodeController) Run(stopCh <-chan struct{}) {
// The periodic loop for updateNodeStatus communicates with the APIServer with a worst case complexity // The periodic loop for updateNodeStatus communicates with the APIServer with a worst case complexity
// of O(num_nodes) per cycle. These functions are justified here because these events fire // of O(num_nodes) per cycle. These functions are justified here because these events fire
// very infrequently. DO NOT MODIFY this to perform frequent operations. // very infrequently. DO NOT MODIFY this to perform frequent operations.
go wait.Until(func() { cnc.UpdateNodeStatus(context.TODO()) }, cnc.nodeStatusUpdateFrequency, stopCh) go wait.Until(func() {
if err := cnc.UpdateNodeStatus(context.TODO()); err != nil {
klog.Errorf("failed to update node status: %v", err)
}
}, cnc.nodeStatusUpdateFrequency, stopCh)
go wait.Until(cnc.runWorker, time.Second, stopCh) go wait.Until(cnc.runWorker, time.Second, stopCh)
<-stopCh <-stopCh

View File

@ -268,7 +268,9 @@ func (rc *RouteController) reconcile(ctx context.Context, nodes []*v1.Node, rout
go func(n *v1.Node) { go func(n *v1.Node) {
defer wg.Done() defer wg.Done()
klog.Infof("node %v has no routes assigned to it. NodeNetworkUnavailable will be set to true", n.Name) klog.Infof("node %v has no routes assigned to it. NodeNetworkUnavailable will be set to true", n.Name)
rc.updateNetworkingCondition(n, false) if err := rc.updateNetworkingCondition(n, false); err != nil {
klog.Errorf("failed to update networking condition when no nodeRoutes: %v", err)
}
}(node) }(node)
continue continue
} }
@ -282,7 +284,9 @@ func (rc *RouteController) reconcile(ctx context.Context, nodes []*v1.Node, rout
} }
go func(n *v1.Node) { go func(n *v1.Node) {
defer wg.Done() defer wg.Done()
rc.updateNetworkingCondition(n, allRoutesCreated) if err := rc.updateNetworkingCondition(n, allRoutesCreated); err != nil {
klog.Errorf("failed to update networking condition: %v", err)
}
}(node) }(node)
} }
wg.Wait() wg.Wait()