-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
adding proxy parameters to git pipeline resource #2215
Conversation
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
Couple of thoughts here:
|
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-integration-tests |
Should this be added to |
I'm a little wary of adding arbitrary env variable support for a single use case of the git resource. Task authors can already do this through the StepTemplate of a Task I think. Is there a way to scope the change down to just those fields which are most relevant for corporate proxies? For |
My understanding is StepTemplate Env. section is applied to the container where that step is executed, https://github.com/tektoncd/pipeline/blob/master/pkg/apis/resource/v1alpha1/git/git_resource.go#L151
Results in:
V/S. With these changes:
Results in expected failure since PROXY server is invalid:
We can certainly limit the scope and accept only proxy relevant env. settings. I will get that going. |
Ah I see, I should have checked the code that implements the |
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
Git resource parameters now support, httpProxy, httpsProxy, and noProxy. All three parameters are optional, no validation done on any. Its user's responsibility to specify valid values and specify whichever is needed based on their use case. e.g.: ``` inputs: resources: - name: skaffold resourceSpec: type: git params: - name: revision value: master - name: url value: https://github.com/GoogleContainerTools/skaffold - name: httpProxy value: "http.proxy.com" - name: httpsProxy value: "https.proxy.com" - name: noProxy value: "no.proxy.com" ```
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-integration-tests |
@sbwsg its ready for review again, thanks 🙏 |
}} | ||
|
||
if len(s.HTTPProxy) != 0 { | ||
env = append(env, corev1.EnvVar{Name: "HTTP_PROXY", Value: s.HTTPProxy}) |
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.
Please note that here, respective proxy env. variables are being set while creating a container instead of running git config --global
like sslVerify
in git.go
The reason for implementing this way is, for some reason, git
proxy configuration was ignored and cloning a repo was not failing even after setting HTTPS_PROXY
to an invalid server, see the failure test at
https://github.com/tektoncd/pipeline/pull/2215/files#diff-6e725a312c3f914d42e49f045db0bde5R185
We should also add these fields to the git-clone Task in the Catalog so that they have matching params. @pritidesai are you ok to do that once this is merged? If not let me know and I'll pick it up, cheers! |
yup, sure, will add these new fields to catalog 🙏 |
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.
/lgtm
@sbwsg do we want to cherry-pick this ?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg, vdemeester 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 |
yup, good thinking! |
Changes
Git resource parameters now support, httpProxy, httpsProxy, and noProxy.
All three parameters are optional, no validation done on any.
Its user's responsibility to specify valid values and specify whichever is needed based on their use case.
e.g.:
Fixes: #1663
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes