From 06b7aaa548c476668d572e12158eacde0a914686 Mon Sep 17 00:00:00 2001 From: Ybehrooz Date: Sat, 30 Aug 2025 20:08:19 +0330 Subject: [PATCH] fix issues --- argohandler/argohandler.go | 2 ++ handler/handler.go | 2 +- models/workloads.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/argohandler/argohandler.go b/argohandler/argohandler.go index cc4878a..5ca58b4 100644 --- a/argohandler/argohandler.go +++ b/argohandler/argohandler.go @@ -271,6 +271,7 @@ func updateConfig(objectID string, configStrings string, namespace string) { "$set": bson.M{ "cluster_config": configStrings, "namespace": namespace, + "EndPoine": "https://" + namespace + ".bugx.ir", }, } @@ -365,6 +366,7 @@ func ListUserClusters(userID string) (error, []Clusters) { Name: app.Name, Status: string(app.Status.Health.Status), ClusterID: strings.Split(string(app.ObjectMeta.UID), "-")[0], + EndPoint: "https://" + app.Spec.Destination.Namespace + ".bugx.ir", } clusters = append(clusters, newCluster) } diff --git a/handler/handler.go b/handler/handler.go index 8262eda..596dcd8 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -59,7 +59,7 @@ func CreateClusterHandler(w http.ResponseWriter, r *http.Request) { // vclusterCollection := db.Vclusters_details.FindOne(context.TODO(), bson.M{"name": Cluster.Name}).Decode(&existsCluster) - if cluster.Name == "" || cluster.ControlPlane == "" || cluster.PlatformVersion == "" || cluster.Cpu == "" || cluster.Memory == "" { + if strings.ToLower(cluster.Name) == "" || cluster.ControlPlane == "" || cluster.PlatformVersion == "" || cluster.Cpu == "" || cluster.Memory == "" { http.Error(w, "Invalid input", http.StatusBadRequest) return } diff --git a/models/workloads.go b/models/workloads.go index 394bdaa..5db9ee3 100644 --- a/models/workloads.go +++ b/models/workloads.go @@ -22,6 +22,7 @@ type Cluster struct { CreatedAt string `json:"createdAt"` UserID primitive.ObjectID `json:"userId"` Cluster_config string `json:"clusterconfig"` + EndPoint string `json:"endPoint"` } type Header struct {