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.
  • Loading branch information
oilbeater committed Apr 18, 2022
1 parent 8f1e85a commit 4305116
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 @@ -1230,7 +1230,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 4305116

Please sign in to comment.