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

Method currentOCIState

libcontainer/container_linux.go:967–986  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

965}
966
967func (c *Container) currentOCIState() (*specs.State, error) {
968 bundle, annotations := utils.Annotations(c.config.Labels)
969 state := &specs.State{
970 Version: specs.Version,
971 ID: c.ID(),
972 Bundle: bundle,
973 Annotations: annotations,
974 }
975 status, err := c.currentStatus()
976 if err != nil {
977 return nil, err
978 }
979 state.Status = specs.ContainerState(status.String())
980 if status != Stopped {
981 if c.initProcess != nil {
982 state.Pid = c.initProcess.pid()
983 }
984 }
985 return state, nil
986}
987
988// orderNamespacePaths sorts namespace paths into a list of paths that we
989// can setns in order.

Callers 5

criuNotificationsMethod · 0.95
OCIStateMethod · 0.95
startMethod · 0.95
startMethod · 0.80
runPoststopHooksFunction · 0.80

Calls 5

IDMethod · 0.95
currentStatusMethod · 0.95
AnnotationsFunction · 0.92
pidMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected