We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b4f3891 + c875ea8 commit a5777e8Copy full SHA for a5777e8
libcontainer/configs/config_linux.go
@@ -13,7 +13,7 @@ var (
13
// different when user namespaces are enabled.
14
func (c Config) HostUID(containerId int) (int, error) {
15
if c.Namespaces.Contains(NEWUSER) {
16
- if c.UIDMappings == nil {
+ if len(c.UIDMappings) == 0 {
17
return -1, errNoUIDMap
18
}
19
id, found := c.hostIDFromMapping(containerId, c.UIDMappings)
@@ -36,7 +36,7 @@ func (c Config) HostRootUID() (int, error) {
36
37
func (c Config) HostGID(containerId int) (int, error) {
38
39
- if c.GIDMappings == nil {
+ if len(c.GIDMappings) == 0 {
40
return -1, errNoGIDMap
41
42
id, found := c.hostIDFromMapping(containerId, c.GIDMappings)
0 commit comments