-
Notifications
You must be signed in to change notification settings - Fork 67
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
Lookup terraform binary in system path before attempting to install it #77
Conversation
fce2fdd
to
c4d93bb
Compare
@paultyng Can you have a look at this? |
@syndicut I no longer work at HashiCorp |
ok, sorry for bothering |
Hi @syndicut 👋 Thank you for raising this and apologies for the delayed review. Using an existing Terraform CLI binary is certainly a welcome enhancement. We recently needed to switch from the removed Something like this should do the trick: sources := []src.Source{
&fs.AnyVersion{
Product: &product.Terraform,
},
&checkpoint.LatestVersion{
InstallDir: tmpDir,
Product: product.Terraform,
},
}
installer := install.NewInstaller()
tfBin, err := installer.Ensure(context.Background(), sources)
if err != nil {
return nil, err
} Please reach out if you have any questions. |
Closing, with permission, in preference of #124 👍 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
When using terraform-plugin-docs in ci process it is slow and sometimes impossible to download terraform binary every time.
So I propose to first lookup terraform binary in system path and use it and fallback to downloading it.