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

Method state

provisioner/terraform/executor.go:563–574  ·  view source on GitHub ↗

state must only be called while the lock is held.

(ctx, killCtx context.Context)

Source from the content-addressed store, hash-verified

561
562// state must only be called while the lock is held.
563func (e *executor) state(ctx, killCtx context.Context) (*tfjson.State, error) {
564 ctx, span := e.server.startTrace(ctx, tracing.FuncName())
565 defer span.End()
566
567 args := []string{"show", "-json", "-no-color"}
568 state := &tfjson.State{}
569 err := e.execParseJSON(ctx, killCtx, args, e.basicEnv(), state)
570 if err != nil {
571 return nil, xerrors.Errorf("terraform show state: %w", err)
572 }
573 return state, nil
574}
575
576func interruptCommandOnCancel(ctx, killCtx context.Context, logger slog.Logger, cmd *exec.Cmd) {
577 go func() {

Callers 1

GraphMethod · 0.45

Calls 5

execParseJSONMethod · 0.95
basicEnvMethod · 0.95
FuncNameFunction · 0.92
startTraceMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected