Skip to content

Commit

Permalink
checking for NotFound grpc code instead of nil launchplan (flyteorg#441)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw authored Jun 6, 2022
1 parent ac293ed commit df5c201
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/nodes/subworkflow/launchplan/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit df5c201

Please sign in to comment.