hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.33k stars 9.49k forks source link

Terraform Registry does not allow kubernetes and google modules with the same name #31041

Open MeNsaaH opened 2 years ago

MeNsaaH commented 2 years ago

This is a bug report to Terraform Registry,

I tried to publish two different modules with same name, one for kubernetes and the other for google with names: terraform-google-gitlab-runner and terraform-kubernetes-gitlab-runner but this doesn't work unless I change the one for google to something else. I however don't face this issue when I try to publish modules with providers Azure, AWS and GCP.

crw commented 2 years ago

Hi @MeNsaaH, thanks for the report. This may be my own lack of understanding, but when you say

two different modules with same name

What is the shared name? Thanks!

MeNsaaH commented 2 years ago

@crw as stated in the requirements for publishing https://www.terraform.io/registry/modules/publish#requirements, The repositories must be named terraform-<PROVIDER>-<NAME>, where the <PROVIDER> can be google, kubernetes etc.

In this case the <NAME> is the same gitlab-runner, but the providers are different google and kubernetes. Resulting in two different modules terraform-google-gitlab-runner and terraform-kubernetes-gitlab-runner.

apparentlymart commented 2 years ago

Some more background context here, in case it's helpful...

The naming scheme that @MeNsaaH is parsed and transformed by the registry to produce the heirarchical registry address scheme, so:

My understanding is that this is intended to work and is the usual way to represent different implementations of the same abstraction against different cloud platforms. I don't know what is special about the particular combination of "google" and "kubernetes" that is causing problems here; we will probably need to forward this request to the Terraform Registry team to understand more.

crw commented 2 years ago

Thanks! It's already been forwarded to the Registry team, thanks for the additional context.

crw commented 2 years ago

@MeNsaaH can you please retry with the original naming scheme? We cannot reproduce this issue (by forking your repos), and even if it fails again we hope to capture log data that might explain the problem. Thanks for your help! Let us know when you've attempted this again.

MeNsaaH commented 2 years ago

@crw I have tried to do that today today. here are the two repos:

Currently, I have to do this: https://github.com/DeimosCloud/terraform-google-gitlab-ci-runner

crw commented 2 years ago

@MeNsaaH Thanks! I'll get this info back to the Registry team.