Skip to content

Commit

Permalink
perform nil check on old lb
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Jan 17, 2025
1 parent 8b8ba05 commit 440b0c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/v1beta1/azurecluster_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func validateAPIServerLB(lb *LoadBalancerSpec, old *LoadBalancerSpec, cidrs []st
allErrs = append(allErrs, err)
}

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

0 comments on commit 440b0c1

Please sign in to comment.