mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 00:24:59 +00:00
avoid panic when subresource is a list
Kubernetes-commit: 2e3b937dcdb02cab74213a5608cc4dac39c6423e
This commit is contained in:
committed by
Kubernetes Publisher
parent
51f5488cb9
commit
fae3dcdbf6
@@ -289,11 +289,12 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
|
||||
obj := &unstructured.Unstructured{}
|
||||
err = runtime.DecodeInto(unstructured.UnstructuredJSONScheme, retBytes, obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return uncastObj.(*unstructured.Unstructured), nil
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
|
||||
|
Reference in New Issue
Block a user