From 787d6608bad44046516b900c075ebb1bdea62df1 Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Fri, 10 May 2019 12:55:33 +0530 Subject: [PATCH] Delete a cluster if it is not started due to port conflicts or any other unforseen error Signed-off-by: Rishabh Gupta --- cli/commands.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/commands.go b/cli/commands.go index 4dcf5a4c..230a3e71 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -113,7 +113,12 @@ func CreateCluster(c *cli.Context) error { publishedPorts, ) if err != nil { - log.Fatalf("ERROR: failed to create cluster\n%+v", err) + log.Printf("ERROR: failed to create cluster\n%+v", err) + delErr := DeleteCluster(c) + if delErr != nil { + return delErr + } + os.Exit(1) } ctx := context.Background()