Move define.TempDirForURL() to pkg/tmpdir.ForURL(), unify its and Add()'s http client configurations - #6441
Move define.TempDirForURL() to pkg/tmpdir.ForURL(), unify its and Add()'s http client configurations#6441nalind wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nalind The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@nalind, did you intend to use the name |
|
Yeah, it's used by |
462f4f3 to
20c9435
Compare
|
Moved those bits to a new |
20c9435 to
dedabe6
Compare
|
Tweaked a bit to expose the proxy setting directly for callers. |
dedabe6 to
dd78138
Compare
|
A friendly reminder that this PR had no activity for 30 days. |
dd78138 to
4f37ec2
Compare
| return fmt.Errorf("no contents in %q", url) | ||
| } | ||
| if err := chrootarchive.Untar(resp.Body, dir, nil); err != nil { | ||
| resp1, err := http.Get(url) |
| type URLOptions struct { | ||
| CertPath string // location of CA certificates, if not the system default | ||
| InsecureSkipTLSVerify types.OptionalBool | ||
| Proxy func(*http.Request) (*url.URL, error) |
There was a problem hiding this comment.
I am not sure about the behavior of not setting the Proxy option. Maybe it should be checked or documented.
There was a problem hiding this comment.
Adding godoc for it.
4f37ec2 to
97063cb
Compare
97063cb to
605059d
Compare
Move the generic "download a thing" function to a package that wasn't originally intended to only include type definitions, but leave a wrapper in the old location for compatibility's sake. Fix a couple of stray spots where we still weren't using the version of the original function that accepted a context.Context. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
605059d to
eb871fd
Compare
Make sure that tmpdir.ForURL() and Add() use the same HTTP client configurations, both for TLS and proxies, so that we apply the same settings when fetching build contexts that we do for ADD instructions. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
eb871fd to
b1ca50b
Compare
What type of PR is this?
/kind bug
What this PR does / why we need it:
The HTTP client configurations used by Add() and the logic that we use for pulling down build contexts that are specified using URLs differ in their setup, and the latter doesn't implement the --tls-verify=false flag.
How to verify it
New integration test!
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
This is also a follow-up to #6274.
This moves the function that we use for retrieving things and putting them into temporary directories into its own package, but leaves behind an API-compatible wrapper function.
Does this PR introduce a user-facing change?