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

Unclonable registry repository on Windows #1314

Closed
abstractionfactory opened this issue Nov 21, 2024 · 1 comment · Fixed by #1315
Closed

Unclonable registry repository on Windows #1314

abstractionfactory opened this issue Nov 21, 2024 · 1 comment · Fixed by #1315
Labels
bug Something isn't working

Comments

@abstractionfactory
Copy link
Contributor

abstractionfactory commented Nov 21, 2024

Currently, the registry repository contains paths that are not valid paths on Windows. This means that it is not possible to work with the registry on Windows:

D:\OpenTofu\registry> git checkout main
error: invalid path 'modules/m/maze2022/s3-webapp./aws.json'
error: invalid path 'modules/o/oragithub/vpc./aws.json'

However, these modules are valid module names in OpenTofu, meaning that people can use them this way. We have three ways forward to fix this:

  1. Tighten the requirements for module names and exclude these two module names.
  2. Make it explicit that working with the registry dataset on Windows is not supported.

Neither of these is a good option, but I believe it would be important to ensure a wide compatibility for working with the registry data set. We could also ask the two authors if they would like to rename the repo or if they would be ok with having these modules removed from the registry.

Modules in question:

@abstractionfactory abstractionfactory added the bug Something isn't working label Nov 21, 2024
@abstractionfactory
Copy link
Contributor Author

abstractionfactory commented Nov 21, 2024

Update: I believe we can remove these modules safely:

module "test" {
  source = "maze2022/s3-webapp./aws"
  version = "1.0.0"
}
$ tofu init

Initializing the backend...
Initializing modules...
╷
│ Error: Invalid registry module source address
│
│   on test.tf line 2, in module "test":
│    2:   source = "maze2022/s3-webapp./aws"
│
│ Failed to parse module registry address: invalid module name "s3-webapp.": must be between one and 64
│ characters, including ASCII letters, digits, dashes, and underscores, where dashes and underscores may
│ not be the prefix or suffix.
│
│ OpenTofu assumed that you intended a module registry source address because you also set the argument
│ "version", which applies only to registry modules.

Note that these module can still be used by directly referencing their Git repositories in the module source because this bypasses the registry.

abstractionfactory added a commit that referenced this issue Nov 21, 2024
Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
@abstractionfactory abstractionfactory linked a pull request Nov 21, 2024 that will close this issue
abstractionfactory added a commit that referenced this issue Nov 21, 2024
Fixes #1314: Unclonable registry repo on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant