MCPcopy Index your code
hub / github.com/coder/coder / DebugManifest

Method DebugManifest

codersdk/workspacesdk/agentconn.go:448–464  ·  view source on GitHub ↗

DebugManifest returns the agent's in-memory manifest. Unfortunately this must be returns as a []byte to avoid an import cycle.

(ctx context.Context)

Source from the content-addressed store, hash-verified

446// DebugManifest returns the agent's in-memory manifest. Unfortunately this must
447// be returns as a []byte to avoid an import cycle.
448func (c *agentConn) DebugManifest(ctx context.Context) ([]byte, error) {
449 ctx, span := tracing.StartSpan(ctx)
450 defer span.End()
451 res, err := c.apiRequest(ctx, http.MethodGet, "/debug/manifest", nil)
452 if err != nil {
453 return nil, xerrors.Errorf("do request: %w", err)
454 }
455 defer res.Body.Close()
456 if res.StatusCode != http.StatusOK {
457 return nil, codersdk.ReadBodyAsError(res)
458 }
459 bs, err := io.ReadAll(res.Body)
460 if err != nil {
461 return nil, xerrors.Errorf("read response body: %w", err)
462 }
463 return bs, nil
464}
465
466// DebugLogs returns up to the last 10MB of `/tmp/coder-agent.log`
467func (c *agentConn) DebugLogs(ctx context.Context) ([]byte, error) {

Callers

nothing calls this directly

Calls 6

apiRequestMethod · 0.95
StartSpanFunction · 0.92
ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
ErrorfMethod · 0.45
ReadAllMethod · 0.45

Tested by

no test coverage detected