Skip to content

Commit

Permalink
log: show the reason if get gw node failed (#1443)
Browse files Browse the repository at this point in the history
If users set a not exist node in subnet gateway_nodes, the log only
show `gateway node is not ready` which is misleading.

(cherry picked from commit 4305116)
  • Loading branch information
oilbeater committed Apr 18, 2022
1 parent 9bec51b commit 135798d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,12 @@ func (c *Controller) reconcileGateway(subnet *kubeovnv1.Subnet) error {
}

node, err := c.nodesLister.Get(gw)
if err == nil && nodeReady(node) {
if err != nil {
klog.Errorf("failed to get gw node %s, %v", gw, err)
continue
}

if nodeReady(node) {
nodeTunlIP := strings.TrimSpace(node.Annotations[util.IpAddressAnnotation])
if nodeTunlIP == "" {
klog.Errorf("gateway node %v has no ip annotation", node.Name)
Expand Down

0 comments on commit 135798d

Please sign in to comment.