diff --git a/pkg/util/command_util.go b/pkg/util/command_util.go index 9b896c8adf..8c4af2272c 100644 --- a/pkg/util/command_util.go +++ b/pkg/util/command_util.go @@ -355,7 +355,7 @@ Loop: func GetUserGroup(chownStr string, env []string) (int64, int64, error) { if chownStr == "" { - return 0, 0, nil + return DoNotChangeUID, DoNotChangeGID, nil } chown, err := ResolveEnvironmentReplacement(chownStr, env, false) diff --git a/pkg/util/command_util_test.go b/pkg/util/command_util_test.go index a6d9ea7a7c..180bff4c43 100644 --- a/pkg/util/command_util_test.go +++ b/pkg/util/command_util_test.go @@ -571,8 +571,8 @@ func TestGetUserGroup(t *testing.T) { mockIDGetter: func(string, string) (uint32, uint32, error) { return 0, 0, fmt.Errorf("should not be called") }, - expectedU: 0, - expectedG: 0, + expectedU: -1, + expectedG: -1, }, } for _, tc := range tests {