Skip to content
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: fallback to default TF version in apply step #1931

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

sapslaj
Copy link
Contributor

@sapslaj sapslaj commented Dec 10, 2021

The plan step has a mechanism to use the default tf version from the Terraform client if the context does not define one, however the apply step does not have this. This results in remote executions of apply failing with a nil pointer dereference when it checks tfVersion in StripRefreshingFromPlanOutput. This fix involves copying what the PlanStepRunner does and falls back to the default version if the context's version is nil.

Fixes #1804 and #1852

The plan step has a mechanism to use the default tf version from the Terraform
client if the context does not define one, however the apply step does not have
this. This results in remote executions of apply failing with a nil pointer
dereference when it checks tfVersion in StripRefreshingFromPlanOutput. This fix
involves copying what the PlanStepRunner does and falls back to the default
version if the context's version is nil.
@sapslaj sapslaj requested a review from a team as a code owner December 10, 2021 20:58
@chenrui333
Copy link
Member

Thanks @sapslaj for the fix!!

@chenrui333 chenrui333 merged commit 6dda3df into runatlantis:master Dec 22, 2021
chenrui333 added a commit that referenced this pull request Dec 30, 2021
…-test-job

* 'master' of github.com:runatlantis/atlantis: (79 commits)
  release: 0.18.0 (#1965)
  feat: streaming terraform logs in real-time (#1937)
  build(deps): bump github.com/hashicorp/go-getter from 1.5.9 to 1.5.10 (#1961)
  docs: update website links (#1964)
  docs: clarify example for `--azuredevops-token` flag (#1712)
  docs: typo in heading level (#1960)
  fix: fallback to default TF version in apply step (#1931)
  feat: add GitHub team allowlist configuration option (#1694)
  Add in Dockerfile support for last Terraform 1.0.x version in AVAILABLE_TERRAFORM_VERSIONS (#1957)
  build(deps): bump github.com/spf13/viper from 1.10.0 to 1.10.1 (#1956)
  deps: terraform 1.1.2 (#1952)
  release: 0.17.6 (#1947)
  docker: make multi-platform atlantis image (#1943)
  docker(testing): fix arch ref for `linux/arm/v7`
  docker(testing): updating image build process
  docs: fix policy check documentation examples (#1945)
  build: make multi-platform image for testing-env
  atlantis-base: fix context
  atalntis-base: update platforms and path trigger
  atlantis-base: update platforms
  ...
@sapslaj sapslaj deleted the fix-tfc-remote branch January 10, 2022 15:36
krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
The plan step has a mechanism to use the default tf version from the Terraform
client if the context does not define one, however the apply step does not have
this. This results in remote executions of apply failing with a nil pointer
dereference when it checks tfVersion in StripRefreshingFromPlanOutput. This fix
involves copying what the PlanStepRunner does and falls back to the default
version if the context's version is nil.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Atlantis crashes on atlantis apply with Terraform Cloud
2 participants