From 88da2c1c70b538d12c0496c8c83284eec7321078 Mon Sep 17 00:00:00 2001 From: Aleksandra Malinowska Date: Fri, 22 Sep 2017 10:45:22 +0200 Subject: [PATCH] refactor parsing cluster autoscaler status --- test/e2e/autoscaling/cluster_size_autoscaling.go | 6 +++--- test/e2e/framework/util.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index c138e1dba17..aeb89b67240 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -1365,12 +1365,12 @@ func getStatusTimestamp(status string) (time.Time, error) { return time.Time{}, err } - timestampMatches := timestampMatcher.FindAllStringSubmatch(status, -1) - if len(timestampMatches) < 1 { + timestampMatch := timestampMatcher.FindStringSubmatch(status) + if len(timestampMatch) < 2 { return time.Time{}, fmt.Errorf("Failed to parse CA status timestamp, raw status: %v", status) } - timestamp, err := time.Parse(timestampFormat, timestampMatches[0][1]) + timestamp, err := time.Parse(timestampFormat, timestampMatch[1]) if err != nil { return time.Time{}, err } diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 749cde9d8f5..ee056cadfe6 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -2351,7 +2351,7 @@ func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, logFunc func(f logFunc("\nLogging pods the kubelet thinks is on node %v", n) podList, err := GetKubeletPods(c, n) if err != nil { - logFunc("Unable to retrieve kubelet pods for node %v", n) + logFunc("Unable to retrieve kubelet pods for node %v: %v", n, err) continue } for _, p := range podList.Items {