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

Method ListJobs

pkg/lib/k8s/job.go:139–151  ·  view source on GitHub ↗
(opts *kmeta.ListOptions)

Source from the content-addressed store, hash-verified

137}
138
139func (c *Client) ListJobs(opts *kmeta.ListOptions) ([]kbatch.Job, error) {
140 if opts == nil {
141 opts = &kmeta.ListOptions{}
142 }
143 jobList, err := c.jobClient.List(context.Background(), *opts)
144 if err != nil {
145 return nil, errors.WithStack(err)
146 }
147 for i := range jobList.Items {
148 jobList.Items[i].TypeMeta = _jobTypeMeta
149 }
150 return jobList.Items, nil
151}
152
153func (c *Client) ListJobsByLabels(labels map[string]string) ([]kbatch.Job, error) {
154 opts := &kmeta.ListOptions{

Callers 4

ListJobsByLabelsMethod · 0.95
ListJobsWithLabelKeysMethod · 0.95
GetAPIsFunction · 0.80
ManageJobResourcesFunction · 0.80

Calls 1

ListMethod · 0.65

Tested by

no test coverage detected