diff --git a/config.go b/config.go index 269e0cbe5..f5f0c9c2d 100644 --- a/config.go +++ b/config.go @@ -56,15 +56,3 @@ type MountPoint struct { // Path specifies the path of the mount. The path and child directories MUST exist, a runtime MUST NOT create directories automatically to a mount point. Path string `json:"path"` } - -// State holds information about the runtime state of the container. -type State struct { - // Version is the version of the specification that is supported. - Version string `json:"version"` - // ID is the container ID - ID string `json:"id"` - // Pid is the process id for the container's main process. - Pid int `json:"pid"` - // Root is the path to the container's bundle directory. - Root string `json:"root"` -} diff --git a/runtime_config_linux.go b/runtime_config_linux.go index 17db82df5..24092237e 100644 --- a/runtime_config_linux.go +++ b/runtime_config_linux.go @@ -2,9 +2,6 @@ package specs import "os" -// LinuxStateDirectory holds the container's state information -const LinuxStateDirectory = "/run/oci/containers" - // LinuxRuntimeSpec is the full specification for linux containers. type LinuxRuntimeSpec struct { RuntimeSpec diff --git a/state.go b/state.go new file mode 100644 index 000000000..bfa9273a0 --- /dev/null +++ b/state.go @@ -0,0 +1,13 @@ +package specs + +// State holds information about the runtime state of the container. +type State struct { + // Version is the version of the specification that is supported. + Version string `json:"version"` + // ID is the container ID + ID string `json:"id"` + // Pid is the process id for the container's main process. + Pid int `json:"pid"` + // Root is the path to the container's bundle directory. + Root string `json:"root"` +} diff --git a/state_linux.go b/state_linux.go new file mode 100644 index 000000000..a596f2666 --- /dev/null +++ b/state_linux.go @@ -0,0 +1,6 @@ +// +build linux + +package specs + +// LinuxStateDirectory holds the container's state information +const LinuxStateDirectory = "/run/oci/containers"