Skip to content

Commit

Permalink
e2e: Add --ignore-not-found flag to delete calls
Browse files Browse the repository at this point in the history
Objects not being found are not necessarily a bad thing when deleting
several resources: e.g. when tearing down the operator, the CRDs get
deleted first, later on it might fail trying to delete an instance of a
custom resource.

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
  • Loading branch information
JAORMX committed Mar 3, 2021
1 parent 3464224 commit f7fc890
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (e *e2e) cleanupOperator(manifest string) {
// Clean up the operator
e.logf("Cleaning up operator")
e.kubectl("delete", "seccompprofiles", "--all", "--all-namespaces")
e.kubectl("delete", "-f", manifest)
e.kubectl("delete", "--ignore-not-found", "-f", manifest)
}

func (e *e2e) deployWebhook(manifest string) {
Expand Down Expand Up @@ -217,8 +217,8 @@ func (e *e2e) deployWebhook(manifest string) {

func (e *e2e) cleanupWebhook(manifest string) {
e.logf("Cleaning up webhook")
e.kubectl("delete", "-f", manifest)
e.kubectl("delete", "-f", certmanager)
e.kubectl("delete", "--ignore-not-found", "-f", manifest)
e.kubectl("delete", "--ignore-not-found", "-f", certmanager)
}

func (e *e2e) getWorkerNodes() []string {
Expand Down

0 comments on commit f7fc890

Please sign in to comment.