Skip to content

Commit

Permalink
Update http roundtripper based on config (#607)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Nov 18, 2024
1 parent 750051a commit 864f373
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/delegated.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ func (d *DelegatingClient) Impersonate(u user.Info) (client.Client, error) {
Groups: u.GetGroups(),
Extra: u.GetExtra(),
}
return NewClient(config, d.options)
// share the transport between all clients
httpClient, err := restclient.HTTPClientFor(config)
if err != nil {
return nil, err
}

optionsShallowCopy := d.options
optionsShallowCopy.HTTPClient = httpClient

return NewClient(config, optionsShallowCopy)
}

// GroupVersionKindFor returns the GroupVersionKind for the given object.
Expand Down

0 comments on commit 864f373

Please sign in to comment.