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

Method Kill

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

Source from the content-addressed store, hash-verified

174}
175
176func (s *ConcreteService) Kill() error {
177 if !s.isExpectedRunning() {
178 return nil
179 }
180
181 logger.Log("Killing", s.name)
182
183 if out, err := RunCommandAndGetOutput("docker", "kill", s.containerName()); err != nil {
184 logger.Log(string(out))
185 return err
186 }
187
188 s.Wait()
189
190 // Ensure the container is fully removed before returning. Even though
191 // containers are started with --rm, Docker removes them asynchronously
192 // after the process exits. Without this explicit removal, restarting a
193 // container with the same name can fail with "name already in use".
194 _, _ = RunCommandAndGetOutput("docker", "rm", "--force", s.containerName())
195
196 s.usedNetworkName = ""
197
198 return nil
199}
200
201// Wait waits until the service is stopped.
202func (s *ConcreteService) Wait() {

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