Skip to content

Commit

Permalink
Mini fix for v1alpha1 metricsCollector (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
hougangliu authored and k8s-ci-robot committed May 28, 2019
1 parent 4f678e2 commit 99a4359
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/manager/v1alpha1/metricscollector/metricscollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ func (d *MetricsCollector) CollectWorkerLog(wID string, wkind string, objectiveV
} else {
labelMap["job-name"] = wID
}
pl, _ := d.clientset.CoreV1().Pods(namespace).List(metav1.ListOptions{LabelSelector: labels.Set(labelMap).String(), IncludeUninitialized: true})
pl, err := d.clientset.CoreV1().Pods(namespace).List(metav1.ListOptions{LabelSelector: labels.Set(labelMap).String(), IncludeUninitialized: true})
if err != nil {
return nil, err
}
if len(pl.Items) == 0 {
return nil, errors.New(fmt.Sprintf("No Pods are found in Job %v", wID))
}
Expand Down

0 comments on commit 99a4359

Please sign in to comment.