Merge pull request #50050 from nicksardo/gce-fix-strs

Automatic merge from submit-queue (batch tested with PRs 49916, 50050)

GCE: Fix bug by correctly cast port to string

Code is incorrectly casting a port to a string, causing the diff-expression to always return true. 

**What this PR does / why we need it**:
Fixes #50049

**Special notes for your reviewer**:
/assign @MrHohn 

**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-08-02 23:29:53 -07:00 committed by GitHub
commit 7bc1c67685

View File

@ -789,7 +789,7 @@ func (gce *GCECloud) ensureHttpHealthCheckFirewall(serviceName, ipAddress, regio
if fw.Description != desc ||
len(fw.Allowed) != 1 ||
fw.Allowed[0].IPProtocol != string(ports[0].Protocol) ||
!equalStringSets(fw.Allowed[0].Ports, []string{string(ports[0].Port)}) ||
!equalStringSets(fw.Allowed[0].Ports, []string{strconv.Itoa(int(ports[0].Port))}) ||
!equalStringSets(fw.SourceRanges, sourceRanges.StringSlice()) {
glog.Warningf("Firewall %v exists but parameters have drifted - updating...", fwName)
if err := gce.updateFirewall(fwName, region, desc, sourceRanges, ports, hosts); err != nil {