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

The module name change issues #966

Closed
vndroid opened this issue Mar 8, 2023 · 5 comments
Closed

The module name change issues #966

vndroid opened this issue Mar 8, 2023 · 5 comments

Comments

@vndroid
Copy link

vndroid commented Mar 8, 2023

The original project name is https://github.com/docker/docker.
but now the name is https://github.com/moby/moby,

and some project submodules such as: /xxx/vendor/github.com/fsouza/go-dockerclient/distribution.go#L11 it has an old path, how to deal with it?

@fsouza
Copy link
Owner

fsouza commented Mar 8, 2023

Can you clarify what issues you're facing? When docker renamed the repo to moby, they didn't change the name of the package, which means there's no impact to people importing it.

@vndroid
Copy link
Author

vndroid commented Mar 9, 2023

Can you clarify what issues you're facing? When docker renamed the repo to moby, they didn't change the name of the package, which means there's no impact to people importing it.

For example, my project introduced go-dockerclient and moby as submodules, and now the path to them has changed, but the new path does not contain the original files,

ls vendor/github.com/docker/docker/

but in fact, the path is

ls vendor/github.com/moby/moby/

your code distribution.go

...
	"github.com/docker/docker/api/types/registry"
...

if I add the submodule moby, the path doesn't have the file. in fact, its path is vendor/github.com/moby/moby/api/types/registry

@fsouza
Copy link
Owner

fsouza commented Mar 9, 2023

How are you vendoring the code? Are you using go modules?

For context, the repository docker/docker was renamed to moby/moby in 2017. It happened almost 6 years ago, and it shouldn't affect go-dockerclient's ability to import its code.

@vndroid
Copy link
Author

vndroid commented Mar 9, 2023

How are you vendoring the code? Are you using go modules?

For context, the repository docker/docker was renamed to moby/moby in 2017. It happened almost 6 years ago, and it shouldn't affect go-dockerclient's ability to import its code.

Such as this project docker-ipv6nat, now the submodule path is vendor/github.com/docker/docker, When I delete the submodule and re-add moby submodule, I get an error that the module is not found and I can only modify it by following the old path.

I think this is unreasonable, is there a more perfect solution?

@fsouza
Copy link
Owner

fsouza commented Mar 9, 2023

Oh I see you're using Git submodules for vendoring. I strongly recommend migrating to Go modules, but if you'd like to continue using Git submodules, you should just remember to manually clone it under vendor/github.com/docker/docker. If you're adding the new submodule, you could do something like:

git submodule add https://github.com/docker/docker.git vendor/github.com/docker/docker

This alternative would work too:

git submodule add https://github.com/moby/moby.git vendor/github.com/docker/docker

You just need to make sure that the path is vendor/github.com/docker/docker.

@fsouza fsouza closed this as completed Mar 9, 2023
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

2 participants