-
Notifications
You must be signed in to change notification settings - Fork 39
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
Missing registry API endpoint for Get Provider #1337
Comments
Hi @guineveresaenger we are implementing the documented provider registry protocol we inherited from HashiCorp, which does not expose an endpoint at this address. If you know which os and architecture you are looking for, you can use the https://registry.opentofu.org/v1/providers/hashicorp/random/3.6.3/download/linux/amd64 endpoint. Alternatively, you can clone the registry repository and access the data directly. Could you elaborate on your use case for this endpoint? (Unfortunately, I cannot access the Terraform registry to check their data structure as this would violate their Terms of Service, so you'll have to describe what exactly you are looking for.) |
Hi @abstractionfactory - thanks for the quick reply! 💟 I'm a little confused, as this endpoint is clearly accessible and public from the Terraform registry. You're right, though; this endpoint isn't documented in the registry protocol, so I figured it was an oversight. My use case is this: I would like to determine the source code location (i.e. When I run
I get back a 200 response, headers, and the following payload:
It's the
Unfortunately that won't generalize to all Terraform registries. 😅 but thank you for pointing it out. |
This endpoint isn't documented indeed, which makes it unlikely that other registries will support it. I don't see any problems generating this response, or we can add it to the new api.opentofu.org endpoint (still in beta). I'll talk to my fellow core team members and we'll try to make a decision on this fairly quickly. |
That's a fair point about other registries. I should file an issue against the registry protocol to at least get clarification here. Thank you so much for considering! ❤️ |
@guineveresaenger I just did a quick check and the OpenTofu API may contain the information you seek: https://api.opentofu.org/registry/docs/providers/opentofu/aws/v5.78.0/index.json (See the You can find the API description at https://api.opentofu.org |
This pull request adds logic that enables us to generate resource docs for a dynamically bridged provider using the upstream dependency. Usage for remote providers: `pulumi package get-schema terraform-provider <registry address> <version> fullDocs=<true|false>`. Adds a parameterized arg field to `pulumi package get-schema terraform-provider <registry address> <version>` called `fullDocs`, which when set to `true` will instruct the bridge to `git clone --depth 1 -b <version> <terraform provider github repo> <local dir for dynamic docs>`. This allows us to keep the exact same docs logic we have established. The shallow clone targets the exact doc version we need. (*) For this, we infer the github repo from the OpenTofu org name. It is based on the assumption that `registry.opentofu.org/org/foo` is based on a provider that lives at `github.com/org/terraform-provider-foo`. OpenTofu says their protocol follows that of the HashiCorp Terraform Registry which [requires an org/user and a provider name of the format `terraform-provider-foo`](https://developer.hashicorp.com/terraform/registry/providers/publishing) and we have historical evidence that GitHub is the most commonly used source host for terraform providers. See also opentofu/registry#1337. Usage for local providers: `pulumi package get-schema terraform-provider <local-path> upstreamRepoPath=<localPath>`. Here, the local docs path gets read directly into `upstreamRepoPath`. The one thing that is perhaps missing here is to expand the remote args to allow to take a source repo as an additional argument. However, our internal use case is primarily one of automation, so this is not an immediate need. (*)Cloning docs for the AWS terraform provider at v5.70.0 has the following time performance: ``` git clone --depth 1 -b v5.70.0 awsDir 2.06s user 1.62s system 34% cpu 10.713 total ``` Fixes #2607
Thank you for reporting an issue.
I can query a provider's information in the Terraform registry like so:
which allows me to see metadata about the provider source.
When I do the same for OpenTofu, I get a 404:
It is entirely possible that this is an enhancement request rather than a bug, and the HashiCorp-owned registry is somewhat cagey around the
providers
service endpoints - but this is how I'd expect the registry protocol to behave.Context here is I'd like to obtain the sourcecode repo via metadata rather than via assumed naming convention.
OpenTofu Version
OpenTofu Configuration Files
n/a
The text was updated successfully, but these errors were encountered: