From 58cc7e7d43afde31959b8d3525252c17f4be261d Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 19 May 2022 21:53:50 +0530 Subject: [PATCH] Parse ENV vars to crictl command --- cmd/kubeadm/app/util/runtime/runtime.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/util/runtime/runtime.go b/cmd/kubeadm/app/util/runtime/runtime.go index b1a13496d04..e76f4836cb9 100644 --- a/cmd/kubeadm/app/util/runtime/runtime.go +++ b/cmd/kubeadm/app/util/runtime/runtime.go @@ -17,6 +17,7 @@ limitations under the License. package runtime import ( + "os" "strings" "github.com/pkg/errors" @@ -68,7 +69,9 @@ func (runtime *CRIRuntime) Socket() string { // crictl creates a crictl command for the provided args. func (runtime *CRIRuntime) crictl(args ...string) utilsexec.Cmd { - return runtime.exec.Command(runtime.crictlPath, append([]string{"-r", runtime.Socket()}, args...)...) + cmd := runtime.exec.Command(runtime.crictlPath, append([]string{"-r", runtime.Socket()}, args...)...) + cmd.SetEnv(os.Environ()) + return cmd } // IsRunning checks if runtime is running