Add error handling when getting pod information

Signed-off-by: Purtlebaugh Josiah <purtlebaugh_josiah@nintendo.co.jp>
pull/12113/head
Purtlebaugh Josiah 2 years ago committed by Josiah Purtlebaugh
parent fe2606992c
commit 6f94201e0c

@ -129,6 +129,10 @@ func (r *ReleaseTesting) GetPodLogs(out io.Writer, rel *release.Release) error {
podLogOptions := &v1.PodLogOptions{} podLogOptions := &v1.PodLogOptions{}
pod, err := client.CoreV1().Pods(r.Namespace).Get(context.Background(), h.Name, metav1.GetOptions{}) pod, err := client.CoreV1().Pods(r.Namespace).Get(context.Background(), h.Name, metav1.GetOptions{})
if err != nil {
return errors.Wrapf(err, "unable to get pod info for %s", h.Name)
}
if container, ok := pod.Annotations["helm.sh/hook-logs-container"]; ok { if container, ok := pod.Annotations["helm.sh/hook-logs-container"]; ok {
podLogOptions.Container = container podLogOptions.Container = container
} }

Loading…
Cancel
Save