Skip to content

Commit

Permalink
Merge pull request kubernetes#101885 from nilo19/automated-cherry-pic…
Browse files Browse the repository at this point in the history
…k-of-#101739-upstream-release-1.21

Cherry pick of kubernetes#101739: fix: avoid nil-pointer panic when checking the frontend IP configuration
  • Loading branch information
k8s-ci-robot authored Jun 8, 2021
2 parents 2601f42 + 9db073c commit 8281d2a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,13 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv
klog.Warningf("serviceOwnsFrontendIP: unexpected error when finding match public IP of the service %s with loadBalancerLP %s: %v", service.Name, loadBalancerIP, err)
return false, isPrimaryService, nil
}

if pip != nil && pip.ID != nil && pip.PublicIPAddressPropertiesFormat != nil && pip.IPAddress != nil {
if strings.EqualFold(*pip.ID, *fip.PublicIPAddress.ID) {
if pip != nil &&
pip.ID != nil &&
pip.PublicIPAddressPropertiesFormat != nil &&
pip.IPAddress != nil &&
fip.FrontendIPConfigurationPropertiesFormat != nil &&
fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil {
if strings.EqualFold(to.String(pip.ID), to.String(fip.PublicIPAddress.ID)) {
klog.V(4).Infof("serviceOwnsFrontendIP: found secondary service %s of the frontend IP config %s", service.Name, *fip.Name)

return true, isPrimaryService, nil
Expand Down

0 comments on commit 8281d2a

Please sign in to comment.