()
| 965 | } |
| 966 | |
| 967 | func (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. |
no test coverage detected