소스 검색

chain ns deletion from fe for now

Justin Rhee 3 년 전
부모
커밋
1fb6a1ed32
2개의 변경된 파일과 9개의 추가작업 그리고 11개의 파일을 삭제
  1. 0 11
      api/server/handlers/stacks/delete_porter_app.go
  2. 9 0
      dashboard/src/main/home/app-dashboard/expanded-app/ExpandedApp.tsx

+ 0 - 11
api/server/handlers/stacks/delete_porter_app.go

@@ -39,17 +39,6 @@ func (c *DeletePorterAppByNameHandler) ServeHTTP(w http.ResponseWriter, r *http.
 		return
 	}
 
-	agent, agentErr := c.GetAgent(r, cluster, "")
-	if agentErr != nil {
-		c.HandleAPIError(w, r, apierrors.NewErrInternal(agentErr))
-		return
-	}
-
-	if err := agent.DeleteNamespace("porter–stack–" + name); err != nil {
-		c.HandleAPIError(w, r, apierrors.NewErrInternal(err))
-		return
-	}
-
 	porterApp, appErr := c.Repo().PorterApp().ReadPorterAppByName(cluster.ID, name)
 	if appErr != nil {
 		c.HandleAPIError(w, r, apierrors.NewErrInternal(appErr))

+ 9 - 0
dashboard/src/main/home/app-dashboard/expanded-app/ExpandedApp.tsx

@@ -109,6 +109,15 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
           name: appName,
         }
       );
+      const nsRes = await api.deleteNamespace(
+        "<token>",
+        {},
+        {
+          cluster_id: currentCluster.id,
+          id: currentProject.id,
+          namespace: `porter-stack-${appName}`,
+        }
+      );
       console.log(res);
       setIsLoading(false);
     } catch (err) {