MCPcopy Index your code
hub / github.com/moby/moby / getActiveContainer

Method getActiveContainer

daemon/exec.go:77–93  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

75}
76
77func (daemon *Daemon) getActiveContainer(name string) (*container.Container, error) {
78 ctr, err := daemon.GetContainer(name)
79 if err != nil {
80 return nil, err
81 }
82
83 if !ctr.State.IsRunning() {
84 return nil, errNotRunning(ctr.ID)
85 }
86 if ctr.State.IsPaused() {
87 return nil, errExecPaused(name)
88 }
89 if ctr.State.IsRestarting() {
90 return nil, errContainerIsRestarting(ctr.ID)
91 }
92 return ctr, nil
93}
94
95// ContainerExecCreate sets up an exec in a running container.
96func (daemon *Daemon) ContainerExecCreate(name string, options *containertypes.ExecCreateRequest) (string, error) {

Callers 1

ContainerExecCreateMethod · 0.95

Calls 7

GetContainerMethod · 0.95
errNotRunningFunction · 0.85
errExecPausedFunction · 0.85
errContainerIsRestartingFunction · 0.85
IsPausedMethod · 0.80
IsRestartingMethod · 0.80
IsRunningMethod · 0.65

Tested by

no test coverage detected