From 78e833e7bc9d1404cfcd255c6c277a3f956b7d66 Mon Sep 17 00:00:00 2001 From: Avesh Agarwal Date: Thu, 16 Jun 2016 14:09:24 -0400 Subject: [PATCH] Add pod status and reason when there are remaining pods. --- test/e2e/framework/util.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 206311a4c31..d1123a57857 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -992,17 +992,24 @@ func deleteNS(c *client.Client, namespace string, timeout time.Duration) error { // check for pods that were not deleted remaining := []string{} + remainingPods := []api.Pod{} missingTimestamp := false if pods, perr := c.Pods(namespace).List(api.ListOptions{}); perr == nil { for _, pod := range pods.Items { Logf("Pod %s %s on node %s remains, has deletion timestamp %s", namespace, pod.Name, pod.Spec.NodeName, pod.DeletionTimestamp) - remaining = append(remaining, pod.Name) + remaining = append(remaining, fmt.Sprintf("%s{Reason=%s}", pod.Name, pod.Status.Reason)) + remainingPods = append(remainingPods, pod) if pod.DeletionTimestamp == nil { missingTimestamp = true } } } + // log pod status + if len(remainingPods) > 0 { + logPodStates(remainingPods) + } + // a timeout occurred if err != nil { if missingTimestamp {