-
Notifications
You must be signed in to change notification settings - Fork 1k
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: OpenTofu support #4499
base: main
Are you sure you want to change the base?
feat: OpenTofu support #4499
Conversation
I agree with the premise of this, and I like the solution, but I don't agree that it stops the need for hc-install - I think that is worthy of a discussion. I do not think your changes inherently conflict with the hc-install PR - it is very easy to do this for example
Especially as the I think if you are going to have separate interfaces for OpenTofu vs Terraform implementations, then a discussion on whether to use the same logic vs different logic for each Distribution should be had.
|
Thanks @james0209, that makes sense. I'd be happy to rebase this over the hc-install change. As you point out, that should be fairly straightforward. |
Due to wip status, I switched this to a draft as a non draft means that it's ready for review. Please set it as ready to review when ready. Thank you for the contribution |
we have merged hc-install update, might worth do the rebase and pick up this PR again. Thanks for all the efforts! |
The OpenTofu team is going to release this downloader to make it easier for us to auto download Opentofu. https://github.com/janosdebugs/downloader @meringu @nitrocode if any of you want to work on this let us know |
Awesome, I rebased this from main yesterday and got to the part where we need to download tofu. I'm keen to keep working on this, but happy to have it taken over if I'm being too slow. |
Tofu downloader has been moved: https://github.com/opentofu/tofudl |
Thanks for your patience. I've done the following:
I've done some testing on one of my Atlantis servers. I've been able to do successful plan and applies. Have also tested resolving different version from constraints from the |
Hi @meringu, it looks there are a lot of spurious changes included in this PR, |
ab4be23
to
f0f91d9
Compare
Thanks @X-Guardian, I have cherry picked out a new commit, and only run |
Have updated the PR description to reflect the changes. The PR is labeled as needs-discussion and waiting-on-response, so please let me know how I can help. |
@meringu, can you resolve the conflicts? If it is ready for review, can you please change it to non-draft? 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.
Thank you for taking the time to implement this feature. A few comments before approving.
@@ -1266,6 +1274,8 @@ Setting this to `false` can be useful in an air-gapped environment where a downl | |||
|
|||
This has no impact if `--tf-download` is set to `false`. | |||
|
|||
This setting is currently ignored if `--tf-distribution` is set to `opentofu` |
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.
What is the rationale behind ignoring this for opentofu? Does this mean we always download the binary?
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'm not sure exaclty how to support this flag with opentofu. I'm open to ideas.
Tofudl supports two fields to download from a mirror: https://github.com/opentofu/tofudl/blob/76c6857d6eac665824b29da4e893e06e0b1896b2/branding/branding.go#L10-L14. I think we'd need to add an additional flag at the very least? I'm also not sure how specific this setting is to tofudl, that might be an issue if we change download method.
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.
@meringu we can maybe ask on the opentofu slack or an issue to tofudl if neccesary
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.
Great idea, I have asked over here: https://opentofucommunity.slack.com/archives/C05RKE7PS72/p1726523077638359
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.
The thinking is that we could look at supporting this later once someone needs it and has defined use-case. For now, I've updated the wording to indicate that it is not yet supported, and can unblock us getting this in for others to start to try out OpenTofu without a mirror.
In https://github.com/tofuutils/tenv we support mirrors for OpenTofu as well as for Terraform. |
what
This is a change to get OpenTofu to work with Atlantis.
I'm just starting to test this internally and have made some decisions in order to get it working:
--tf-distribution
setting that can be set toterraform
oropentofu
.server/core/terraform
package for the Terraform distribution. This matches up with the--tf-distribution
setting.why
#3741
tests
references
#3741