diff --git a/provisioner/terraform/executor.go b/provisioner/terraform/executor.go index 8a2d10727c5bf..3061f94519d84 100644 --- a/provisioner/terraform/executor.go +++ b/provisioner/terraform/executor.go @@ -342,7 +342,7 @@ func (e executor) stateResources(ctx, killCtx context.Context) ([]*proto.Resourc } func (e executor) state(ctx, killCtx context.Context) (*tfjson.State, error) { - args := []string{"show", "-json"} + args := []string{"show", "-json", "-no-color"} state := &tfjson.State{} err := e.execParseJSON(ctx, killCtx, args, e.basicEnv(), state) if err != nil { diff --git a/provisionerd/runner/runner.go b/provisionerd/runner/runner.go index c90df310576d1..18b7e881d7c82 100644 --- a/provisionerd/runner/runner.go +++ b/provisionerd/runner/runner.go @@ -233,6 +233,9 @@ func (r *Runner) ForceStop() { } func (r *Runner) update(ctx context.Context, u *proto.UpdateJobRequest) (*proto.UpdateJobResponse, error) { + ctx, span := r.startTrace(ctx, tracing.FuncName()) + defer span.End() + r.mutex.Lock() defer r.mutex.Unlock() if !r.okToSend { @@ -248,9 +251,6 @@ func (r *Runner) doCleanFinish(ctx context.Context) { completedJob *proto.CompletedJob ) - ctx, span := r.startTrace(ctx, tracing.FuncName()) - defer span.End() - // push the fail/succeed write onto the defer stack before the cleanup, so // that cleanup happens before this. defer func() {