From 6b2939884cd774fa70304a2a198e9c572242eda9 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 11 Oct 2021 09:11:32 -0700 Subject: Use SplitN(2) when copying env variables Environment variables whose value contained an equal sign where truncated Fixes #11891 Signed-off-by: Jhon Honce --- pkg/specgen/generate/kube/kube.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/specgen/generate') diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go index e93462008..6eebc6376 100644 --- a/pkg/specgen/generate/kube/kube.go +++ b/pkg/specgen/generate/kube/kube.go @@ -257,7 +257,7 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener // Environment Variables envs := map[string]string{} for _, env := range imageData.Config.Env { - keyval := strings.Split(env, "=") + keyval := strings.SplitN(env, "=", 2) envs[keyval[0]] = keyval[1] } -- cgit v1.2.3-54-g00ecf