Change link for missing module or missing provider (#1724)

Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
This commit is contained in:
Arel Rabinowitz 2024-06-16 18:46:37 +03:00 committed by GitHub
parent e67cbc448c
commit 5667df4969
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View File

@ -432,7 +432,7 @@ func TestInitProviderNotFound(t *testing.T) {
}
oneLineStdout := strings.ReplaceAll(stdout, "\n", " ")
if !strings.Contains(oneLineStdout, `"diagnostic":{"severity":"error","summary":"Failed to query available provider packages","detail":"Could not retrieve the list of available versions for provider hashicorp/nonexist: provider registry registry.opentofu.org does not have a provider named registry.opentofu.org/hashicorp/nonexist\n\nAll modules should specify their required_providers so that external consumers will get the correct providers when using a module. To see which modules are currently depending on hashicorp/nonexist, run the following command:\n tofu providers\n\nIf you believe this provider is missing from the registry, please submit a issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/"},"type":"diagnostic"}`) {
if !strings.Contains(oneLineStdout, `"diagnostic":{"severity":"error","summary":"Failed to query available provider packages","detail":"Could not retrieve the list of available versions for provider hashicorp/nonexist: provider registry registry.opentofu.org does not have a provider named registry.opentofu.org/hashicorp/nonexist\n\nAll modules should specify their required_providers so that external consumers will get the correct providers when using a module. To see which modules are currently depending on hashicorp/nonexist, run the following command:\n tofu providers\n\nIf you believe this provider is missing from the registry, please submit a issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/new/choose"},"type":"diagnostic"}`) {
t.Errorf("expected error message is missing from output:\n%s", stdout)
}
})
@ -493,7 +493,8 @@ func TestInitProviderNotFound(t *testing.T) {
tofu providers
If you believe this provider is missing from the registry, please submit a
issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/
issue on the OpenTofu Registry
https://github.com/opentofu/registry/issues/new/choose
`

View File

@ -703,7 +703,7 @@ func (c *InitCommand) getProviders(ctx context.Context, config *configs.Config,
}
if provider.Hostname == addrs.DefaultProviderRegistryHost {
suggestion += "\n\nIf you believe this provider is missing from the registry, please submit a issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/"
suggestion += "\n\nIf you believe this provider is missing from the registry, please submit a issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/new/choose"
}
diags = diags.Append(tfdiags.Sourceless(

View File

@ -440,7 +440,7 @@ func (i *ModuleInstaller) installRegistryModule(ctx context.Context, req *config
if registry.IsModuleNotFound(err) {
suggestion := ""
if hostname == addrs.DefaultModuleRegistryHost {
suggestion = "\n\nIf you believe this module is missing from the registry, please submit a issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/"
suggestion = "\n\nIf you believe this module is missing from the registry, please submit a issue on the OpenTofu Registry https://github.com/opentofu/registry/issues/new/choose"
}
diags = diags.Append(&hcl.Diagnostic{