From 224e9a03f54321527e22a5ebd96a87d8fe8023c7 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 20 May 2024 14:15:39 +0000 Subject: [PATCH] Revert "Set default UserId and GroupId to 0:0" This reverts commit 9f83bc8595cde0965de0b5a17e6770e5c2b1321f. --- pkg/util/command_util.go | 2 +- pkg/util/command_util_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 {