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
Support Context with remote.Image and remote.Get #743
Comments
I'm in favor of it. This was definitely an oversight in the API -- a lot of the people involved hadn't written much go code yet 😄 But I'm not sure how to add this, seems like we have two approaches:
If we ever do a cc @imjasonh do you have opinions? |
|
This seems kind of like what we'd want to do... the initial requests to get the manfiest should obviously use the given context, but what about subsequent http requests to e.g. download config or layers? Should we use that context still? Or just on the initial volley of requests? |
I think* the difference is that once you give the struct a context, you'll never give it another one, so you always know which one to use. Contrast with an It seems fine to me* to have a *I'm not an expert, don't listen to me. |
I added a big comment to hopefully make this behavior evident. |
I am not seeing a way to pass in a
context
when usingremote.Get()
. Under the hood, it looks like it's just using the standardnet/http
package so I don't think it'd be too difficult of an addition if this proposal makes sense...Context.. 🥁 being in the event of a tcp timeout (e.g. unresposive registry), its just using the default timeout which is quite lengthy for my case. I'm defining a parent context and would like to cancel the request sooner.
The text was updated successfully, but these errors were encountered: