Skip to content

Commit 59a241f

Browse files
committed
update the comment for container.Pause() method on linux
if a container state is running or created, the container.Pause() method can set the state to pausing, and then paused. this patch update the comment, so it can be consistent with the code. Signed-off-by: Wang Long <[email protected]>
1 parent 52454cf commit 59a241f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcontainer/container_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ type Container interface {
8585
// Systemerror - System error.
8686
Restore(process *Process, criuOpts *CriuOpts) error
8787

88-
// If the Container state is RUNNING, sets the Container state to PAUSING and pauses
88+
// If the Container state is RUNNING or CREATED, sets the Container state to PAUSING and pauses
8989
// the execution of any user processes. Asynchronously, when the container finished being paused the
9090
// state is changed to PAUSED.
9191
// If the Container state is PAUSED, do nothing.
9292
//
9393
// errors:
9494
// ContainerNotExists - Container no longer exists,
95-
// ContainerNotRunning - Container not running,
95+
// ContainerNotRunning - Container not running or created,
9696
// Systemerror - System error.
9797
Pause() error
9898

@@ -445,7 +445,7 @@ func (c *linuxContainer) Pause() error {
445445
c: c,
446446
})
447447
}
448-
return newGenericError(fmt.Errorf("container not running: %s", status), ContainerNotRunning)
448+
return newGenericError(fmt.Errorf("container not running or created: %s", status), ContainerNotRunning)
449449
}
450450

451451
func (c *linuxContainer) Resume() error {

0 commit comments

Comments
 (0)