MCPcopy
hub / github.com/kubernetes/client-go / List

Method List

dynamic/simple.go:260–282  ·  view source on GitHub ↗
(opts metav1.ListOptions)

Source from the content-addressed store, hash-verified

258}
259
260func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
261 result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do()
262 if err := result.Error(); err != nil {
263 return nil, err
264 }
265 retBytes, err := result.Raw()
266 if err != nil {
267 return nil, err
268 }
269 uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
270 if err != nil {
271 return nil, err
272 }
273 if list, ok := uncastObj.(*unstructured.UnstructuredList); ok {
274 return list, nil
275 }
276
277 list, err := uncastObj.(*unstructured.Unstructured).ToList()
278 if err != nil {
279 return nil, err
280 }
281 return list, nil
282}
283
284func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
285 internalGV := schema.GroupVersions{

Callers

nothing calls this directly

Calls 8

makeURLSegmentsMethod · 0.95
AbsPathMethod · 0.80
RawMethod · 0.80
DoMethod · 0.65
GetMethod · 0.65
ErrorMethod · 0.65
DecodeMethod · 0.45

Tested by

no test coverage detected