Fix "context canceled" with partial

Make sure the context used for timeouts isn't created based on the incoming
context, as we have cases where this can cancel the context prematurely.

Fixes #10789
This commit is contained in:
Bjørn Erik Pedersen
2023-03-04 18:08:29 +01:00
parent 184a67ac47
commit 3bbeb5688c
5 changed files with 40 additions and 14 deletions

View File

@@ -164,12 +164,12 @@ type resourceAdapter struct {
*resourceAdapterInner
}
func (r *resourceAdapter) Content(context.Context) (any, error) {
func (r *resourceAdapter) Content(ctx context.Context) (any, error) {
r.init(false, true)
if r.transformationsErr != nil {
return nil, r.transformationsErr
}
return r.target.Content(context.Background())
return r.target.Content(ctx)
}
func (r *resourceAdapter) Err() resource.ResourceError {