diff --git a/cli/commands.go b/cli/commands.go index 3290af51..b341b856 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -198,7 +198,12 @@ func CreateCluster(c *cli.Context) error { c.Int("port-auto-offset"), ) if err != nil { - return fmt.Errorf("ERROR: failed to create worker node for cluster %s\n%+v", c.String("name"), err) + log.Printf("ERROR: failed to create worker node for cluster %s\n%+v", c.String("name"), err) + delErr := DeleteCluster(c) + if delErr != nil { + return delErr + } + os.Exit(1) } log.Printf("Created worker with ID %s\n", workerID) }