Update e2e test utils with the new interfaces

This commit is contained in:
Bowei Du 2018-01-17 22:00:00 -08:00
parent 2556e01142
commit b682e1bc1e

View File

@ -458,10 +458,10 @@ func (cont *GCEIngressController) deleteURLMap(del bool) (msg string) {
} }
return fmt.Sprintf("Failed to list url maps: %v", err) return fmt.Sprintf("Failed to list url maps: %v", err)
} }
if len(umList.Items) == 0 { if len(umList) == 0 {
return msg return msg
} }
for _, um := range umList.Items { for _, um := range umList {
if !cont.canDelete(um.Name, um.CreationTimestamp, del) { if !cont.canDelete(um.Name, um.CreationTimestamp, del) {
continue continue
} }
@ -487,11 +487,11 @@ func (cont *GCEIngressController) deleteBackendService(del bool) (msg string) {
} }
return fmt.Sprintf("Failed to list backend services: %v", err) return fmt.Sprintf("Failed to list backend services: %v", err)
} }
if len(beList.Items) == 0 { if len(beList) == 0 {
Logf("No backend services found") Logf("No backend services found")
return msg return msg
} }
for _, be := range beList.Items { for _, be := range beList {
if !cont.canDelete(be.Name, be.CreationTimestamp, del) { if !cont.canDelete(be.Name, be.CreationTimestamp, del) {
continue continue
} }
@ -517,10 +517,10 @@ func (cont *GCEIngressController) deleteHTTPHealthCheck(del bool) (msg string) {
} }
return fmt.Sprintf("Failed to list HTTP health checks: %v", err) return fmt.Sprintf("Failed to list HTTP health checks: %v", err)
} }
if len(hcList.Items) == 0 { if len(hcList) == 0 {
return msg return msg
} }
for _, hc := range hcList.Items { for _, hc := range hcList {
if !cont.canDelete(hc.Name, hc.CreationTimestamp, del) { if !cont.canDelete(hc.Name, hc.CreationTimestamp, del) {
continue continue
} }
@ -546,8 +546,8 @@ func (cont *GCEIngressController) deleteSSLCertificate(del bool) (msg string) {
} }
return fmt.Sprintf("Failed to list ssl certificates: %v", err) return fmt.Sprintf("Failed to list ssl certificates: %v", err)
} }
if len(sslList.Items) != 0 { if len(sslList) != 0 {
for _, s := range sslList.Items { for _, s := range sslList {
if !cont.canDelete(s.Name, s.CreationTimestamp, del) { if !cont.canDelete(s.Name, s.CreationTimestamp, del) {
continue continue
} }
@ -576,10 +576,10 @@ func (cont *GCEIngressController) deleteInstanceGroup(del bool) (msg string) {
} }
return fmt.Sprintf("Failed to list instance groups: %v", err) return fmt.Sprintf("Failed to list instance groups: %v", err)
} }
if len(igList.Items) == 0 { if len(igList) == 0 {
return msg return msg
} }
for _, ig := range igList.Items { for _, ig := range igList {
if !cont.canDelete(ig.Name, ig.CreationTimestamp, del) { if !cont.canDelete(ig.Name, ig.CreationTimestamp, del) {
continue continue
} }
@ -745,7 +745,7 @@ func (cont *GCEIngressController) backendMode(nodeports []string, keyword string
} }
matchingBackendService := 0 matchingBackendService := 0
for _, bs := range beList.Items { for _, bs := range beList {
match := false match := false
for _, np := range nodeports { for _, np := range nodeports {
// Warning: This assumes backend service naming convention includes nodeport in the name // Warning: This assumes backend service naming convention includes nodeport in the name