diff options
author | Justine Olshan <justineolshan@google.com> | 2018-06-15 16:08:20 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-15 16:09:09 -0700 |
commit | 0786707cd94b8feffaeb083077eccaf10873e682 (patch) | |
tree | 9dba432e5b695936e5f9907a92dae12bd5dc666a /runsc/container/status.go | |
parent | bd2d1aaa16474202b1a2c1edbf62e6782fa2dc36 (diff) |
Added code for a pause command for a container process.
Like runc, the pause command will pause the processes of the given container.
It will set that container's status to "paused."
A resume command will be be added to unpause and continue running the process.
PiperOrigin-RevId: 200789624
Change-Id: I72a5d7813d90ecfc4d01cc252d6018855016b1ea
Diffstat (limited to 'runsc/container/status.go')
-rw-r--r-- | runsc/container/status.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/runsc/container/status.go b/runsc/container/status.go index 8da1b4e89..bf177e78a 100644 --- a/runsc/container/status.go +++ b/runsc/container/status.go @@ -19,13 +19,17 @@ package container type Status int const ( - // Creating indicates "the container is being created". - Creating Status = iota - // Created indicates "the runtime has finished the create operation and // the container process has neither exited nor executed the // user-specified program". - Created + Created Status = iota + + // Creating indicates "the container is being created". + Creating + + // Paused indicates that the process within the container has been + // suspended. + Paused // Running indicates "the container process has executed the // user-specified program but has not exited". @@ -39,10 +43,12 @@ const ( // CLI spec and should not be changed. func (s Status) String() string { switch s { - case Creating: - return "creating" case Created: return "created" + case Creating: + return "creating" + case Paused: + return "paused" case Running: return "running" case Stopped: |