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:
W. Trevor King 2015-07-08 00:41:43 -07:00
parent 40ca795938
commit 41979ca62c
1 changed files with 3 additions and 3 deletions

View File

@ -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 {