@@ -29,7 +29,7 @@ func main() {
2929 Add : cmdAdd ,
3030 Del : cmdDel ,
3131 }
32- about := fmt . Sprintf ( "CNI kube-ovn plugin %s" , versions .VERSION )
32+ about := "CNI kube-ovn plugin " + versions .VERSION
3333 skel .PluginMainFuncs (funcs , version .All , about )
3434}
3535
@@ -111,7 +111,7 @@ func generateCNIResult(cniResponse *request.CniResponse, netns string) current.R
111111 var netMask * net.IPNet
112112 var gwStr string
113113 addRoutes := len (result .Routes ) == 0
114- for _ , cidrBlock := range strings .Split (cniResponse .CIDR , "," ) {
114+ for cidrBlock := range strings .SplitSeq (cniResponse .CIDR , "," ) {
115115 _ , netMask , _ = net .ParseCIDR (cidrBlock )
116116 gwStr = ""
117117 if util .CheckProtocol (cidrBlock ) == kubeovnv1 .ProtocolIPv4 {
@@ -227,16 +227,16 @@ func parseValueFromArgs(key, argString string) (string, error) {
227227 if argString == "" {
228228 return "" , types .NewError (types .ErrInvalidNetworkConfig , "Invalid Configuration" , "CNI_ARGS is required" )
229229 }
230- args := strings .Split (argString , ";" )
231- for _ , arg := range args {
232- if strings .HasPrefix (arg , fmt . Sprintf ( "%s=" , key ) ) {
233- value := strings .TrimPrefix (arg , fmt . Sprintf ( "%s=" , key ) )
230+ args := strings .SplitSeq (argString , ";" )
231+ for arg := range args {
232+ if strings .HasPrefix (arg , key + "=" ) {
233+ value := strings .TrimPrefix (arg , key + "=" )
234234 if len (value ) > 0 {
235235 return value , nil
236236 }
237237 }
238238 }
239- return "" , types .NewError (types .ErrInvalidNetworkConfig , "Invalid Configuration" , fmt . Sprintf ( "%s is required in CNI_ARGS", key ) )
239+ return "" , types .NewError (types .ErrInvalidNetworkConfig , "Invalid Configuration" , key + " is required in CNI_ARGS" )
240240}
241241
242242func assignV4Address (ipAddress , gateway string , mask * net.IPNet ) (* current.IPConfig , * types.Route ) {
0 commit comments