From 63cfaa9971fa33e0ea3aa0bb51aed768a429a94f Mon Sep 17 00:00:00 2001 From: poy Date: Sat, 30 Nov 2019 14:08:01 -0700 Subject: [PATCH] revert removal of error wrapping --- pkg/pod/entrypoint.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/pod/entrypoint.go b/pkg/pod/entrypoint.go index 38f6044b130..2efbcc0b7ea 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: %v", pod.Name, err) + return fmt.Errorf("Error getting Pod %q when updating ready annotation: %w", 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: %v", pod.Name, err) + return fmt.Errorf("Error adding ready annotation to Pod %q: %w", 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: %v", pod.Name, err) + return fmt.Errorf("Error getting Pod %q when stopping sidecars: %w", 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: %v", pod.Name, err) + return fmt.Errorf("Error adding ready annotation to Pod %q: %w", pod.Name, err) } } return nil