ci: add support for custom GOPROXY and GOSUMDB in Docker environment #643
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for passing custom
GOPROXYandGOSUMDBenvironment variables to the Docker-based build environment. This enhancement enables developers working in enterprise environments with restricted network access or corporate proxies to successfully run builds and validation commands.Changes Made
build/makefile/golang.mkto conditionally passGOPROXYandGOSUMDBenvironment variables to Docker containers when they are set in the host environment.gitignoreto excludevendor/directory and/generate-dep.gofileProblem Solved
Developers in enterprise environments often encounter certificate verification errors when running
make validateor other build commands due to corporate network restrictions. For example:With this change, developers can now set custom proxy configurations:
Related Issues
Fixes #
Checklist
Breaking Changes
None. This change is backward compatible - if
GOPROXYandGOSUMDBare not set, the build process behaves exactly as before.Additional Notes
ifneqconditionals to only pass these environment variables when they are explicitly set, maintaining backward compatibilityGOSUMDB=offto disable checksum verification or usingGOPROXY=https://proxy.golang.org,directfor alternative proxy configurations