Skip to content

Commit e2061ba

Browse files
author
Scott Nichols
committed
The resource rest mapper changed what the default operation is, and now we have to ask for the resource directly.
1 parent 5e77bad commit e2061ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/cache/internal/informers_map.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ func (ip *InformersMap) newListWatch(gvk schema.GroupVersionKind) (*cache.ListWa
217217
return &cache.ListWatch{
218218
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
219219
res := listObj.DeepCopyObject()
220-
err := client.Get().Resource(mapping.Resource.String()).VersionedParams(&opts, ip.paramCodec).Do().Into(res)
220+
err := client.Get().Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Do().Into(res)
221221
return res, err
222222
},
223223
// Setup the watch function
224224
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
225225
// Watch needs to be set to true separately
226226
opts.Watch = true
227-
return client.Get().Resource(mapping.Resource.String()).VersionedParams(&opts, ip.paramCodec).Watch()
227+
return client.Get().Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Watch()
228228
},
229229
}, nil
230230
}

pkg/client/client_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (r *resourceMeta) isNamespaced() bool {
132132

133133
// resource returns the resource name of the type
134134
func (r *resourceMeta) resource() string {
135-
return r.mapping.Resource.String()
135+
return r.mapping.Resource.Resource
136136
}
137137

138138
// objMeta stores type and object information about a Kubernetes type

0 commit comments

Comments
 (0)