mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-17 21:11:54 +02:00
Avoid returning the UID when resolving the GIDs. (#2689)
* Fix GetUIDAndGIDFromString test. * Avoid returning by default the UID when resolving the GIDs.
This commit is contained in:
@@ -705,7 +705,7 @@ func Test_GetUIDAndGIDFromString(t *testing.T) {
|
||||
},
|
||||
expected: expected{
|
||||
userID: 1001,
|
||||
groupID: uint32(currentUserGID),
|
||||
groupID: expectedCurrentUser.groupID,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -714,15 +714,13 @@ func Test_GetUIDAndGIDFromString(t *testing.T) {
|
||||
userGroupStr: fmt.Sprintf("%d:%s", 1001, "hello-world-group"),
|
||||
fallbackToUID: true,
|
||||
},
|
||||
expected: expected{
|
||||
userID: 1001,
|
||||
groupID: 1001,
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
testname: "uid and non existing group-name",
|
||||
testname: "uid and non existing group-name without fallbackToUID",
|
||||
args: args{
|
||||
userGroupStr: fmt.Sprintf("%d:%s", 1001, "hello-world-group"),
|
||||
userGroupStr: fmt.Sprintf("%d:%s", 1001, "hello-world-group"),
|
||||
fallbackToUID: false,
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
@@ -742,7 +740,10 @@ func Test_GetUIDAndGIDFromString(t *testing.T) {
|
||||
userGroupStr: fmt.Sprintf("%d", currentUserUID),
|
||||
fallbackToUID: false,
|
||||
},
|
||||
wantErr: true,
|
||||
expected: expected{
|
||||
userID: expectedCurrentUser.userID,
|
||||
groupID: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
testname: "only uid and fallback is true",
|
||||
|
||||
Reference in New Issue
Block a user