diff --git a/pkg/cableengine/syncer/syncer_test.go b/pkg/cableengine/syncer/syncer_test.go index d7bc56f34..93ee67ae7 100644 --- a/pkg/cableengine/syncer/syncer_test.go +++ b/pkg/cableengine/syncer/syncer_test.go @@ -675,6 +675,6 @@ func (m *equalGatewayMatcher) FailureMessage(actual interface{}) string { return format.Message(actual, "to equal", m.expected) } -func (m *equalGatewayMatcher) NegatedFailureMessage(actual interface{}) (message string) { +func (m *equalGatewayMatcher) NegatedFailureMessage(actual interface{}) string { return format.Message(actual, "not to equal", m.expected) } diff --git a/pkg/netlink/fake/netlink.go b/pkg/netlink/fake/netlink.go index 59a030767..fe9df9b08 100644 --- a/pkg/netlink/fake/netlink.go +++ b/pkg/netlink/fake/netlink.go @@ -450,13 +450,15 @@ func (n *basicType) ConfigureTCPMTUProbe(_, _ string) error { return nil } -func (n *NetLink) AwaitLink(name string) (link netlink.Link) { +func (n *NetLink) AwaitLink(name string) netlink.Link { + var link netlink.Link + Eventually(func() netlink.Link { link, _ = n.LinkByName(name) return link }, 5).ShouldNot(BeNil(), "Link %q not found", name) - return + return link } func (n *NetLink) AwaitNoLink(name string) { @@ -466,7 +468,7 @@ func (n *NetLink) AwaitNoLink(name string) { }, 5).Should(BeTrue(), "Link %q exists", name) } -func (n *NetLink) AwaitLinkSetup(name string) (link netlink.Link) { +func (n *NetLink) AwaitLinkSetup(name string) { Eventually(func() bool { n.basic().mutex.Lock() defer n.basic().mutex.Unlock() @@ -478,8 +480,6 @@ func (n *NetLink) AwaitLinkSetup(name string) (link netlink.Link) { return false }, 5).Should(BeTrue(), "Link %q not setup", name) - - return } func routeList[T any](n *NetLink, linkIndex, table int, f func(r *netlink.Route) *T) []T { diff --git a/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go b/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go index 4c4b927bd..c4163f823 100644 --- a/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go +++ b/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go @@ -36,7 +36,7 @@ const ( var logger = log.Logger{Logger: logf.Log.WithName("ovs-vsctl")} -func vsctlCmd(parameters ...string) (output string, err error) { +func vsctlCmd(parameters ...string) (string, error) { allParameters := []string{fmt.Sprintf("--timeout=%d", ovsCommandTimeout)} allParameters = append(allParameters, parameters...) diff --git a/pkg/util/clusterfiles/cluster_files.go b/pkg/util/clusterfiles/cluster_files.go index bc1871606..9e93e15b7 100644 --- a/pkg/util/clusterfiles/cluster_files.go +++ b/pkg/util/clusterfiles/cluster_files.go @@ -38,7 +38,7 @@ var logger = log.Logger{Logger: logf.Log.WithName("ClusterFiles")} // using an url schema that supports configmap://// // secret://// and file:/// returning // a local path to the file. -func Get(k8sClient kubernetes.Interface, urlAddress string) (pathStr string, err error) { +func Get(k8sClient kubernetes.Interface, urlAddress string) (string, error) { logger.V(log.DEBUG).Infof("Reading cluster_file: %s", urlAddress) parsedURL, err := url.Parse(urlAddress)