Plumb context to webhook calls

This commit is contained in:
Jordan Liggitt
2019-09-24 11:07:33 -04:00
parent 4c686ddc1c
commit b78edd86b8
3 changed files with 13 additions and 5 deletions

View File

@@ -175,7 +175,7 @@ func (a *Plugin) admitPod(ctx context.Context, pod *api.Pod, attributes admissio
review.Status = entry.(v1alpha1.ImageReviewStatus)
} else {
result := a.webhook.WithExponentialBackoff(ctx, func() rest.Result {
return a.webhook.RestClient.Post().Body(review).Do()
return a.webhook.RestClient.Post().Context(ctx).Body(review).Do()
})
if err := result.Error(); err != nil {