mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 09:45:09 +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:
@@ -19,6 +19,7 @@ package util
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -54,6 +55,12 @@ func SyscallCredentials(userStr string) (*syscall.Credential, error) {
|
||||
groups = append(groups, uint32(i))
|
||||
}
|
||||
|
||||
if !(len(strings.Split(userStr, ":")) > 1) {
|
||||
if u.Gid != "" {
|
||||
gid, _ = getGID(u.Gid)
|
||||
}
|
||||
}
|
||||
|
||||
return &syscall.Credential{
|
||||
Uid: uid,
|
||||
Gid: gid,
|
||||
|
||||
Reference in New Issue
Block a user