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

Function criuNsToKey

libcontainer/criu_linux.go:190–204  ·  view source on GitHub ↗
(t configs.NamespaceType)

Source from the content-addressed store, hash-verified

188}
189
190func criuNsToKey(t configs.NamespaceType) string {
191 // Construct "extRoot" + capitalize(nsName) + "NS" without allocations.
192 // Result format: "extRootNetNS", "extRootPidNS", etc.
193 nsName := configs.NsName(t)
194 out := make([]byte, 0, 32)
195 out = append(out, "extRoot"...)
196 // Capitalize the first character (this assumes it's in the a-z range).
197 if len(nsName) > 0 {
198 out = append(out, byte(unicode.ToUpper(rune(nsName[0]))))
199 out = append(out, nsName[1:]...)
200 }
201 out = append(out, "NS"...)
202
203 return string(out)
204}
205
206func (c *Container) handleCheckpointingExternalNamespaces(rpcOpts *criurpc.CriuOpts, t configs.NamespaceType) error {
207 if !c.criuSupportsExtNS(t) {

Calls 1

NsNameFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…