Skip to content

Commit

Permalink
fix(executor): Surface error when wait container fails to establish p…
Browse files Browse the repository at this point in the history
…od watch (#5372)
  • Loading branch information
terrytangyuan authored and simster7 committed Mar 23, 2021
1 parent f55d41a commit 41eaa35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workflow/executor/k8sapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (c *k8sAPIClient) until(ctx context.Context, f func(pod *corev1.Pod) bool)
done, err := func() (bool, error) {
w, err := podInterface.Watch(ctx, metav1.ListOptions{FieldSelector: "metadata.name=" + c.podName})
if err != nil {
return false, err
return true, fmt.Errorf("failed to establish pod watch: %w", err)
}
defer w.Stop()
for {
Expand All @@ -129,7 +129,7 @@ func (c *k8sAPIClient) until(ctx context.Context, f func(pod *corev1.Pod) bool)
}
pod, ok := event.Object.(*corev1.Pod)
if !ok {
return false, apierrors.FromObject(event.Object)
return true, apierrors.FromObject(event.Object)
}
done := f(pod)
if done {
Expand Down

0 comments on commit 41eaa35

Please sign in to comment.