MCPcopy
hub / github.com/containerd/containerd / ToHost

Method ToHost

internal/userns/idmap.go:66–80  ·  view source on GitHub ↗

ToHost returns the host user ID pair for the container ID pair.

(pair User)

Source from the content-addressed store, hash-verified

64
65// ToHost returns the host user ID pair for the container ID pair.
66func (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

Callers 4

updateContainerIOOwnerFunction · 0.95
TestToHostFunction · 0.95
chownFunction · 0.80
TestToHostOverflowFunction · 0.80

Calls 1

toHostFunction · 0.85

Tested by 2

TestToHostFunction · 0.76
TestToHostOverflowFunction · 0.64