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(terraform_validate): Run terraform init on "Missing required provider" error #586

Merged
merged 1 commit into from Nov 16, 2023

Conversation

fwolfheimer
Copy link
Contributor

Put an x into the box if that apply:

  • This PR introduces breaking change.
  • This PR fixes a bug.
  • This PR adds new functionality.
  • This PR enhances existing functionality.

Description of your changes

Fixes #585

How can we test changes

@fwolfheimer fwolfheimer changed the title Run terraform init on missing required provider fix: Run terraform init on missing required provider Nov 15, 2023
@MaxymVlasov
Copy link
Collaborator

MaxymVlasov commented Nov 15, 2023

How can we reproduce it?

Use it with a fresh TF config where no provider has been installed, yet.

How can we test changes

Nothing

Can you please provide a tf configuration that failed? I don't get what is " fresh TF config where no provider has been installed"

@fwolfheimer
Copy link
Contributor Author

fwolfheimer commented Nov 16, 2023

@MaxymVlasov , this happened for a fairly complex project setup that contains multiple separate Terraform configurations each with multiple modules. I was not able to create a really minimal example which reproduces the behavior I have seen for the real project. However, as the error message I saw (in the linked bug report) is an error from Terraform which can be fixed by running terraform init and this error message is not part of the list of "well known errors" in terraform_validate.sh which causes an error in the hook execution which can be easily fixed by adding this error message to the list, I'd argue that trying to find a way to create a minimal reproducer of the actual situation is not of high value here. Hope you agree.

The fix proposed in this PR fixed the problem for me in the real project.

@MaxymVlasov MaxymVlasov changed the title fix: Run terraform init on missing required provider fix(terraform_validate): Run terraform init on "Missing required provider" error Nov 16, 2023
Copy link
Collaborator

@MaxymVlasov MaxymVlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In one day there will be an introduced tests, but for now, it's kinda acceptable

@MaxymVlasov MaxymVlasov merged commit 6e2bb2e into antonbabenko:master Nov 16, 2023
6 of 7 checks passed
antonbabenko pushed a commit that referenced this pull request Nov 16, 2023
## [1.83.6](v1.83.5...v1.83.6) (2023-11-16)

### Bug Fixes

* **`terraform_validate`:** Run `terraform init` on "Missing required provider" error ([#586](#586)) ([6e2bb2e](6e2bb2e))
@antonbabenko
Copy link
Owner

This PR is included in version 1.83.6 🎉

@MaxymVlasov
Copy link
Collaborator

In any case, thanks for contibution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants