ソースを参照

bring back gcp provisioning

sunguroku 5 年 前
コミット
114beb973d
1 ファイル変更21 行追加21 行削除
  1. 21 21
      dashboard/src/main/home/provisioner/GCPFormSection.tsx

+ 21 - 21
dashboard/src/main/home/provisioner/GCPFormSection.tsx

@@ -157,16 +157,16 @@ class GCPFormSection extends Component<PropsType, StateType> {
     let { currentProject } = this.context;
     let { currentProject } = this.context;
     let { handleError } = this.props;
     let { handleError } = this.props;
 
 
-    // api.createGCR('<token>', {
-    //   gcp_integration_id: id,
-    // }, { project_id: currentProject.id }, (err: any, res: any) => {
-    //   if (err) {
-    //     console.log(err);
-    //     handleError();
-    //     return;
-    //   }
-    callback && callback();
-    // });
+    api.createGCR('<token>', {
+      gcp_integration_id: id,
+    }, { project_id: currentProject.id }, (err: any, res: any) => {
+      if (err) {
+        console.log(err);
+        handleError();
+        return;
+      }
+      callback && callback();
+    });
   }
   }
 
 
   provisionGKE = (id: number) => {
   provisionGKE = (id: number) => {
@@ -175,17 +175,17 @@ class GCPFormSection extends Component<PropsType, StateType> {
     let { currentProject } = this.context;
     let { currentProject } = this.context;
 
 
     let clusterName = `${currentProject.name}-cluster`
     let clusterName = `${currentProject.name}-cluster`
-    // api.createGKE('<token>', {
-    //   gke_name: clusterName,
-    //   gcp_integration_id: id,
-    // }, { project_id: currentProject.id }, (err: any, res: any) => {
-    //   if (err) {
-    //     console.log(err);
-    //     handleError();
-    //     return;
-    //   }
-    this.props.history.push("dashboard?tab=provisioner");
-    // })
+    api.createGKE('<token>', {
+      gke_name: clusterName,
+      gcp_integration_id: id,
+    }, { project_id: currentProject.id }, (err: any, res: any) => {
+      if (err) {
+        console.log(err);
+        handleError();
+        return;
+      }
+      this.props.history.push("dashboard?tab=provisioner");
+    })
   }
   }
 
 
   handleCreateFlow = () => {
   handleCreateFlow = () => {