Merge pull request #56688 from karataliu/fix_azure_internallb_static

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix static IP issue for Azure internal LB

**What this PR does / why we need it**:
Fix regression for Azure internal LB with static IP support

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56686

**Special notes for your reviewer**:

**Release note**:
```release-note

```
pull/6/head
Kubernetes Submit Queue 2017-12-05 13:57:56 -08:00 committed by GitHub
commit 86ff044d84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1134,9 +1134,13 @@ func deduplicate(collection *[]string) *[]string {
func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, wantLb bool) (*network.PublicIPAddress, error) {
isInternal := requiresInternalLoadBalancer(service)
serviceName := getServiceName(service)
desiredPipName, err := az.determinePublicIPName(clusterName, service)
if err != nil {
return nil, err
var desiredPipName string
var err error
if !isInternal && wantLb {
desiredPipName, err = az.determinePublicIPName(clusterName, service)
if err != nil {
return nil, err
}
}
pips, err := az.ListPIPWithRetry()