FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(terraform): include registry hostname in autodiscovery manifest by Pankaj-Gupta25 · Pull Request #9281 · updatecli/updatecli · GitHub

fix(terraform): include registry hostname in autodiscovery manifest - #9281

Merged
olblak merged 1 commit into
updatecli:mainfrom
Pankaj-Gupta25:fix-terraform-registry-hostname
Jun 28, 2026
Merged

fix(terraform): include registry hostname in autodiscovery manifest#9281
olblak merged 1 commit into
updatecli:mainfrom
Pankaj-Gupta25:fix-terraform-registry-hostname

Conversation

Copy link
Copy Markdown
Contributor

This fixes an issue where the Terraform autodiscovery plugin drops the hostname for non-default registries (like OpenTofu) and falls back to registry.terraform.io.

Fix #9232

When generating the updatecli manifest, the Terraform autodiscovery plugin was omitting the hostname field for the terraform/registry source configuration. Because of this, Updatecli would default to registry.terraform.io, causing it to throw a 404 error when trying to resolve providers hosted on alternative registries like registry.opentofu.org.

This PR uses the terraformRegistryAddress parser to extract the exact hostname from the provider string inside .terraform.lock.hcl. It then explicitly injects the hostname field into the generated manifest template if the hostname differs from the default registry.terraform.io.

Test

To test this pull request, you can run the following commands:

cd pkg/plugins/autodiscovery/terraform
go test

This fixes an issue where the Terraform autodiscovery plugin drops the hostname for non-default registries (like OpenTofu) and falls back to registry.terraform.io.
Pankaj-Gupta25 marked this pull request as draft June 26, 2026 20:43
Pankaj-Gupta25 marked this pull request as ready for review June 26, 2026 20:43

olblak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you for the pullrequest.
This sounds good to me, could you confirm that you tested

olblak added bug Something isn't working autodiscovery All things related to the autodiscovery feature resource-terraform labels Jun 28, 2026
olblak enabled auto-merge (squash) June 28, 2026 18:10
olblak merged commit c095a1f into updatecli:main Jun 28, 2026
8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autodiscovery All things related to the autodiscovery feature bug Something isn't working resource-terraform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure to resolve REGISTRY.OPENTOFU.ORG/OPENTFFOUNDATION/*

3 participants


Back | FazBrowse Home | New Git URL