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"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
reflect "reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -370,6 +371,10 @@ func GetUIDAndGIDFromString(userGroupString string, fallbackToUID bool) (uint32,
|
||||||
groupStr = userAndGroup[1]
|
groupStr = userAndGroup[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if reflect.TypeOf(userStr).String() == "int" {
|
||||||
|
return 0, 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
uidStr, gidStr, err := GetUserFromUsername(userStr, groupStr, fallbackToUID)
|
uidStr, gidStr, err := GetUserFromUsername(userStr, groupStr, fallbackToUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue