(name string, opts metav1.GetOptions, subresources ...string)
| 239 | } |
| 240 | |
| 241 | func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) { |
| 242 | if len(name) == 0 { |
| 243 | return nil, fmt.Errorf("name is required") |
| 244 | } |
| 245 | result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do() |
| 246 | if err := result.Error(); err != nil { |
| 247 | return nil, err |
| 248 | } |
| 249 | retBytes, err := result.Raw() |
| 250 | if err != nil { |
| 251 | return nil, err |
| 252 | } |
| 253 | uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) |
| 254 | if err != nil { |
| 255 | return nil, err |
| 256 | } |
| 257 | return uncastObj.(*unstructured.Unstructured), nil |
| 258 | } |
| 259 | |
| 260 | func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { |
| 261 | result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do() |
nothing calls this directly
no test coverage detected