user: keep existing HOME env

Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
Yoan Blanc 2020-03-04 06:51:11 +01:00 committed by Tejal Desai
parent 55361b2998
commit 3d9bb21f75
1 changed files with 0 additions and 11 deletions

View File

@ -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
}