From 77365bf2308a64c6800881ad5b3471d79b7112b8 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期二, 20 六月 2023 18:06:40 +0800 Subject: [PATCH] fix --- src/main/main.go | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/main.go b/src/main/main.go index e3e8f81..cb4f545 100644 --- a/src/main/main.go +++ b/src/main/main.go @@ -77,7 +77,7 @@ clusterID, err := cluster.GetClusterID(rancherClusterConfig.RancherURL, rancherClusterConfig.BearerToken, clusterName) if err != nil { fmt.Printf("Cluster not found: %s %v\n", clusterName, err) - err = cluster.CreateCluster(rancherClusterConfig, clusterName) + _, err = cluster.CreateCluster(rancherClusterConfig, clusterName) if err != nil { log.Fatalf("Failed to create cluster: %v", err) } @@ -214,7 +214,12 @@ os.Exit(1) } - err = k8s.CreateDeploymentAndService(clientset, *createNamespace, *createDeployment, *createService) + err = k8s.CreateDeploymentAndService(k8s.Config{ + Client: clientset, + NameSpace: *createNamespace, + DeploymentName: *createDeployment, + ServiceName: *createService, + }) if err != nil { panic(err) } @@ -282,7 +287,12 @@ for _, ns := range namespaces { deploymentName := ns serviceName := ns - err := k8s.CreateDeploymentAndService(clientset, ns, deploymentName, serviceName) + err := k8s.CreateDeploymentAndService(k8s.Config{ + Client: clientset, + NameSpace: ns, + DeploymentName: deploymentName, + ServiceName: serviceName, + }) if err != nil { log.Printf("\033[97;41mFailed to create resources in namespace %s: %v\033[0m\n", ns, err) } else { -- Gitblit v1.8.0