Unverified Commit e0740b11 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #64808 from feiskyer/automated-cherry-pick-of-#64739-upstream-release-1.10

Automatic merge from submit-queue. Automated cherry pick of #64739: Fix panic while provisioning Azure security group rules Cherry pick of #64739 on release-1.10. #64739: Fix panic while provisioning Azure security group rules
parents cd32ec61 69c7cdc5
......@@ -889,8 +889,8 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service,
// update security rules
dirtySg := false
var updatedRules []network.SecurityRule
if sg.SecurityRules != nil {
updatedRules = *sg.SecurityRules
if sg.SecurityGroupPropertiesFormat != nil && sg.SecurityGroupPropertiesFormat.SecurityRules != nil {
updatedRules = *sg.SecurityGroupPropertiesFormat.SecurityRules
}
for _, r := range updatedRules {
......
......@@ -153,6 +153,10 @@ func (az *Cloud) getAzureLoadBalancer(name string) (lb network.LoadBalancer, exi
}
func (az *Cloud) getSecurityGroup() (nsg network.SecurityGroup, err error) {
if az.SecurityGroupName == "" {
return nsg, fmt.Errorf("securityGroupName is not configured")
}
securityGroup, err := az.nsgCache.Get(az.SecurityGroupName)
if err != nil {
return nsg, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment