From df5c201407c4359f2d27420c8225878e7fd20952 Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Mon, 6 Jun 2022 17:32:19 -0500 Subject: [PATCH] checking for NotFound grpc code instead of nil launchplan (#441) Signed-off-by: Daniel Rammer --- pkg/controller/nodes/subworkflow/launchplan/admin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/nodes/subworkflow/launchplan/admin.go b/pkg/controller/nodes/subworkflow/launchplan/admin.go index 46e9de0776..251bd207d1 100644 --- a/pkg/controller/nodes/subworkflow/launchplan/admin.go +++ b/pkg/controller/nodes/subworkflow/launchplan/admin.go @@ -153,11 +153,11 @@ func (a *adminLaunchPlanExecutor) GetLaunchPlan(ctx context.Context, launchPlanR lp, err := a.adminClient.GetLaunchPlan(ctx, &getObjectRequest) if err != nil { + if status.Code(err) == codes.NotFound { + return nil, errors.Wrapf(RemoteErrorNotFound, err, "No launch plan retrieved from Admin") + } return nil, errors.Wrapf(RemoteErrorSystem, err, "Could not fetch launch plan definition from Admin") } - if lp == nil { - return nil, errors.Wrapf(RemoteErrorNotFound, err, "No launch plan retrieved from Admin") - } return lp, nil }