Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
poy committed Nov 27, 2019
1 parent a7d2ddc commit 8cd4c37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/pod/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion pkg/pod/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
},
}

Expand Down

0 comments on commit 8cd4c37

Please sign in to comment.