From 8cfe718fa6fe835c31fe80206a464747d1673ae4 Mon Sep 17 00:00:00 2001 From: Surya Seetharaman Date: Thu, 7 Oct 2021 21:55:52 +0200 Subject: [PATCH] Don't return err when annotation cannot be unmarshalled Signed-off-by: Surya Seetharaman (cherry picked from commit 4c47ef946f07c25f9db272e076de003782e0e703) --- go-controller/pkg/ovn/egressgw.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/go-controller/pkg/ovn/egressgw.go b/go-controller/pkg/ovn/egressgw.go index 6a82a96206..9f9b25ac8b 100644 --- a/go-controller/pkg/ovn/egressgw.go +++ b/go-controller/pkg/ovn/egressgw.go @@ -175,7 +175,9 @@ func (oc *Controller) addPodExternalGW(pod *kapi.Pod) error { foundGws, err := getExGwPodIPs(pod) if err != nil { - return err + klog.Errorf("Error getting exgw IPs for pod: %s, error: %v", pod.Name, err) + oc.recordPodEvent(err, pod) + return nil } // if we found any gateways then we need to update current pods routing in the relevant namespace @@ -833,10 +835,9 @@ func getExGwPodIPs(gatewayPod *kapi.Pod) ([]net.IP, error) { } } } else { - klog.Errorf("Ignoring pod %s as an external gateway candidate. Invalid combination "+ + return nil, fmt.Errorf("ignoring pod %s as an external gateway candidate. Invalid combination "+ "of host network: %t and routing-network annotation: %s", gatewayPod.Name, gatewayPod.Spec.HostNetwork, gatewayPod.Annotations[routingNetworkAnnotation]) - return nil, nil } return foundGws, nil }