Skip to content

Commit 550fd22

Browse files
author
Shawn Hurley
committed
for unstructured types we should use the unstructured rest client
1 parent f2d2256 commit 550fd22

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/client/client_cache.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ func (c *clientCache) newResource(obj runtime.Object) (*resourceMeta, error) {
6666
gvk.Kind = gvk.Kind[:len(gvk.Kind)-4]
6767
}
6868

69-
client, err := apiutil.RESTClientForGVK(gvk, c.config, c.codecs)
69+
_, isUnstructured := obj.(*unstructured.Unstructured)
70+
var client rest.Interface
71+
if isUnstructured {
72+
client, err = apiutil.RESTUnstructuredClientForGVK(gvk, c.config)
73+
} else {
74+
client, err = apiutil.RESTClientForGVK(gvk, c.config, c.codecs)
75+
}
7076
if err != nil {
7177
return nil, err
7278
}

0 commit comments

Comments
 (0)