Fix COPY with --chown command (#1477)
* Fix COPY with --chown command * fix linters
This commit is contained in:
parent
bdcdec7c93
commit
0c1a1a690a
|
|
@ -23,6 +23,7 @@ import (
|
|||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
reflect "reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
|
|
@ -370,6 +371,10 @@ func GetUIDAndGIDFromString(userGroupString string, fallbackToUID bool) (uint32,
|
|||
groupStr = userAndGroup[1]
|
||||
}
|
||||
|
||||
if reflect.TypeOf(userStr).String() == "int" {
|
||||
return 0, 0, nil
|
||||
}
|
||||
|
||||
uidStr, gidStr, err := GetUserFromUsername(userStr, groupStr, fallbackToUID)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
|
|
|
|||
Loading…
Reference in New Issue