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

Some fixes for "make vendor" #3412

Merged
merged 2 commits into from
Jan 28, 2022
Merged

Some fixes for "make vendor" #3412

merged 2 commits into from
Jan 28, 2022

Conversation

thaJeztah
Copy link
Member

scripts/vendor: run go mod tidy when vendoring

There was some debate about this, and wether or not tidy should be run
when vendoring, but without this, validation failed after running
make vendor, and manually doing a go mod tidy is complicated
(due to the vendor.mod, and because the cache is not inside the
build-cache, not on the host).

Dockerfile.vendor: use GOPROXY=direct

While the module proxy can speed up vendoring, it may cause issues when
(temporarily) vendoring from a fork, because the proxy may not have the
module yet on first try, which causes vendoring to fail:

vendor.mod:95:2: replace github.com/thaJeztah/compose-on-kubernetes:
version "0b59cf047b3b0199048fe13fdcd21b0cb46549f2" invalid:
Get "https://proxy.golang.org/github.com/tha%21jeztah/compose-on-kubernetes/@v/0b59cf047b3b0199048fe13fdcd21b0cb46549f2.info": read tcp 172.17.0.2:60290->172.217.168.209:443: read: connection reset by peer

Using GOPROXY=direct to fetch sources directly from upstream (GitHub) instead.

There was some debate about this, and wether or not tidy should be run
when vendoring, but without this, validation failed after running
`make vendor`, and manually doing a `go mod tidy` is complicated
(due to the `vendor.mod`, and because the cache is not inside the
build-cache, not on the host).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
While the module proxy can speed up vendoring, it may cause issues when
(temporarily) vendoring from a fork, because the proxy may not have the
module yet on first try, which causes vendoring to fail:

    vendor.mod:95:2: replace github.com/thaJeztah/compose-on-kubernetes:
    version "0b59cf047b3b0199048fe13fdcd21b0cb46549f2" invalid:
    Get "https://proxy.golang.org/github.com/tha%21jeztah/compose-on-kubernetes/@v/0b59cf047b3b0199048fe13fdcd21b0cb46549f2.info": read tcp 172.17.0.2:60290->172.217.168.209:443: read: connection reset by peer

Using `GOPROXY=direct` to fetch sources directly from upstream (GitHub) instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah merged commit 5bb88dc into docker:master Jan 28, 2022
@thaJeztah thaJeztah deleted the fix_vendor branch January 28, 2022 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants