-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Feature Request: Add support for opentofu #1861
Comments
Currently updatecli does not work with alternative registries with respect to terraform lock files (the upstream Steps to reproduce
The underlying library 'tfupdate' doesn't seem to support other registries since doing this
Actually adds the equivalent |
It looks like We can provide a config that the CLI doesn't expose, doing some hacking locally to see whats possible: updatecli/pkg/plugins/resources/terraform/lock/main.go Lines 71 to 76 in bf6ad3e
- lockIndex, err := lock.NewDefaultIndex()
+ client, err := lock.NewProviderDownloaderClient(lock.TFRegistryConfig{
+ BaseURL: "https://registry.opentofu.org/",
+ })
if err != nil {
return nil, err
}
- newResource.lockIndex = lockIndex
+ newResource.lockIndex = lock.NewIndex(client) Produces
|
Does this suggest a new optional config a-la
|
@quotidian-ennui you might be interested in testing #1870 Went with slightly different config, which played very nicely with how it had already been coded: targets:
provider:
name: 'Bump hashicorp/hcp to {{ source "latestRelease" }}'
kind: terraform/lock
sourceid: latestRelease
spec:
file: .terraform.lock.hcl
provider: registry.opentofu.org/hashicorp/hcp
skipconstraints: true
platforms:
- darwin_amd64
- linux_amd64
- windows_amd64 |
https://registry.terraform.io/v1/providers/hashicorp/kubernetes https://registry.opentofu.org/v1/providers/hashicorp/kubernetes - 404 But https://registry.opentofu.org/v1/providers/hashicorp/kubernetes/versions - works |
I tested with the latest 0.71.0 which works tf-lock-k8s:
name: Update hashicorp/kubernetes lockfile
kind: terraform/lock
sourceid: terraform-provider-k8s
spec:
file: terraform/.terraform.lock.hcl
provider: registry.opentofu.org/hashicorp/kubernetes
platforms:
- linux_amd64
- windows_amd64
- darwin_amd64
- darwin_arm64
dependson:
- tf-provider-k8s
dependsonchange: true |
At this moment if you need to have a support of Terraform as well as OpenTofu (and Terragrunt :) ) in one tool you can use https://github.com/tofuutils/tenv which my team wrote some months ago. A lot of users switched to that tool to unify version management in the world of Terraform. You're welcome to open any issues or contribute to tenv. |
Is your feature request related to a problem?
OpenTofu went GA recently.
With terraform support added in: #1554, #1576, and #1621.
Similar support for
opentofu
could be added.It would probably be a case of working our the similarities and refactoring a few parts out to a shared utils around HCL processing vs Terraform specific parts.
Also identifying where alternatives should be used, for example OpenTofu have a fork https://github.com/opentofu/registry-address which is their alternative to https://github.com/hashicorp/terraform-registry-address
Solution you'd like
No response
Alternatives you've considered
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: