diff --git a/.trivyignore b/.trivyignore index e69de29bb2d..575796aab7c 100644 --- a/.trivyignore +++ b/.trivyignore @@ -0,0 +1 @@ +CVE-2024-45338 diff --git a/cmd/controller/controller.go b/cmd/controller/controller.go index c0ebf036110..e5845b87c50 100644 --- a/cmd/controller/controller.go +++ b/cmd/controller/controller.go @@ -26,7 +26,7 @@ func CmdMain() { defer klog.Flush() stopCh := signals.SetupSignalHandler() - klog.Infof(versions.String()) + klog.Info(versions.String()) controller.InitClientGoMetrics() controller.InitWorkQueueMetrics() diff --git a/cmd/daemon/cniserver.go b/cmd/daemon/cniserver.go index a9d4ae8b2e9..145ab22fd49 100644 --- a/cmd/daemon/cniserver.go +++ b/cmd/daemon/cniserver.go @@ -27,7 +27,7 @@ import ( func CmdMain() { defer klog.Flush() - klog.Infof(versions.String()) + klog.Info(versions.String()) daemon.InitMetrics() util.InitKlogMetrics() diff --git a/cmd/ovn_monitor/ovn_monitor.go b/cmd/ovn_monitor/ovn_monitor.go index 1682d7b34f6..68b32ed5f2c 100644 --- a/cmd/ovn_monitor/ovn_monitor.go +++ b/cmd/ovn_monitor/ovn_monitor.go @@ -19,7 +19,7 @@ import ( func CmdMain() { defer klog.Flush() - klog.Infof(versions.String()) + klog.Info(versions.String()) config, err := ovn.ParseFlags() if err != nil { util.LogFatalAndExit(err, "failed to parse config") diff --git a/cmd/pinger/pinger.go b/cmd/pinger/pinger.go index bd8ef68d998..ff1ee11f6a0 100644 --- a/cmd/pinger/pinger.go +++ b/cmd/pinger/pinger.go @@ -17,7 +17,7 @@ import ( func CmdMain() { defer klog.Flush() - klog.Infof(versions.String()) + klog.Info(versions.String()) pinger.InitPingerMetrics() util.InitKlogMetrics() config, err := pinger.ParseFlags() diff --git a/cmd/speaker/speaker.go b/cmd/speaker/speaker.go index d61cb9e5f31..0348ac7d11f 100644 --- a/cmd/speaker/speaker.go +++ b/cmd/speaker/speaker.go @@ -17,7 +17,7 @@ import ( func CmdMain() { defer klog.Flush() - klog.Infof(versions.String()) + klog.Info(versions.String()) config, err := speaker.ParseFlags() if err != nil { util.LogFatalAndExit(err, "failed to parse config") diff --git a/cmd/webhook/server.go b/cmd/webhook/server.go index b20cb9ff6ad..b8babf305bc 100644 --- a/cmd/webhook/server.go +++ b/cmd/webhook/server.go @@ -37,7 +37,7 @@ func init() { func main() { var port int - klog.Infof(versions.String()) + klog.Info(versions.String()) port = *pflag.Int("port", 8443, "The port webhook listen on.") diff --git a/dist/images/Dockerfile b/dist/images/Dockerfile index 6a1d3bdc66a..8b7c46e38d9 100644 --- a/dist/images/Dockerfile +++ b/dist/images/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:experimental -FROM kubeovn/kube-ovn-base:v1.9.36 +FROM kubeovn/kube-ovn-base:v1.9.38 ARG ARCH ENV DUMB_INIT_VERSION="1.2.5" diff --git a/dist/images/Dockerfile.base b/dist/images/Dockerfile.base index 6798db14584..73ccd3e3a36 100644 --- a/dist/images/Dockerfile.base +++ b/dist/images/Dockerfile.base @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:experimental -ARG GO_VERSION=1.22.8 +ARG GO_VERSION=1.22.10 FROM ubuntu:22.04 AS ovs-builder @@ -84,8 +84,8 @@ RUN mkdir /packages/ && \ FROM ghcr.io/aquasecurity/trivy:latest AS trivy ARG ARCH -ENV CNI_VERSION="v1.5.1" -ENV KUBE_VERSION="v1.30.5" +ENV CNI_VERSION="v1.6.2" +ENV KUBE_VERSION="v1.30.8" ENV TRIVY_DB_REPOSITORY="public.ecr.aws/aquasecurity/trivy-db:2" RUN apk --no-cache add curl jq diff --git a/dist/images/Dockerfile.debug b/dist/images/Dockerfile.debug index a774bd86eda..37fc35a26c8 100644 --- a/dist/images/Dockerfile.debug +++ b/dist/images/Dockerfile.debug @@ -102,10 +102,10 @@ RUN mkdir -p /var/run/openvswitch && \ mkdir -p /opt/cni/bin ARG ARCH -ENV CNI_VERSION=v1.5.1 +ENV CNI_VERSION=v1.6.2 RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap ./macvlan -ENV KUBE_VERSION="v1.30.2" +ENV KUBE_VERSION="v1.30.8" RUN curl -L https://dl.k8s.io/${KUBE_VERSION}/kubernetes-client-linux-${ARCH}.tar.gz | tar -xz -C . && cp ./kubernetes/client/bin/kubectl /usr/bin/kubectl \ && chmod +x /usr/bin/kubectl && rm -rf ./kubernetes diff --git a/dist/images/go-deps/download-go-deps.sh b/dist/images/go-deps/download-go-deps.sh index 9ea9549c971..d798a9e1f93 100644 --- a/dist/images/go-deps/download-go-deps.sh +++ b/dist/images/go-deps/download-go-deps.sh @@ -3,8 +3,8 @@ set -e ARCH=${ARCH:-amd64} -CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-v1.5.1} -KUBECTL_VERSION=${KUBECTL_VERSION:-v1.30.5} +CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-v1.6.2} +KUBECTL_VERSION=${KUBECTL_VERSION:-v1.30.8} DEPS_DIR=/godeps diff --git a/go.mod b/go.mod index 6382dc52be7..24a12a05cbd 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubeovn/kube-ovn -go 1.22.8 +go 1.22.10 require ( github.com/Mellanox/sriovnet v1.0.3 @@ -31,7 +31,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 github.com/vishvananda/netlink v1.2.1-beta.2 - golang.org/x/sys v0.25.0 + golang.org/x/sys v0.29.0 google.golang.org/grpc v1.56.3 gopkg.in/k8snetworkplumbingwg/multus-cni.v3 v3.7.2 k8s.io/api v0.23.17 @@ -117,12 +117,12 @@ require ( github.com/spf13/viper v1.8.1 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/vishvananda/netns v0.0.4 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect - golang.org/x/time v0.6.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/time v0.9.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/protobuf v1.34.1 // indirect diff --git a/go.sum b/go.sum index dc12ac4087b..494b4babdeb 100644 --- a/go.sum +++ b/go.sum @@ -1336,8 +1336,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1354,8 +1354,8 @@ golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1368,8 +1368,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170802141912-e312636bdaa2/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1489,15 +1489,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170730040918-3bd178b88a81/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1511,8 +1511,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1520,8 +1520,8 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/controller/namespace.go b/pkg/controller/namespace.go index ed0225a8e6c..1388f4e1570 100644 --- a/pkg/controller/namespace.go +++ b/pkg/controller/namespace.go @@ -177,7 +177,7 @@ func (c *Controller) handleAddNamespace(key string) error { } op := "replace" - if namespace.Annotations == nil || len(namespace.Annotations) == 0 { + if len(namespace.Annotations) == 0 { op = "add" namespace.Annotations = map[string]string{} } else { diff --git a/pkg/daemon/ovs.go b/pkg/daemon/ovs.go index 1d4f9c1dc28..78225f8eb72 100644 --- a/pkg/daemon/ovs.go +++ b/pkg/daemon/ovs.go @@ -374,7 +374,7 @@ func configureNodeNic(portName, ip, gw, joinCIDR string, macAddr net.HardwareAdd fmt.Sprintf("external_ids:ip=%s", ipStr)) if err != nil { klog.Errorf("failed to configure node nic %s: %v, %q", portName, err, raw) - return fmt.Errorf(raw) + return errors.New(raw) } if err = configureNic(util.NodeNic, ip, macAddr, mtu, false, false); err != nil { @@ -484,7 +484,7 @@ func configureGlobalMirror(portName string, mtu int) error { "add", "bridge", "br-int", "mirrors", "@m") if err != nil { klog.Errorf("failed to configure mirror nic %s %q", portName, raw) - return fmt.Errorf(raw) + return errors.New(raw) } return configureMirrorLink(portName, mtu) } @@ -498,7 +498,7 @@ func configureEmptyMirror(portName string, mtu int) error { "add", "bridge", "br-int", "mirrors", "@m") if err != nil { klog.Errorf("failed to configure mirror nic %s %q", portName, raw) - return fmt.Errorf(raw) + return errors.New(raw) } return configureMirrorLink(portName, mtu) } diff --git a/pkg/daemon/server.go b/pkg/daemon/server.go index c5417d9914b..801e72f6399 100644 --- a/pkg/daemon/server.go +++ b/pkg/daemon/server.go @@ -64,7 +64,7 @@ func createHandler(csh *cniServerHandler) http.Handler { func requestAndResponseLogger(request *restful.Request, response *restful.Response, chain *restful.FilterChain, ) { - klog.Infof(formatRequestLog(request)) + klog.Info(formatRequestLog(request)) start := time.Now() chain.ProcessFilter(request, response) elapsed := float64((time.Since(start)) / time.Millisecond) @@ -72,7 +72,7 @@ func requestAndResponseLogger(request *restful.Request, response *restful.Respon nodeName, getRequestURI(request), fmt.Sprintf("%d", response.StatusCode())).Observe(elapsed / 1000) - klog.Infof(formatResponseLog(response, request, elapsed)) + klog.Info(formatResponseLog(response, request, elapsed)) } // formatRequestLog formats request log string. diff --git a/pkg/ovs/ovs-vsctl.go b/pkg/ovs/ovs-vsctl.go index e80279c1853..f49dfe102e2 100644 --- a/pkg/ovs/ovs-vsctl.go +++ b/pkg/ovs/ovs-vsctl.go @@ -327,7 +327,7 @@ func ConfigInterfaceMirror(globalMirror bool, open, iface string) error { return err } if len(portUUIDs) != 1 { - return fmt.Errorf(fmt.Sprintf("find port failed, portName=%s", ifName)) + return fmt.Errorf("find port failed, portName=%s", ifName) } portId := portUUIDs[0] if open == "true" { diff --git a/pkg/util/network_attachment.go b/pkg/util/network_attachment.go index dc62c53e6da..d868d4d64e7 100644 --- a/pkg/util/network_attachment.go +++ b/pkg/util/network_attachment.go @@ -47,12 +47,12 @@ func parsePodNetworkObjectName(podnetwork string) (string, string, string, error // nolint:staticcheck matched, _ := regexp.MatchString("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", allItems[i]) if !matched && len([]rune(allItems[i])) > 0 { - klog.Errorf(fmt.Sprintf("parsePodNetworkObjectName: Failed to parse: "+ + klog.Errorf("parsePodNetworkObjectName: Failed to parse: "+ "one or more items did not match comma-delimited format (must consist of lower case alphanumeric characters). "+ - "Must start and end with an alphanumeric character), mismatch @ '%v'", allItems[i])) - return "", "", "", fmt.Errorf(fmt.Sprintf("parsePodNetworkObjectName: Failed to parse: "+ + "Must start and end with an alphanumeric character), mismatch @ '%v'", allItems[i]) + return "", "", "", fmt.Errorf("parsePodNetworkObjectName: Failed to parse: "+ "one or more items did not match comma-delimited format (must consist of lower case alphanumeric characters). "+ - "Must start and end with an alphanumeric character), mismatch @ '%v'", allItems[i])) + "Must start and end with an alphanumeric character), mismatch @ '%v'", allItems[i]) } }