Merge pull request #48284 from nicksardo/ingress-ignore-delete-err

Automatic merge from submit-queue (batch tested with PRs 47850, 47835, 46197, 47250, 48284)

Do not fail on error when deleting ingress

Fixes #48239

If the api server or master is unavailable, the test should manually teardown load balancer resources. 

**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-06-29 15:16:47 -07:00 committed by GitHub
commit dc2b4e790d
3 changed files with 9 additions and 6 deletions

View File

@ -882,9 +882,12 @@ func (j *IngressTestJig) GetRootCA(secretName string) (rootCA []byte) {
return return
} }
// DeleteIngress deletes the ingress resource // TryDeleteIngress attempts to delete the ingress resource and logs errors if they occur.
func (j *IngressTestJig) DeleteIngress() { func (j *IngressTestJig) TryDeleteIngress() {
ExpectNoError(j.Client.Extensions().Ingresses(j.Ingress.Namespace).Delete(j.Ingress.Name, nil)) err := j.Client.Extensions().Ingresses(j.Ingress.Namespace).Delete(j.Ingress.Name, nil)
if err != nil {
Logf("Error while deleting the ingress %v/%v: %v", j.Ingress.Namespace, j.Ingress.Name, err)
}
} }
// WaitForIngress waits till the ingress acquires an IP, then waits for its // WaitForIngress waits till the ingress acquires an IP, then waits for its

View File

@ -89,7 +89,7 @@ var _ = framework.KubeDescribe("Loadbalancing: L7", func() {
return return
} }
By("Deleting ingress") By("Deleting ingress")
jig.DeleteIngress() jig.TryDeleteIngress()
By("Cleaning up cloud resources") By("Cleaning up cloud resources")
framework.CleanupGCEIngressController(gceController) framework.CleanupGCEIngressController(gceController)
@ -179,7 +179,7 @@ var _ = framework.KubeDescribe("Loadbalancing: L7", func() {
return return
} }
By("Deleting ingress") By("Deleting ingress")
jig.DeleteIngress() jig.TryDeleteIngress()
}) })
It("should conform to Ingress spec", func() { It("should conform to Ingress spec", func() {

View File

@ -101,7 +101,7 @@ func (t *IngressUpgradeTest) Teardown(f *framework.Framework) {
} }
if t.jig.Ingress != nil { if t.jig.Ingress != nil {
By("Deleting ingress") By("Deleting ingress")
t.jig.DeleteIngress() t.jig.TryDeleteIngress()
} else { } else {
By("No ingress created, no cleanup necessary") By("No ingress created, no cleanup necessary")
} }