@@ -133,7 +133,7 @@ func (nsc *NetworkServicesController) setupClusterIPServices(serviceInfoMap serv
133133 if err != nil {
134134 return fmt .Errorf ("failed creating dummy interface: %v" , err )
135135 }
136- sPort , err := safecast .ToUint16 (svc .port )
136+ sPort , err := safecast.Convert [ uint16 ] (svc .port )
137137 if err != nil {
138138 return fmt .Errorf ("failed to convert service port to uint16: %v" , err )
139139 }
@@ -242,7 +242,7 @@ func (nsc *NetworkServicesController) addEndpointsToIPVSService(endpoints []endp
242242 syscallINET = syscall .AF_INET6
243243 }
244244
245- ePort , err := safecast .ToUint16 (endpoint .port )
245+ ePort , err := safecast.Convert [ uint16 ] (endpoint .port )
246246 if err != nil {
247247 klog .Errorf ("failed to convert endpoint port to uint16: %v" , err )
248248 continue
@@ -289,7 +289,7 @@ func (nsc *NetworkServicesController) setupNodePortServices(serviceInfoMap servi
289289 continue
290290 }
291291
292- nPort , err := safecast .ToUint16 (svc .nodePort )
292+ nPort , err := safecast.Convert [ uint16 ] (svc .nodePort )
293293 if err != nil {
294294 return fmt .Errorf ("failed to convert node port to uint16: %v" , err )
295295 }
@@ -451,7 +451,7 @@ func (nsc *NetworkServicesController) setupExternalIPForService(svc *serviceInfo
451451 return fmt .Errorf ("failed get list of IPVS services due to: %v" , err )
452452 }
453453
454- sPort , err := safecast .ToUint16 (svc .port )
454+ sPort , err := safecast.Convert [ uint16 ] (svc .port )
455455 if err != nil {
456456 return fmt .Errorf ("failed to convert service port to uint16: %v" , err )
457457 }
@@ -549,7 +549,7 @@ func (nsc *NetworkServicesController) setupExternalIPForDSRService(svcIn *servic
549549 return fmt .Errorf ("failed to generate FW mark" )
550550 }
551551
552- sInPort , err := safecast .ToUint16 (svcIn .port )
552+ sInPort , err := safecast.Convert [ uint16 ] (svcIn .port )
553553 if err != nil {
554554 return fmt .Errorf ("failed to convert serviceIn port to uint16: %v" , err )
555555 }
@@ -614,7 +614,7 @@ func (nsc *NetworkServicesController) setupExternalIPForDSRService(svcIn *servic
614614 syscallINET = syscall .AF_INET6
615615 }
616616
617- ePort , err := safecast .ToUint16 (endpoint .port )
617+ ePort , err := safecast.Convert [ uint16 ] (endpoint .port )
618618 if err != nil {
619619 return fmt .Errorf ("failed to convert endpoint port to uint16: %v" , err )
620620 }
0 commit comments