Explorar o código

Merge branch 'stacks-v1' of github.com:porter-dev/porter into stacks-v1

Soham Dessai %!s(int64=3) %!d(string=hai) anos
pai
achega
1073240680

+ 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

@@ -108,6 +108,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) {