mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
catch error when failed to get podList in function failureTrap
This commit is contained in:
parent
459b537885
commit
3d705c0559
@ -163,6 +163,10 @@ func failureTrap(c clientset.Interface, ns string) {
|
|||||||
}
|
}
|
||||||
options := metav1.ListOptions{LabelSelector: selector.String()}
|
options := metav1.ListOptions{LabelSelector: selector.String()}
|
||||||
podList, err := c.CoreV1().Pods(rs.Namespace).List(options)
|
podList, err := c.CoreV1().Pods(rs.Namespace).List(options)
|
||||||
|
if err != nil {
|
||||||
|
framework.Logf("Failed to list Pods in namespace %s: %v", rs.Namespace, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
for _, pod := range podList.Items {
|
for _, pod := range podList.Items {
|
||||||
framework.Logf(spew.Sprintf("pod: %q:\n%+v\n", pod.Name, pod))
|
framework.Logf(spew.Sprintf("pod: %q:\n%+v\n", pod.Name, pod))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user