ToHost returns the host user ID pair for the container ID pair.
(pair User)
| 64 | |
| 65 | // ToHost returns the host user ID pair for the container ID pair. |
| 66 | func (i *IDMap) ToHost(pair User) (User, error) { |
| 67 | var ( |
| 68 | target User |
| 69 | err error |
| 70 | ) |
| 71 | target.Uid, err = toHost(pair.Uid, i.UidMap) |
| 72 | if err != nil { |
| 73 | return invalidUser, err |
| 74 | } |
| 75 | target.Gid, err = toHost(pair.Gid, i.GidMap) |
| 76 | if err != nil { |
| 77 | return invalidUser, err |
| 78 | } |
| 79 | return target, nil |
| 80 | } |
| 81 | |
| 82 | // Marshal serializes the IDMap object into two strings: |
| 83 | // one uidmap list and another one for gidmap list |