MCPcopy
hub / github.com/google/gvisor / registerContainerLocked

Method registerContainerLocked

runsc/boot/loader.go:2205–2216  ·  view source on GitHub ↗

+checklocks:l.mu

(spec *specs.Spec, cid string)

Source from the content-addressed store, hash-verified

2203
2204// +checklocks:l.mu
2205func (l *Loader) registerContainerLocked(spec *specs.Spec, cid string) string {
2206 containerName := specutils.ContainerName(spec)
2207 if len(containerName) == 0 {
2208 // If no name was provided, require containers to be restored in the same order
2209 // they were created.
2210 containerName = "__no_name_" + strconv.Itoa(len(l.containerIDs))
2211 }
2212
2213 l.containerIDs[containerName] = cid
2214 l.containerSpecs[containerName] = spec
2215 return containerName
2216}
2217
2218func (l *Loader) getContainerSpec(containerName string) *specs.Spec {
2219 l.mu.Lock()

Callers 2

startSubcontainerMethod · 0.95
registerContainerMethod · 0.95

Calls 1

ContainerNameFunction · 0.92

Tested by

no test coverage detected