File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 20
20
BITCOINCORE_CONTAINER ,
21
21
COMMANDER_CHART ,
22
22
COMMANDER_CONTAINER ,
23
- LOGGING_NAMESPACE ,
24
23
)
25
24
from .k8s import (
26
25
delete_pod ,
27
26
get_default_namespace ,
28
27
get_mission ,
28
+ get_namespaces ,
29
29
get_pod ,
30
30
get_pods ,
31
31
pod_log ,
@@ -118,8 +118,6 @@ def down():
118
118
"""Bring down a running warnet quickly"""
119
119
console .print ("[bold yellow]Bringing down the warnet...[/bold yellow]" )
120
120
121
- namespaces = [get_default_namespace (), LOGGING_NAMESPACE ]
122
-
123
121
def uninstall_release (namespace , release_name ):
124
122
cmd = f"helm uninstall { release_name } --namespace { namespace } --wait=false"
125
123
subprocess .Popen (cmd , shell = True , stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
@@ -134,13 +132,15 @@ def delete_pod(pod_name, namespace):
134
132
futures = []
135
133
136
134
# Uninstall Helm releases
137
- for namespace in namespaces :
138
- command = f"helm list --namespace { namespace } -o json"
135
+ for namespace in get_namespaces () :
136
+ command = f"helm list --namespace { namespace . metadata . name } -o json"
139
137
result = run_command (command )
140
138
if result :
141
139
releases = json .loads (result )
142
140
for release in releases :
143
- futures .append (executor .submit (uninstall_release , namespace , release ["name" ]))
141
+ futures .append (
142
+ executor .submit (uninstall_release , namespace .metadata .name , release ["name" ])
143
+ )
144
144
145
145
# Delete remaining pods
146
146
pods = get_pods ()
You can’t perform that action at this time.
0 commit comments