state must only be called while the lock is held.
(ctx, killCtx context.Context)
| 561 | |
| 562 | // state must only be called while the lock is held. |
| 563 | func (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 | |
| 576 | func interruptCommandOnCancel(ctx, killCtx context.Context, logger slog.Logger, cmd *exec.Cmd) { |
| 577 | go func() { |
no test coverage detected