Skip to content
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

Dots should be allowed in namespace for third-party module registry addresses #61

Open
aayushsrivastava opened this issue Feb 12, 2024 · 0 comments

Comments

@aayushsrivastava
Copy link

Use Case

If I am using a third-party module registry, I should be allowed to use dots in the namespace. My organisation is not able to use registry as module source because we have a dot in our namespace. It is not easy to change the namespace.

For instance, I should be allowed to use example.com/my.namespace/name/targetsystem as a module source.

When I try to use the above as module source, I get the following error from Terraform CLI:
source address must have three more components after the hostname: the namespace, the name, and the target system

I checked the tests and found this assertion for the above error.

"missing part with explicit hostname": {
	input:   `foo.com/var/baz`,
	wantErr: `source address must have three more components after the hostname: the namespace, the name, and the target system`,
},

However, in the above usecase, all three components are provided after the hostname example.com.

Proposal

Based on the test suite, I believe this is a buggy implementation which is mistakenly stopping a use-case it didn't intend to. We should add a test case for example.com/my.namespace/name/targetsystem and change the implementation to make it green.

Contribution

I am open to contributing a solution if you need help. I haven't used Golang before so I will need some time to implement the solution though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant