From f2cedfd6cdba3b0ce0cfb5e2940aaa4a465c54b2 Mon Sep 17 00:00:00 2001 From: Lars Mogren Date: Tue, 28 May 2019 22:05:54 +0200 Subject: [PATCH] Now passes the environment variables to the workers. --- cli/commands.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/commands.go b/cli/commands.go index 51604767..f597844f 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -95,9 +95,8 @@ func CreateCluster(c *cli.Context) error { // environment variables env := []string{"K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml"} - if c.IsSet("env") || c.IsSet("e") { - env = append(env, c.StringSlice("env")...) - } + env = append(env, c.StringSlice("env")...) + k3sClusterSecret := "" if c.Int("workers") > 0 { k3sClusterSecret = fmt.Sprintf("K3S_CLUSTER_SECRET=%s", GenerateRandomString(20)) @@ -186,6 +185,7 @@ func CreateCluster(c *cli.Context) error { if c.Int("workers") > 0 { k3sWorkerArgs := []string{} env := []string{k3sClusterSecret} + env = append(env, c.StringSlice("env")...) log.Printf("Booting %s workers for cluster %s", strconv.Itoa(c.Int("workers")), c.String("name")) for i := 0; i < c.Int("workers"); i++ { workerID, err := createWorker(