-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
Terraform validate not applied with check goal #20222
Comments
@lilatomic this appears to be a regression from 2.17 to 2.18, which suggests it might be related to #18974 . Do you happen to have insight into what's going on here? |
ah, right, this is my bad for not writing up a doc on Terraform.
The change is #19185 , comment #19185 (comment) . I know this isn't ideal and is definitely unexpected. I thought this was the best position to take, since it won't cause errors caused by Terraform's behaviour. I've also found this to be a reasonable position with my own work, where all modules are consumed by deployments and It's entirely on me that the doc on the Terraform backend and porting instructions isn't written. I'll have time tomorrow to write it up. |
Hi @lilatomic, thanks for the response. Thanks for putting some (needed) work on the terraform backend, even without the docs :) On the overall approach, doesn't marking a module as deployment imply the risk of actually deploying it with experimental-deploy? We'd need a skip_deploy flag to mitigate this. Alternatively I'd go with a skip_check flag in the terraform_module itself and let users decide whether a module can be validated or not. As a sidenote, adding the line you suggest actually caused an error
I'm not using a python backend in this example, so this is rather confusing IMHO. Adding the config solves the issue, perhaps worth mentioning in the docs? |
I think the interpreter constraints is an internal thing Pants needs to run the dependency parser. We can definitely call that out in the docs. |
Sort of. We have one repo that holds the terraform modules and another that generates tfvars for these modules, we basically generate instances of the "root" modules dynamically. So development and deployment of said modules happen in separate repositories, we won't use pants for deployment at least for the foreseeable future. |
Thanks for explaining, I'll keep that in mind as I'm developing. I've got an MR up that will |
as far as my limited knowledge of pants internals goes, it looks good to me! Thanks for the quick fix. btw, it is often useful to determine the order root modules are applied, I think it should be possible to use pants to our advantage for this (e.g. with terraform_deployment dependencies?). |
Only running `terraform validate` on deployments is unexpected for users. See #20222 . Running `terraform validate` on all modules might lead to errors with Terraform, but those are predictable and understandable by users. This MR: - Runs `terraform validate` on `terraform_modules` again - Adds the `skip_terraform_validate` field for `terraform_modules` which cannot be `validate`d by Terraform - Adds some documentation for the Terraform backend It leaves open the possibility of validating both `terraform_deployment`s and `terraform_module`s. Hopefully we can work out something like the Helm backend's handling of kubeconform. --------- Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
Only running `terraform validate` on deployments is unexpected for users. See #20222 . Running `terraform validate` on all modules might lead to errors with Terraform, but those are predictable and understandable by users. This MR: - Runs `terraform validate` on `terraform_modules` again - Adds the `skip_terraform_validate` field for `terraform_modules` which cannot be `validate`d by Terraform - Adds some documentation for the Terraform backend It leaves open the possibility of validating both `terraform_deployment`s and `terraform_module`s. Hopefully we can work out something like the Helm backend's handling of kubeconform. --------- Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
Only running `terraform validate` on deployments is unexpected for users. See #20222 . Running `terraform validate` on all modules might lead to errors with Terraform, but those are predictable and understandable by users. This MR: - Runs `terraform validate` on `terraform_modules` again - Adds the `skip_terraform_validate` field for `terraform_modules` which cannot be `validate`d by Terraform - Adds some documentation for the Terraform backend It leaves open the possibility of validating both `terraform_deployment`s and `terraform_module`s. Hopefully we can work out something like the Helm backend's handling of kubeconform. --------- Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
#20299) Only running `terraform validate` on deployments is unexpected for users. See #20222 . Running `terraform validate` on all modules might lead to errors with Terraform, but those are predictable and understandable by users. This MR: - Runs `terraform validate` on `terraform_modules` again - Adds the `skip_terraform_validate` field for `terraform_modules` which cannot be `validate`d by Terraform - Adds some documentation for the Terraform backend It leaves open the possibility of validating both `terraform_deployment`s and `terraform_module`s. Hopefully we can work out something like the Helm backend's handling of kubeconform. Co-authored-by: Daniel Goldman <merkavabuilder@gmail.com>
#20298) Only running `terraform validate` on deployments is unexpected for users. See #20222 . Running `terraform validate` on all modules might lead to errors with Terraform, but those are predictable and understandable by users. This MR: - Runs `terraform validate` on `terraform_modules` again - Adds the `skip_terraform_validate` field for `terraform_modules` which cannot be `validate`d by Terraform - Adds some documentation for the Terraform backend It leaves open the possibility of validating both `terraform_deployment`s and `terraform_module`s. Hopefully we can work out something like the Helm backend's handling of kubeconform. Co-authored-by: Daniel Goldman <merkavabuilder@gmail.com>
Sorry, I missed the last query there. I don't think Pants currently has a way to set the deployment order of deployable targets. I think using the |
Hey, we've solved this issue in mainline now, so I'm going to close this. |
Describe the bug
A clear and concise description of the bug.
when running the check goal on terraform modules, the command executes successfully (with exit code 0) but does not perform any actual validation. Additionally, no logs are shown even at debug log level. Version v2.17.0 works as expected.
Pants version
Which version of Pants are you using?
v2.18.0
OS
Are you encountering the bug on MacOS, Linux, or both?
MacOS
Additional info
Add any other information about the problem here, such as attachments or links to gists, if relevant.
This test repository can be used to reproduce the problem. Goals fmt and lint work as expected, check on the other hand not.
The text was updated successfully, but these errors were encountered: