-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
opentofu: plugins not found due to missing registry override #283015
Comments
A workaround is to specify the full path of the plugin, e.g. |
Do you know about the current status of the opentofu registry? Is is a mirror of the terraform registry or something else? |
They have a separate submission process, so it must not be just a mirror: https://github.com/opentofu/registry/tree/main#adding-providers-modules-or-gpg-keys-to-the-opentofu-registry |
Then I would propose this as a solution (instead of just a workaround). |
hm, long-term that would seem a bit like making opentofu a second-class citizen in nixpkgs, whereas it would seem more likely given its license and broad backing it will outlive terraform |
Having a default registry other than it's own is not making it a second-class citizen. Take podman as an example, despite having it's own (partly so) registry quay.io, still mostly uses docker.io as the default. |
opentofu seems to use its own registry by default rather than terraform's |
Unfortunately, it seems like OpenTofu doesn't have a choice - the Terraform Registry's ToS doesn't allow OpenTofu to use it (source). It doesn't look like we're downloading providers from the registry, so we shouldn't be running afoul of that clause. We just need to use a different folder name for Terraform ( |
I've got a draft PR that will drop the terraform registry in favour of just using the provider github repos directly, it'll be simple to include an option to use either I plan to finish the PR sometime in the next few weeks. |
A workaround I found for now, which implies rebuilding the providers: {
lib,
opentofu,
}: let
# HACK https://github.com/NixOS/nixpkgs/issues/283015
tofuProvider = provider:
provider.override (oldArgs: {
provider-source-address =
lib.replaceStrings
["https://registry.terraform.io/providers"]
["registry.opentofu.org"]
oldArgs.homepage;
});
in
opentofu.withPlugins (ps:
builtins.map tofuProvider [
ps.aws
ps.hcloud
]) |
Describe the bug
opentofu.withPlugins
still fails to overrideregistry.terraform.io
toregistry.opentofu.org
.as a result of this, it will fail to find used plugins, searching in a nix store path containing
registry.terraform.io
rather thanregistry.opentofu.org
.Steps To Reproduce
Steps to reproduce the behavior:
use
opentofu.withPlugins
use a plugin in a
.tf
, e.g.:run
tofu init
find error not unlike:
Expected behavior
plugins work using opentofu as well
Screenshots
Additional context
withPlugins
as well as its derivatives likefull
andpassthru
.Notify maintainers
@gmemstr
@NickCao
@zowoq
Metadata
The text was updated successfully, but these errors were encountered: