Skip to content

Commit

Permalink
fix: TFE remote ops detection for >= tf 1.0.0 (#1687)
Browse files Browse the repository at this point in the history
  • Loading branch information
taavitani committed Jul 7, 2021
1 parent d502bed commit d451167
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server/core/runtime/plan_step_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (p *PlanStepRunner) isRemoteOpsErr(output string, err error) bool {
if err == nil {
return false
}
return strings.Contains(output, remoteOpsErr01114) || strings.Contains(output, remoteOpsErr012)
return strings.Contains(output, remoteOpsErr01114) || strings.Contains(output, remoteOpsErr012) || strings.Contains(output, remoteOpsErr100)
}

// remotePlan runs a terraform plan command compatible with TFE remote
Expand Down Expand Up @@ -332,6 +332,14 @@ locally at this time.
`

// remoteOpsErr100 is the error terraform plan will retrun if this project is
// using TFE remote operations in TF 1.0.{0,1}.
var remoteOpsErr100 = `Error: Saving a generated plan is currently not supported
The "remote" backend does not support saving the generated execution plan
locally at this time.
`

// remoteOpsHeader is the header we add to the planfile if this plan was
// generated using TFE remote operations.
var remoteOpsHeader = "Atlantis: this plan was created by remote ops\n"

0 comments on commit d451167

Please sign in to comment.