spec.go: Adjust to new IDMapping field names
This fixes a bug where IDMapping.From was mapped to IDMap.ContainerID and IDMapping.To was mapped to IDMap.HostID, while the old spec docs were: // From is the uid/gid of the host user or group. From int32 `json:"from"` // To is the uid/gid of the container's user or group. To int32 `json:"to"` The new IDMapping field names make the expected mapping more obvious (HostID -> HostID and ContainerID -> ContainerID ;).
This commit is contained in:
parent
40ca795938
commit
41979ca62c
6
spec.go
6
spec.go
|
@ -303,9 +303,9 @@ func setupUserNamespace(spec *specs.LinuxSpec, config *configs.Config) error {
|
|||
config.Namespaces.Add(configs.NEWUSER, "")
|
||||
create := func(m specs.IDMapping) configs.IDMap {
|
||||
return configs.IDMap{
|
||||
ContainerID: int(m.From),
|
||||
HostID: int(m.To),
|
||||
Size: int(m.Count),
|
||||
HostID: int(m.HostID),
|
||||
ContainerID: int(m.ContainerID),
|
||||
Size: int(m.Size),
|
||||
}
|
||||
}
|
||||
for _, m := range spec.Linux.UidMappings {
|
||||
|
|
Loading…
Reference in New Issue