Skip to content

Commit

Permalink
k3s: avoid over-quoting install envvars (rancher#590)
Browse files Browse the repository at this point in the history
Fix K3S_URL, K3S_TOKEN, and K3S_CLUSTER_SECRET being passed to k3s
install.sh with extra quotes around the values. Rely on k3s install.sh
to correctly capture entries for `/etc/k3s/k3s-service.env`.

Fixes rancher#589
  • Loading branch information
dweomer authored Oct 2, 2020
1 parent 762a288 commit 896c419
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cc/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ func ApplyK3S(cfg *config.CloudConfig, restart, install bool) error {
args = append(args, "server")
}
} else {
vars = append(vars, fmt.Sprintf("K3S_URL=\"%s\"\n", cfg.K3OS.ServerURL))
vars = append(vars, fmt.Sprintf("K3S_URL=%s", cfg.K3OS.ServerURL))
if len(args) == 0 {
args = append(args, "agent")
}
}

if strings.HasPrefix(cfg.K3OS.Token, "K10") {
vars = append(vars, fmt.Sprintf("K3S_TOKEN=\"%s\"\n", cfg.K3OS.Token))
vars = append(vars, fmt.Sprintf("K3S_TOKEN=%s", cfg.K3OS.Token))
} else if cfg.K3OS.Token != "" {
vars = append(vars, fmt.Sprintf("K3S_CLUSTER_SECRET=\"%s\"\n", cfg.K3OS.Token))
vars = append(vars, fmt.Sprintf("K3S_CLUSTER_SECRET=%s", cfg.K3OS.Token))
}

var labels []string
Expand Down

0 comments on commit 896c419

Please sign in to comment.