Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fail on error when deleting ingress #48284

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/e2e/framework/ingress_utils.go
Expand Up @@ -882,9 +882,12 @@ func (j *IngressTestJig) GetRootCA(secretName string) (rootCA []byte) {
return
}

// DeleteIngress deletes the ingress resource
func (j *IngressTestJig) DeleteIngress() {
ExpectNoError(j.Client.Extensions().Ingresses(j.Ingress.Namespace).Delete(j.Ingress.Name, nil))
// TryDeleteIngress attempts to delete the ingress resource and logs errors if they occur.
func (j *IngressTestJig) TryDeleteIngress() {
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
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ingress.go
Expand Up @@ -89,7 +89,7 @@ var _ = framework.KubeDescribe("Loadbalancing: L7", func() {
return
}
By("Deleting ingress")
jig.DeleteIngress()
jig.TryDeleteIngress()

By("Cleaning up cloud resources")
framework.CleanupGCEIngressController(gceController)
Expand Down Expand Up @@ -179,7 +179,7 @@ var _ = framework.KubeDescribe("Loadbalancing: L7", func() {
return
}
By("Deleting ingress")
jig.DeleteIngress()
jig.TryDeleteIngress()
})

It("should conform to Ingress spec", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/upgrades/ingress.go
Expand Up @@ -101,7 +101,7 @@ func (t *IngressUpgradeTest) Teardown(f *framework.Framework) {
}
if t.jig.Ingress != nil {
By("Deleting ingress")
t.jig.DeleteIngress()
t.jig.TryDeleteIngress()
} else {
By("No ingress created, no cleanup necessary")
}
Expand Down