From 83d95dcb5d430ba140f2968bb34a71d7e0c2b698 Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Fri, 4 Aug 2023 13:30:11 -0500 Subject: [PATCH] fixed correct propagation of launchplan start error (#598) Signed-off-by: Daniel Rammer --- pkg/controller/nodes/subworkflow/launchplan.go | 4 +--- pkg/controller/nodes/subworkflow/launchplan/admin.go | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/controller/nodes/subworkflow/launchplan.go b/pkg/controller/nodes/subworkflow/launchplan.go index 9f44dc9cb..d265d03db 100644 --- a/pkg/controller/nodes/subworkflow/launchplan.go +++ b/pkg/controller/nodes/subworkflow/launchplan.go @@ -109,9 +109,7 @@ func (l *launchPlanHandler) StartLaunchPlan(ctx context.Context, nCtx interfaces if launchplan.IsAlreadyExists(err) { logger.Infof(ctx, "Execution already exists [%s].", childID.Name) } else if launchplan.IsUserError(err) { - return handler.DoTransition(handler.TransitionTypeEphemeral, handler.PhaseInfoFailure(core.ExecutionError_USER, errors.RuntimeExecutionError, err.Error(), &handler.ExecutionInfo{ - WorkflowNodeInfo: &handler.WorkflowNodeInfo{LaunchedWorkflowID: childID}, - })), nil + return handler.DoTransition(handler.TransitionTypeEphemeral, handler.PhaseInfoFailure(core.ExecutionError_USER, errors.RuntimeExecutionError, err.Error(), nil)), nil } else { return handler.UnknownTransition, err } diff --git a/pkg/controller/nodes/subworkflow/launchplan/admin.go b/pkg/controller/nodes/subworkflow/launchplan/admin.go index 172ed9f41..574464a1c 100644 --- a/pkg/controller/nodes/subworkflow/launchplan/admin.go +++ b/pkg/controller/nodes/subworkflow/launchplan/admin.go @@ -192,11 +192,11 @@ func (a *adminLaunchPlanExecutor) Kill(ctx context.Context, executionID *core.Wo } _, err := a.adminClient.TerminateExecution(ctx, req) if err != nil { - if status.Code(err) == codes.NotFound { + err := evtErr.WrapError(err) + if evtErr.IsNotFound(err) { return nil } - err = evtErr.WrapError(err) if evtErr.IsEventAlreadyInTerminalStateError(err) { return nil }