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

Method Status

pkg/client/clientimplementation/proxy_client.go:313–347  ·  view source on GitHub ↗
(ctx context.Context, options client.StatusOptions)

Source from the content-addressed store, hash-verified

311}
312
313func (s *proxyClient) Status(ctx context.Context, options client.StatusOptions) (client.Status, error) {
314 s.m.Lock()
315 defer s.m.Unlock()
316
317 stdout := &bytes.Buffer{}
318 buf := &bytes.Buffer{}
319 err := RunCommandWithBinaries(
320 ctx,
321 "status",
322 s.config.Exec.Proxy.Status,
323 s.workspace.Context,
324 s.workspace,
325 nil,
326 s.devPodConfig.ProviderOptions(s.config.Name),
327 s.config,
328 EncodeOptions(options, DevPodFlagsStatus),
329 nil,
330 io.MultiWriter(stdout, buf),
331 buf,
332 s.log.ErrorStreamOnly(),
333 )
334 if err != nil {
335 return client.StatusNotFound, fmt.Errorf("error retrieving container status: %s%w", buf.String(), err)
336 }
337
338 readLogStream(bytes.NewReader(buf.Bytes()), s.log.ErrorStreamOnly())
339 status := &client.WorkspaceStatus{}
340 err = json.Unmarshal(stdout.Bytes(), status)
341 if err != nil {
342 return client.StatusNotFound, fmt.Errorf("error parsing proxy command response: %s%w", stdout.String(), err)
343 }
344
345 // parse status
346 return client.ParseStatus(status.State)
347}
348
349func (s *proxyClient) updateInstance(ctx context.Context) error {
350 err := RunCommandWithBinaries(

Callers

nothing calls this directly

Calls 11

ParseStatusFunction · 0.92
RunCommandWithBinariesFunction · 0.85
EncodeOptionsFunction · 0.85
readLogStreamFunction · 0.85
BytesMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
ProviderOptionsMethod · 0.45
ErrorStreamOnlyMethod · 0.45
ErrorfMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected