MCPcopy Create free account
hub / github.com/cortexproject/cortex / Stop

Method Stop

integration/e2e/service.go:151–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151func (s *ConcreteService) Stop() error {
152 if !s.isExpectedRunning() {
153 return nil
154 }
155
156 logger.Log("Stopping", s.name)
157
158 if out, err := RunCommandAndGetOutput("docker", "stop", "--time=30", s.containerName()); err != nil {
159 logger.Log(string(out))
160 return err
161 }
162
163 s.Wait()
164
165 // Ensure the container is fully removed before returning. Even though
166 // containers are started with --rm, Docker removes them asynchronously
167 // after the process exits. Without this explicit removal, restarting a
168 // container with the same name can fail with "name already in use".
169 _, _ = RunCommandAndGetOutput("docker", "rm", "--force", s.containerName())
170
171 s.usedNetworkName = ""
172
173 return nil
174}
175
176func (s *ConcreteService) Kill() error {
177 if !s.isExpectedRunning() {

Callers

nothing calls this directly

Calls 5

isExpectedRunningMethod · 0.95
containerNameMethod · 0.95
WaitMethod · 0.95
RunCommandAndGetOutputFunction · 0.85
LogMethod · 0.45

Tested by

no test coverage detected