Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: Support set custom TF/OpenTofu binary. | If you use a custom Docker image build, please note that
TERRAFORM_VERSION
now must be provided #670feat: Support set custom TF/OpenTofu binary. | If you use a custom Docker image build, please note that
TERRAFORM_VERSION
now must be provided #670Changes from 31 commits
c85dfd5
30674bc
af193f1
43edcea
78f7f10
45706a8
4018878
c25e0fb
7c448a6
b1dd3bb
2e353ba
8ca6f2d
d3c85b4
c73c2e8
5301302
53146fe
a6fedca
2f6f7b0
200b96b
5091208
3f94d4f
741aac6
128d4fa
c20b5fd
e7deaaf
e771a4f
258234f
3660e75
6670e51
825b7f0
bc2766c
168dd6a
80d239d
c7ad7d1
e3c66bd
1cb551e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I don't get it
According to https://terragrunt.gruntwork.io/docs/reference/cli-options/#terragrunt-tfpath it will be automatically specified for terragrunt => for terragrunt hooks too.
Why do we need to set Terragrunt path for vanilla TF hooks?
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.
Imagine you are working in some environment that already uses
TERRAGRUNT_TFPATH
env variable (global env, using direnv, or any other method)So if a variable already exists and serves exactly the same purposes, why not to check it and reuse it, why to have other args/vars/etc?
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.
Not sure I'm following the gist of the question, though probably (I'm purely guesstimating) this way it would be easier for people using both TF and TG hooks to specify custom binary only once using TG's method but covering also TF? 🤔 And from this point of view it makes sense to me.
@den-is What's your idea?
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.
@yermulnik Erm... this was already replied to by me yesterday.
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.
Folks that use terragrunt should use
terragrunt
hooks, notterraform
hooks -terraform
will just not work in most cases. It's hard to imagine that someone uses both terragrunt and vanilla terraform, but if so - why do we think that folks would be happy with interference between "prj1 with TG and OpenTofu" and "prj2 with vanilla TF"?And another question: do we need to specify
$tf_path
for terragrunt hooks?Like
terragrunt validate --terragrunt-tfpath "$tf_path" "${args[@]}"
pre-commit-terraform/hooks/terragrunt_validate.sh
Line 46 in 1ac4f2d
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.
@den-is My bad. I missed that comment (found it now). Thanks.
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.
I don't in particular, but a fellow squad in my project — does. And I'd imagine there are people in the wild who do the same and hence they may like using
TERRAGRUNT_TFPATH
to cover both use cases if they usepre-commit-terraform
.That's a good question. We probably should. But only when it is provided via TG hook config. In the rest of use cases TG should rely upon its own logic, including
TERRAGRUNT_TFPATH
and others described at https://terragrunt.gruntwork.io/docs/reference/cli-options/#terragrunt-tfpathThere 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.
Had a conversation with @den-is
TL;DR: we assume that it will no break anything in 99% of cases. And if such a thing happened - I'll mention Den is such an issue :D
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.
Works for me 👍🏻
I feel like
is
should bein
, but withis
the sentence sounds fabulous 🤣