From b99e6a0ea326c0c4616a4ca6a26b8ce22243adb9 Mon Sep 17 00:00:00 2001 From: gerdos82 <37865635+gerdos82@users.noreply.github.com> Date: Wed, 4 Dec 2019 20:23:44 +0100 Subject: [PATCH] Error occurred on pod watch should result in an error on the wait container (#1776) --- cmd/argoexec/commands/wait.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/argoexec/commands/wait.go b/cmd/argoexec/commands/wait.go index 6f0484b1f868..991027d5cc40 100644 --- a/cmd/argoexec/commands/wait.go +++ b/cmd/argoexec/commands/wait.go @@ -37,9 +37,9 @@ func waitContainer() error { }() // Wait for main container to complete - err := wfExecutor.Wait() - if err != nil { - wfExecutor.AddError(err) + waitErr := wfExecutor.Wait() + if waitErr != nil { + wfExecutor.AddError(waitErr) // do not return here so we can still try to kill sidecars & save outputs } @@ -72,5 +72,11 @@ func waitContainer() error { wfExecutor.AddError(err) return err } + + // To prevent the workflow step from completing successfully, return the error occurred during wait. + if waitErr != nil { + return waitErr + } + return nil }