Merge pull request #48003 from MrHohn/gce-xlb-cleanup

Automatic merge from submit-queue (batch tested with PRs 48139, 48042, 47645, 48054, 48003)

Pipe clusterID into gce_loadbalancer_external.go

**What this PR does / why we need it**: Small cleanup for GCE ELB codes.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2017-06-27 14:08:21 -07:00
committed by GitHub
6 changed files with 26 additions and 38 deletions

View File

@@ -1300,17 +1300,17 @@ func VerifyServeHostnameServiceDown(c clientset.Interface, host string, serviceI
return fmt.Errorf("waiting for service to be down timed out")
}
func CleanupServiceResources(loadBalancerName, zone string) {
func CleanupServiceResources(c clientset.Interface, loadBalancerName, zone string) {
if TestContext.Provider == "gce" || TestContext.Provider == "gke" {
CleanupServiceGCEResources(loadBalancerName, zone)
CleanupServiceGCEResources(c, loadBalancerName, zone)
}
// TODO: we need to add this function with other cloud providers, if there is a need.
}
func CleanupServiceGCEResources(loadBalancerName, zone string) {
func CleanupServiceGCEResources(c clientset.Interface, loadBalancerName, zone string) {
if pollErr := wait.Poll(5*time.Second, LoadBalancerCleanupTimeout, func() (bool, error) {
if err := CleanupGCEResources(loadBalancerName, zone); err != nil {
if err := CleanupGCEResources(c, loadBalancerName, zone); err != nil {
Logf("Still waiting for glbc to cleanup: %v", err)
return false, nil
}