MCPcopy
hub / github.com/opencontainers/runc / encodeIDMapping

Function encodeIDMapping

libcontainer/container_linux.go:1021–1030  ·  view source on GitHub ↗
(idMap []configs.IDMap)

Source from the content-addressed store, hash-verified

1019}
1020
1021func encodeIDMapping(idMap []configs.IDMap) ([]byte, error) {
1022 data := bytes.NewBuffer(nil)
1023 for _, im := range idMap {
1024 line := fmt.Sprintf("%d %d %d\n", im.ContainerID, im.HostID, im.Size)
1025 if _, err := data.WriteString(line); err != nil {
1026 return nil, err
1027 }
1028 }
1029 return data.Bytes(), nil
1030}
1031
1032// netlinkError is an error wrapper type for use by custom netlink message
1033// types. Panics with errors are wrapped in netlinkError so that the recover

Callers 1

bootstrapDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…