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

Method ListNodes

pkg/lib/k8s/node.go:35–47  ·  view source on GitHub ↗
(opts *kmeta.ListOptions)

Source from the content-addressed store, hash-verified

33}
34
35func (c *Client) ListNodes(opts *kmeta.ListOptions) ([]kcore.Node, error) {
36 if opts == nil {
37 opts = &kmeta.ListOptions{}
38 }
39 nodeList, err := c.nodeClient.List(context.Background(), *opts)
40 if err != nil {
41 return nil, errors.WithStack(err)
42 }
43 for i := range nodeList.Items {
44 nodeList.Items[i].TypeMeta = _nodeTypeMeta
45 }
46 return nodeList.Items, nil
47}
48
49func (c *Client) ListNodesByLabels(labels map[string]string) ([]kcore.Node, error) {
50 opts := &kmeta.ListOptions{

Callers 3

ListNodesByLabelsMethod · 0.95

Calls 2

WithStackFunction · 0.92
ListMethod · 0.65

Tested by

no test coverage detected