Gophercloud 1.10 introduced context aware functions.
For requests sent by ProviderClient.doRequest the ProviderClient.Context field and the passed in ctx are merged:
|
if client.Context != nil { |
|
var cancel context.CancelFunc |
|
ctx, cancel = ctxt.Merge(ctx, client.Context) |
|
defer cancel() |
|
} |
However, that merged context is also canceled using defer. This prevents reading from the Body of the returned http.Response. Thus when using ProviderClient.Context, every method that needs the request result currently fails with a context canceled error.
Gophercloud 1.10 introduced context aware functions.
For requests sent by
ProviderClient.doRequesttheProviderClient.Contextfield and the passed inctxare merged:gophercloud/provider_client.go
Lines 401 to 405 in 5b44c45
However, that merged context is also canceled using defer. This prevents reading from the
Bodyof the returnedhttp.Response. Thus when usingProviderClient.Context, every method that needs the request result currently fails with a context canceled error.