From 1ef5edd0d8f5d0514df3797435bfc3ce6bb8432f Mon Sep 17 00:00:00 2001 From: Kent Rancourt Date: Sun, 29 Sep 2024 10:52:00 -0400 Subject: [PATCH] fix(controller): make simple engine short-circuit step execution on non-success (#2602) Signed-off-by: Kent Rancourt --- internal/directives/simple_engine.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/directives/simple_engine.go b/internal/directives/simple_engine.go index eda02420e..8bad1e8ea 100644 --- a/internal/directives/simple_engine.go +++ b/internal/directives/simple_engine.go @@ -98,6 +98,10 @@ func (e *SimpleEngine) Promote( fmt.Errorf("failed to run step %q: %w", step.Kind, err) } + if result.Status != PromotionStatusSuccess { + return PromotionResult{Status: result.Status}, nil + } + if step.Alias != "" { state[step.Alias] = result.Output }