Skip to content

Commit c7947fb

Browse files
committed
chore: unwrap error
Signed-off-by: Eoghan Lawless <[email protected]>
1 parent 33b9212 commit c7947fb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/rest/getv2clustersname.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"fmt"
99
"log/slog"
1010
"regexp"
11-
"strings"
1211

1312
"github.com/open-edge-platform/cluster-manager/v2/internal/cluster"
1413
"github.com/open-edge-platform/cluster-manager/v2/internal/convert"
@@ -54,7 +53,7 @@ func (s *Server) GetV2ClustersName(ctx context.Context, request api.GetV2Cluster
5453

5554
cluster, err := s.getCluster(ctx, activeProjectID, name)
5655
if err != nil {
57-
if strings.Contains(err.Error(), k8s.ErrClusterNotFound.Error()) {
56+
if errors.Unwrap(err) == k8s.ErrClusterNotFound {
5857
return api.GetV2ClustersName404JSONResponse{
5958
N404NotFoundJSONResponse: api.N404NotFoundJSONResponse{
6059
Message: ptr(err.Error()),

0 commit comments

Comments
 (0)