MCPcopy
hub / github.com/cortexlabs/cortex / ListPods

Method ListPods

pkg/lib/k8s/pod.go:382–394  ·  view source on GitHub ↗
(opts *kmeta.ListOptions)

Source from the content-addressed store, hash-verified

380}
381
382func (c *Client) ListPods(opts *kmeta.ListOptions) ([]kcore.Pod, error) {
383 if opts == nil {
384 opts = &kmeta.ListOptions{}
385 }
386 podList, err := c.podClient.List(context.Background(), *opts)
387 if err != nil {
388 return nil, errors.WithStack(err)
389 }
390 for i := range podList.Items {
391 podList.Items[i].TypeMeta = _podTypeMeta
392 }
393 return podList.Items, nil
394}
395
396func (c *Client) ListPodsByLabels(labels map[string]string) ([]kcore.Pod, error) {
397 opts := &kmeta.ListOptions{

Callers 4

ListPodsByLabelsMethod · 0.95
ListPodsWithLabelKeysMethod · 0.95
getWorkerNodeInfosFunction · 0.80
DeleteEvictedPodsFunction · 0.80

Calls 1

ListMethod · 0.65

Tested by

no test coverage detected