Fix COPY with --chown command (#1477)

* Fix COPY with --chown command

* fix linters
This commit is contained in:
Sladyn 2020-12-09 05:42:04 +05:30 committed by GitHub
parent bdcdec7c93
commit 0c1a1a690a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

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