From 8cd4c3718958c3180c426fd133b887978ad1468b Mon Sep 17 00:00:00 2001 From: poy Date: Wed, 27 Nov 2019 16:30:40 -0700 Subject: [PATCH] fix tests --- pkg/pod/entrypoint.go | 8 ++++---- pkg/pod/status_test.go | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/pod/entrypoint.go b/pkg/pod/entrypoint.go index 2efbcc0b7ea..38f6044b130 100644 --- a/pkg/pod/entrypoint.go +++ b/pkg/pod/entrypoint.go @@ -141,7 +141,7 @@ func orderContainers(entrypointImage string, steps []corev1.Container) (corev1.C func UpdateReady(kubeclient kubernetes.Interface, pod corev1.Pod) error { newPod, err := kubeclient.CoreV1().Pods(pod.Namespace).Get(pod.Name, metav1.GetOptions{}) if err != nil { - return fmt.Errorf("Error getting Pod %q when updating ready annotation: %w", pod.Name, err) + return fmt.Errorf("Error getting Pod %q when updating ready annotation: %v", pod.Name, err) } // Update the Pod's "READY" annotation to signal the first step to @@ -152,7 +152,7 @@ func UpdateReady(kubeclient kubernetes.Interface, pod corev1.Pod) error { if newPod.ObjectMeta.Annotations[readyAnnotation] != readyAnnotationValue { newPod.ObjectMeta.Annotations[readyAnnotation] = readyAnnotationValue if _, err := kubeclient.CoreV1().Pods(newPod.Namespace).Update(newPod); err != nil { - return fmt.Errorf("Error adding ready annotation to Pod %q: %w", pod.Name, err) + return fmt.Errorf("Error adding ready annotation to Pod %q: %v", pod.Name, err) } } return nil @@ -163,7 +163,7 @@ func UpdateReady(kubeclient kubernetes.Interface, pod corev1.Pod) error { func StopSidecars(nopImage string, kubeclient kubernetes.Interface, pod corev1.Pod) error { newPod, err := kubeclient.CoreV1().Pods(pod.Namespace).Get(pod.Name, metav1.GetOptions{}) if err != nil { - return fmt.Errorf("Error getting Pod %q when stopping sidecars: %w", pod.Name, err) + return fmt.Errorf("Error getting Pod %q when stopping sidecars: %v", pod.Name, err) } updated := false @@ -181,7 +181,7 @@ func StopSidecars(nopImage string, kubeclient kubernetes.Interface, pod corev1.P } if updated { if _, err := kubeclient.CoreV1().Pods(newPod.Namespace).Update(newPod); err != nil { - return fmt.Errorf("Error adding ready annotation to Pod %q: %w", pod.Name, err) + return fmt.Errorf("Error adding ready annotation to Pod %q: %v", pod.Name, err) } } return nil diff --git a/pkg/pod/status_test.go b/pkg/pod/status_test.go index 74ae37dafbd..f8883d2a99a 100644 --- a/pkg/pod/status_test.go +++ b/pkg/pod/status_test.go @@ -448,7 +448,9 @@ func TestMakeTaskRunStatus(t *testing.T) { Namespace: "foo", }, Status: v1alpha1.TaskRunStatus{ - StartTime: &metav1.Time{Time: startTime}, + TaskRunStatusFields: v1alpha1.TaskRunStatusFields{ + StartTime: &metav1.Time{Time: startTime}, + }, }, }