Fix COPY with --chown command (#1477)

* Fix COPY with --chown command

* fix linters
This commit is contained in:
Sladyn
2020-12-08 16:12:04 -08:00
committed by GitHub
parent bdcdec7c93
commit 0c1a1a690a
+5
View File
@@ -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