-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix remote execution on Terraform Cloud after v1.1.0 #2793
Conversation
} | ||
|
||
// remotePlan runs a terraform plan command compatible with TFE remote | ||
// operations. | ||
func (p *PlanStepRunner) remotePlan(ctx command.ProjectContext, extraArgs []string, path string, tfVersion *version.Version, planFile string, envs map[string]string) (string, error) { | ||
argList := [][]string{ | ||
{"plan", "-input=false", "-refresh"}, | ||
{"plan", "-input=false", "-refresh", "-no-color"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the change, the output in the comment contains color code and doesn't look very nice.
Also, I was debating whether to check tfVersion
before adding the extra -no-color
argument, and felt it might be fine to ignore it for better readability in the main code and the test cases. -no-color
seems to have been introduced in Terraform since very early on (at least before v0.11).
This fix is only meant to solve part of the issues for remote execution mentioned in the PR description. There is another issue #2794 on the apply step for remote execution which I feel should be addressed separately. |
* Fix remote execution on Terraform Cloud after v1.1.0 * Do not check terraform version for -no-color * Move string comparison for newer version earlier * Update remote apply test
I am using the pre-release from 12/26, and I still seem to have the issue with remote execution in Terraform versions greater that 1.1 (I have tried several)
Should I file another issue, or is there something I am missing in my configuration? For now I am going to override the workflow |
Yes please file another issue, link this pr to it, and please provide as much information as possible. |
* chore(atlantis): fix linter errors * fix superfluous-else * revert gitlab check * ignore stub funcs on azuredevops_client * remove fetch-depth * remove fail_on_error * fix plan_step_runner_test.go * more lint fixes --------- Co-authored-by: Dylan Page <[email protected]>
what
-out
argument.-no-color
argument forplan/apply
remote execution.why
Similar to #1687, the error message returned by Terraform CLI for remote execution changed yet again after v1.1.0. We rely on the error message to determine whether we should run another
plan/apply
commands in consideration of the execution to be remote.references
There seems to be no related issue created yet. But this potentially solves the problem mentioned in #1628 (comment)