From 3d9bb21f75392ed569bfb97467fa9e7adc83452f Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Wed, 4 Mar 2020 06:51:11 +0100 Subject: [PATCH] user: keep existing HOME env Signed-off-by: Yoan Blanc --- pkg/commands/user.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/commands/user.go b/pkg/commands/user.go index 2b8581af9..d4b55c1bf 100644 --- a/pkg/commands/user.go +++ b/pkg/commands/user.go @@ -20,7 +20,6 @@ import ( "fmt" "strings" - "github.com/GoogleContainerTools/kaniko/pkg/constants" "github.com/GoogleContainerTools/kaniko/pkg/dockerfile" "github.com/GoogleContainerTools/kaniko/pkg/util" v1 "github.com/google/go-containerregistry/pkg/v1" @@ -59,16 +58,6 @@ func (r *UserCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bu config.User = userStr - // Remove any HOME environment variable previously set. - env := make([]string, 0, len(config.Env)) - for _, v := range config.Env { - if strings.HasPrefix(v, constants.HOME+"=") { - continue - } - env = append(env, v) - } - config.Env = env - return nil }