fix issues
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user