From 4cafc83e397133085fd3d0e55f30779b19281c29 Mon Sep 17 00:00:00 2001 From: Adrian Pedriza Date: Mon, 21 Oct 2024 09:31:04 +0200 Subject: [PATCH] Fix env variables propagation to k0s service Systemd script was reading the environment variables in the wrong way, so the environment variables were not propagated to the k0s service. Signed-off-by: Adrian Pedriza --- pkg/install/linux_systemd.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/install/linux_systemd.go b/pkg/install/linux_systemd.go index b546e104cac8..635946a7553a 100644 --- a/pkg/install/linux_systemd.go +++ b/pkg/install/linux_systemd.go @@ -29,7 +29,8 @@ ConditionFileIsExecutable={{.Path|cmdEscape}} StartLimitInterval=5 StartLimitBurst=10 ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmdEscape}}{{end}} -Environment="{{- range $key, $value := .EnvVars}}{{$key}}={{$value}} {{- end}}" +{{- if .Option.Environment}}{{range .Option.Environment}} +Environment="{{.}}"{{end}}{{- end}} RestartSec=10 Delegate=yes