-
Notifications
You must be signed in to change notification settings - Fork 83
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
Use version from packerfile #104
Comments
Thanks for suggesting this @F21! We thought about this in the lead up, but haven't built anything yet, for a handful of reasons: 1.) Unlike Docker and other tools, Packer does not have a "default" file ( 2.) We thought about dealing with this, by having the user specify a single file that should be scanned for 3.) If A few options that come to mind are:
Ranges makes this complex (not impossible to solve from a code perspective, but it introduces magic and I don't like that) and less predictable (because of said magic). All this to say that, yes we understand the desire, but no, we don't currently have a good solution. We'll keep thinking more about this! Please feel free to share your thoughts on this, so we can take it into account, too! CC for @hashicorp/github-actions-maintainers and @JenGoldstrich specifically: I think this takes us back to the chat we had a few months ago of parsing the |
I think the dflook/terraform-version action has solved all 3 points, so perhaps inspiration can be drawn from it. |
@F21 the way I read https://github.com/dflook/terraform-github-actions/blob/main/image/entrypoints/version.sh#L11 is that A few thoughts about this: 1.) To be able to run In 2.) Looking at some of my Terraform code, and running {
"terraform_version": "1.8.5",
"platform": "darwin_amd64",
"provider_selections": {
"registry.terraform.io/hashicorp/aws": "5.38.0",
"registry.terraform.io/hashicorp/hcp": "0.83.0",
"registry.terraform.io/hashicorp/tfe": "0.52.0"
},
"terraform_outdated": false
} This would be very straightforward to parse, but note that required_version = ">= 1.7.0, < 1.8.0" Which means we can't use the JSON output to inform what version of Terraform the Action should install (and this flow would still be blocked by the problem described in point 1) required_version = "1.11.0" Ultimately, We've got more thinking to do! |
For 1, perhaps the action can include a set version of terraform that is used to run the The |
Hey @F21, Similarly to We'll keep iterating on how to deal with this, but including a binary by default and then replace it with a more version-appropriate binary isn't likely a path we'll go. |
It would be nice if the action can parse the
required_version
from the packerfile and use that to select the version.This prevents duplication where we have the version set in both the packerfile and
setup-packer
'sversion
input.The text was updated successfully, but these errors were encountered: