-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Enable GOPROXY in default preset #13648
Conversation
fa19394
to
e65a949
Compare
/hold |
@@ -635,3 +635,7 @@ presets: | |||
hostPath: | |||
path: /sys/fs/cgroup | |||
type: Directory | |||
# enable GOPROXY by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we support a 'default' preset that applies to all jobs implicitly and I'm not sure that we'd want to since that would be pretty opaque to job authors.
test-infra/prow/config/jobs.go
Lines 42 to 45 in c042e20
func mergePreset(preset Preset, labels map[string]string, containers []v1.Container, volumes *[]v1.Volume) error { | |
for l, v := range preset.Labels { | |
if v2, ok := labels[l]; !ok || v2 != v { | |
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW:
- presets upstream are meant to be opaque for injecting environment (primarily credential) details
- this setting only affects jobs that use go modules directly from within the container (not bazel or docker in docker)
- in many settings this would be configured with a default on the machine (EG a corporate GOPROXY)
Setting this by default across the board makes sense, I did mention in previous discussion that the prow owners may not be OK with that though 🤷♂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the code as it is today will apply this "default" preset to every job (CI actually errors if this is set in the job spec because it merges and detects the duplicate).
+1 to everything Ben said. I can't think of any job on prow.k8s.io that wouldn't either benefit from this being set, or disregard it as a noop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this, but let's make sure it's documented:
- https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md#presets - mention that defaulting is possible
- https://github.com/kubernetes/test-infra/tree/master/config/jobs#job-presets - link to the default we use and mention it sets GOPROXY by default
- I'm assuming we have tests that exercise this defaulting behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #13665 for follow up
e65a949
to
246b49c
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cblecker The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was new behavior to me, I like its use for good, but can we doc it?
@@ -635,3 +635,7 @@ presets: | |||
hostPath: | |||
path: /sys/fs/cgroup | |||
type: Directory | |||
# enable GOPROXY by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this, but let's make sure it's documented:
- https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md#presets - mention that defaulting is possible
- https://github.com/kubernetes/test-infra/tree/master/config/jobs#job-presets - link to the default we use and mention it sets GOPROXY by default
- I'm assuming we have tests that exercise this defaulting behavior?
/lgtm |
LGTM label has been added. Git tree hash: 35eabee58731807806ba8fb89b2bcec46df40c71
|
/hold cancel |
@cblecker: Updated the following 2 configmaps:
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Revert "Merge pull request #13648 from cblecker/default-goproxy"
This broke pull-kubernetes-dependencies and was reverted via #13674 We can probably try this again once kubernetes/kubernetes#80732 merges |
PR to re-enable: #13686 |
fixes #13645.
Create a preset that adds the
GOPROXY=https://proxy.golang.org
env var to all jobs on prow.k8s.io.Summary of benefits: