From 938d87f7a86260c30519d2382145eaf328f5d395 Mon Sep 17 00:00:00 2001 From: Peng Liu Date: Wed, 22 Apr 2020 10:48:00 -0400 Subject: [PATCH 1/2] fix the cleanup logic which ignores the case where namespace is nil --- Makefile | 2 +- integration/cleanup.go | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 71c30acc9..cdaf09e4a 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ clean: integration-prod: cross go test -ldflags "$(GO_LDFLAGS)" -v -tags integration \ $(REPOPATH)/integration \ - -timeout 15m \ + -timeout 60m \ -gac-credentials=/tmp/gac.json \ -gcp-project=kritis-int-test \ -gke-cluster-name=test-cluster-2 $(EXTRA_TEST_FLAGS) diff --git a/integration/cleanup.go b/integration/cleanup.go index e7fe08267..0d24b692c 100644 --- a/integration/cleanup.go +++ b/integration/cleanup.go @@ -47,10 +47,16 @@ func deleteObject(object, name string, ns *v1.Namespace) error { deleteCmd := exec.Command("kubectl", "delete", object, name) if ns != nil { deleteCmd.Args = append(deleteCmd.Args, []string{"-n", ns.Name}...) - } - _, err := integration_util.RunCmdOut(deleteCmd) - if err != nil { - return fmt.Errorf("error deleting %s %s in namespace %s: %v", object, name, ns.Name, err) + + _, err := integration_util.RunCmdOut(deleteCmd) + if err != nil { + return fmt.Errorf("error deleting %s %s in namespace %s: %v", object, name, ns.Name, err) + } + } else { + _, err := integration_util.RunCmdOut(deleteCmd) + if err != nil { + return fmt.Errorf("error deleting %s %s: %v", object, name, err) + } } return nil } From 127dbfe6d4751ff76b54743b873f70a702e9c8d5 Mon Sep 17 00:00:00 2001 From: Peng Liu Date: Wed, 22 Apr 2020 13:30:05 -0400 Subject: [PATCH 2/2] fix the cleanup logic which ignores the case where namespace is nil --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cdaf09e4a..71c30acc9 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ clean: integration-prod: cross go test -ldflags "$(GO_LDFLAGS)" -v -tags integration \ $(REPOPATH)/integration \ - -timeout 60m \ + -timeout 15m \ -gac-credentials=/tmp/gac.json \ -gcp-project=kritis-int-test \ -gke-cluster-name=test-cluster-2 $(EXTRA_TEST_FLAGS)