Skip to content

Some fixes for "make vendor"#3412

Merged
thaJeztah merged 2 commits intodocker:masterfrom
thaJeztah:fix_vendor
Jan 28, 2022
Merged

Some fixes for "make vendor"#3412
thaJeztah merged 2 commits intodocker:masterfrom
thaJeztah:fix_vendor

Conversation

@thaJeztah
Copy link
Copy Markdown
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 <[email protected]>
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 <[email protected]>
@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