From 81232378f0cd8526ad645bbf58e5bba435d32a34 Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Mon, 30 Apr 2018 17:06:09 -0700 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20delete=20cluster=20if=20failed?= =?UTF-8?q?=20deployment=20(#2817)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * don’t delete cluster if failed deployment * CLEANUP_IF_FAIL --- test/e2e/config/config.go | 1 + test/e2e/runner.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/config/config.go b/test/e2e/config/config.go index 9de442f13c..babc18d646 100644 --- a/test/e2e/config/config.go +++ b/test/e2e/config/config.go @@ -25,6 +25,7 @@ type Config struct { Regions []string `envconfig:"REGIONS"` // A whitelist of availableregions ClusterDefinition string `envconfig:"CLUSTER_DEFINITION" required:"true" default:"examples/kubernetes.json"` // ClusterDefinition is the path on disk to the json template these are normally located in examples/ CleanUpOnExit bool `envconfig:"CLEANUP_ON_EXIT" default:"true"` // if set the tests will not clean up rgs when tests finish + CleanUpIfFail bool `envconfig:"CLEANUP_IF_FAIL" default:"true"` RetainSSH bool `envconfig:"RETAIN_SSH" default:"true"` Timeout time.Duration `envconfig:"TIMEOUT" default:"10m"` CurrentWorkingDir string diff --git a/test/e2e/runner.go b/test/e2e/runner.go index 1a76bfc9e1..8c4bad9f09 100644 --- a/test/e2e/runner.go +++ b/test/e2e/runner.go @@ -114,7 +114,9 @@ func main() { rgs = cliProvisioner.ResourceGroups eng = cliProvisioner.Engine if err != nil { - teardown() + if cfg.CleanUpIfFail { + teardown() + } log.Fatalf("Error while trying to provision cluster:%s", err) } if cfg.SoakClusterName != "" {