@@ -151,7 +151,7 @@ func validateSubnets(subnets Subnets, fldPath *field.Path) field.ErrorList {
151151 }
152152 }
153153 for k , v := range requiredSubnetRoles {
154- if v == false {
154+ if ! v {
155155 allErrs = append (allErrs , field .Required (fldPath ,
156156 fmt .Sprintf ("required role %s not included in provided subnets" , k )))
157157 }
@@ -197,8 +197,7 @@ func validateInternalLBIPAddress(address string, cidrs []string, fldPath *field.
197197// validateIngressRule validates an IngressRule
198198func validateIngressRule (ingressRule * IngressRule , fldPath * field.Path ) * field.Error {
199199 if ingressRule .Priority < 100 || ingressRule .Priority > 4096 {
200- return field .Invalid (fldPath , ingressRule .Priority ,
201- fmt .Sprintf ("ingress priorities should be between 100 and 4096" ))
200+ return field .Invalid (fldPath , ingressRule .Priority , "ingress priorities should be between 100 and 4096" )
202201 }
203202
204203 return nil
@@ -234,13 +233,13 @@ func validateAPIServerLB(lb LoadBalancerSpec, old LoadBalancerSpec, cidrs []stri
234233 // There should only be one IP config.
235234 if len (lb .FrontendIPs ) != 1 {
236235 allErrs = append (allErrs , field .Invalid (fldPath .Child ("frontendIPConfigs" ), lb .FrontendIPs ,
237- fmt . Sprintf ( "API Server Load balancer should have 1 Frontend IP configuration" ) ))
236+ "API Server Load balancer should have 1 Frontend IP configuration" ))
238237 } else {
239238 // if Internal, IP config should not have a public IP.
240239 if lb .Type == Internal {
241240 if lb .FrontendIPs [0 ].PublicIP != nil {
242241 allErrs = append (allErrs , field .Forbidden (fldPath .Child ("frontendIPConfigs" ).Index (0 ).Child ("publicIP" ),
243- fmt . Sprintf ( "Internal Load Balancers cannot have a Public IP" ) ))
242+ "Internal Load Balancers cannot have a Public IP" ))
244243 }
245244 if lb .FrontendIPs [0 ].PrivateIPAddress != "" {
246245 if err := validateInternalLBIPAddress (lb .FrontendIPs [0 ].PrivateIPAddress , cidrs ,
@@ -257,7 +256,7 @@ func validateAPIServerLB(lb LoadBalancerSpec, old LoadBalancerSpec, cidrs []stri
257256 if lb .Type == Public {
258257 if lb .FrontendIPs [0 ].PrivateIPAddress != "" {
259258 allErrs = append (allErrs , field .Forbidden (fldPath .Child ("frontendIPConfigs" ).Index (0 ).Child ("privateIP" ),
260- fmt . Sprintf ( "Public Load Balancers cannot have a Private IP" ) ))
259+ "Public Load Balancers cannot have a Private IP" ))
261260 }
262261 }
263262 }
0 commit comments