Skip to content

Commit 440b0c1

Browse files
committed
perform nil check on old lb
1 parent 8b8ba05 commit 440b0c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/v1beta1/azurecluster_validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ func validateAPIServerLB(lb *LoadBalancerSpec, old *LoadBalancerSpec, cidrs []st
458458
allErrs = append(allErrs, err)
459459
}
460460

461-
if len(old.FrontendIPs) != 0 && old.FrontendIPs[0].PrivateIPAddress != lb.FrontendIPs[0].PrivateIPAddress {
461+
if old != nil && len(old.FrontendIPs) != 0 && old.FrontendIPs[0].PrivateIPAddress != lb.FrontendIPs[0].PrivateIPAddress {
462462
allErrs = append(allErrs, field.Forbidden(fldPath.Child("name"), "API Server load balancer private IP should not be modified after AzureCluster creation."))
463463
}
464464
}

0 commit comments

Comments
 (0)