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

Method Get

dynamic/simple.go:241–258  ·  view source on GitHub ↗
(name string, opts metav1.GetOptions, subresources ...string)

Source from the content-addressed store, hash-verified

239}
240
241func (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
260func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
261 result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do()

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected