fix
This commit is contained in:
BIN
__debug_bin439949312
Normal file
BIN
__debug_bin439949312
Normal file
Binary file not shown.
@@ -70,13 +70,13 @@ func CreateApp(clustername string, ControlPlane string, PlatformVersion string,
|
||||
}
|
||||
|
||||
// Generate unique cluster name with user prefix
|
||||
uniqueClusterName := "test"
|
||||
uniqueClusterName := clustername
|
||||
|
||||
app := ApplicationValues{
|
||||
Name: uniqueClusterName,
|
||||
Namespace: "ns-" + generateRandomString(4),
|
||||
Path: "vcluster-0.21.1",
|
||||
Cluster: "in-cluster",
|
||||
Cluster: "schoobus-onsite",
|
||||
Server: "https://kubernetes.default.svc",
|
||||
RepoURL: "http://192.168.2.20:8015/root/application.git",
|
||||
UserID: userID,
|
||||
@@ -110,17 +110,17 @@ func CreateApp(clustername string, ControlPlane string, PlatformVersion string,
|
||||
Name: "controlPlane.advanced.defaultImageRegistry",
|
||||
Value: "192.168.2.43:31898",
|
||||
},
|
||||
{
|
||||
Name: "controlPlane.distro.k8s.version",
|
||||
Value: ControlPlane,
|
||||
},
|
||||
// {
|
||||
// Name: "controlPlane.distro.k8s.version",
|
||||
// Value: ControlPlane,
|
||||
// },
|
||||
{
|
||||
Name: "controlPlane.distro.k8s.resources.limits.cpu",
|
||||
Value: Cpu,
|
||||
},
|
||||
{
|
||||
Name: "controlPlane.distro.k8s.resources.limits.memory",
|
||||
Value: Memory,
|
||||
Value: Memory + "Mi",
|
||||
},
|
||||
{
|
||||
Name: "controlPlane.distro.k8s.resources.requests.cpu",
|
||||
|
||||
2
db/db.go
2
db/db.go
@@ -14,7 +14,7 @@ var (
|
||||
)
|
||||
|
||||
func InitDB() {
|
||||
clientOptions := options.Client().ApplyURI("mongodb://root:example@172.20.158.234:27017/")
|
||||
clientOptions := options.Client().ApplyURI("mongodb://root:example@192.168.2.177:27017/")
|
||||
client, err := mongo.Connect(context.TODO(), clientOptions)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -19,4 +19,4 @@ services:
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: root
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: example
|
||||
ME_CONFIG_MONGODB_URL: mongodb://root:example@192.168.1.10:27017/
|
||||
ME_CONFIG_MONGODB_URL: mongodb://root:example@192.168.2.177:27017/
|
||||
@@ -6,9 +6,8 @@ import (
|
||||
"main/argohandler"
|
||||
"main/db"
|
||||
"net/http"
|
||||
"log"
|
||||
|
||||
// "github.com/gorilla/mux"
|
||||
// "github.com/gorilla/mux"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
@@ -37,10 +36,6 @@ func CreateClusterHandler(w http.ResponseWriter, r *http.Request) {
|
||||
var header Header
|
||||
header.Authorization = r.Header.Get("Authorization")
|
||||
|
||||
log.Fatal("--------------")
|
||||
log.Fatal(r.Header.Get("Authorization"))
|
||||
log.Fatal("--------------")
|
||||
|
||||
// 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 == "" {
|
||||
|
||||
2
main.go
2
main.go
@@ -6,7 +6,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
|
||||
"main/db"
|
||||
"main/handler"
|
||||
"net/http"
|
||||
@@ -72,6 +71,7 @@ func registerHnadler(w http.ResponseWriter, r *http.Request) {
|
||||
_, err := db.UserCollection.InsertOne(context.TODO(), user)
|
||||
if err != nil {
|
||||
http.Error(w, `{"message": "Could not create user"}`, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
|
||||
Reference in New Issue
Block a user