Skip to content

Commit

Permalink
Fix find by name
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaitsev committed Aug 6, 2024
1 parent ad53202 commit 566c26f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions serverscom/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ func (l *loadBalancers) findLoadBalancerByName(ctx context.Context, clusterName
}
}

if currentLoadBalancer == nil {
return nil, &cli.NotFoundError{
StatusCode: 404,
ErrorCode: "NOT_FOUND",
Message: fmt.Sprintf("No load balancers were found with name: %s", name),
}
}

return l.client.LoadBalancers.GetL4LoadBalancer(ctx, currentLoadBalancer.ID)
}

Expand Down

0 comments on commit 566c26f

Please sign in to comment.