Skip to content

Commit b7271cc

Browse files
committed
Plumb httpclient through the writer
1 parent bbd4a43 commit b7271cc

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pkg/client/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ func newClient(config *rest.Config, options Options) (*client, error) {
116116
}
117117

118118
clientcache := &clientCache{
119-
config: config,
120-
scheme: options.Scheme,
121-
mapper: options.Mapper,
122-
codecs: serializer.NewCodecFactory(options.Scheme),
119+
config: config,
120+
httpClient: options.HTTPClient,
121+
scheme: options.Scheme,
122+
mapper: options.Mapper,
123+
codecs: serializer.NewCodecFactory(options.Scheme),
123124

124125
structuredResourceByType: make(map[schema.GroupVersionKind]*resourceMeta),
125126
unstructuredResourceByType: make(map[schema.GroupVersionKind]*resourceMeta),

pkg/client/client_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type clientCache struct {
3737
config *rest.Config
3838

3939
// httpclient is the httpClient to talk to an apiserver
40-
httpclient *http.Client
40+
httpClient *http.Client
4141

4242
// scheme maps go structs to GroupVersionKinds
4343
scheme *runtime.Scheme
@@ -63,7 +63,7 @@ func (c *clientCache) newResource(gvk schema.GroupVersionKind, isList, isUnstruc
6363
gvk.Kind = gvk.Kind[:len(gvk.Kind)-4]
6464
}
6565

66-
client, err := apiutil.RESTClientForGVKAndClient(gvk, c.httpclient, isUnstructured, c.config, c.codecs)
66+
client, err := apiutil.RESTClientForGVKAndClient(gvk, c.httpClient, isUnstructured, c.config, c.codecs)
6767
if err != nil {
6868
return nil, err
6969
}

0 commit comments

Comments
 (0)