Skip to content

Commit b969c2d

Browse files
fix: Fix validate destination 3 1 5 (#440)
* chore: sync all codefresh code changes into v3.0.2 without event-reporter related changes Signed-off-by: oleksandr-codefresh <oleksandr.saulyak@octopus.com> * fix validateDestination --------- Signed-off-by: oleksandr-codefresh <oleksandr.saulyak@octopus.com> Co-authored-by: oleksandr-codefresh <oleksandr.saulyak@octopus.com>
1 parent df23d4d commit b969c2d

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

server/application/application_validate_src_and_dest.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"errors"
66
"fmt"
77

8-
"google.golang.org/grpc/codes"
9-
"google.golang.org/grpc/status"
108
apierrors "k8s.io/apimachinery/pkg/api/errors"
119

1210
"github.com/argoproj/argo-cd/v3/pkg/apiclient/application"
@@ -73,22 +71,5 @@ func validateDestination(ctx context.Context, dest *appv1.ApplicationDestination
7371
return errors.New("no destination defined in app spec")
7472
}
7573
_, err := argo.GetDestinationCluster(ctx, *dest, db)
76-
if err != nil {
77-
return err
78-
}
79-
80-
if dest.Server != "" {
81-
// Ensure the k8s cluster the app is referencing, is configured in Argo CD
82-
_, err := db.GetCluster(ctx, dest.Server)
83-
if err != nil {
84-
if errStatus, ok := status.FromError(err); ok && errStatus.Code() == codes.NotFound {
85-
return fmt.Errorf("cluster '%s' has not been configured", dest.Server)
86-
}
87-
return err
88-
}
89-
} else if dest.Server == "" {
90-
return errors.New("destination server missing from app spec")
91-
}
92-
93-
return nil
74+
return err
9475
}

0 commit comments

Comments
 (0)