Skip to content

Commit

Permalink
Merge pull request kubernetes#94991 from nilo19/feature/support-share…
Browse files Browse the repository at this point in the history
…d-pip

Azure: Support multiple services sharing one IP address
  • Loading branch information
k8s-ci-robot authored Oct 3, 2020
2 parents b2730aa + 5b3e6ab commit 24cfb41
Show file tree
Hide file tree
Showing 6 changed files with 1,248 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (

// operationCanceledErrorMessage means the operation is canceled by another new operation.
operationCanceledErrorMessage = "canceledandsupersededduetoanotheroperation"

cannotDeletePublicIPErrorMessageCode = "PublicIPAddressCannotBeDeleted"
)

// RequestBackoff if backoff is disabled in cloud provider it
Expand Down Expand Up @@ -275,6 +277,11 @@ func (az *Cloud) DeletePublicIP(service *v1.Service, pipResourceGroup string, pi
if rerr != nil {
klog.Errorf("PublicIPAddressesClient.Delete(%s) failed: %s", pipName, rerr.Error().Error())
az.Event(service, v1.EventTypeWarning, "DeletePublicIPAddress", rerr.Error().Error())

if strings.Contains(rerr.Error().Error(), cannotDeletePublicIPErrorMessageCode) {
klog.Warningf("DeletePublicIP for public IP %s failed with error %v, this is because other resources are referencing the public IP. The deletion of the service will continue.", pipName, rerr.Error())
return nil
}
return rerr.Error()
}

Expand Down
Loading

0 comments on commit 24cfb41

Please sign in to comment.