MCPcopy
hub / github.com/loft-sh/devpod / Stop

Method Stop

pkg/client/clientimplementation/proxy_client.go:281–311  ·  view source on GitHub ↗
(ctx context.Context, opt client.StopOptions)

Source from the content-addressed store, hash-verified

279}
280
281func (s *proxyClient) Stop(ctx context.Context, opt client.StopOptions) error {
282 s.m.Lock()
283 defer s.m.Unlock()
284
285 reader, writer := io.Pipe()
286 defer writer.Close()
287 go func() {
288 readLogStream(reader, s.log)
289 }()
290
291 err := RunCommandWithBinaries(
292 ctx,
293 "stop",
294 s.config.Exec.Proxy.Stop,
295 s.workspace.Context,
296 s.workspace,
297 nil,
298 s.devPodConfig.ProviderOptions(s.config.Name),
299 s.config,
300 nil,
301 nil,
302 writer,
303 writer,
304 s.log,
305 )
306 if err != nil {
307 return fmt.Errorf("error stopping container: %w", err)
308 }
309
310 return nil
311}
312
313func (s *proxyClient) Status(ctx context.Context, options client.StatusOptions) (client.Status, error) {
314 s.m.Lock()

Callers

nothing calls this directly

Calls 7

readLogStreamFunction · 0.85
RunCommandWithBinariesFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65
CloseMethod · 0.45
ProviderOptionsMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected