Skip to content

Commit

Permalink
Merge pull request #602 from bitcoin-dev-project/stop-all
Browse files Browse the repository at this point in the history
stop: use default namespace
  • Loading branch information
pinheadmz authored Sep 13, 2024
2 parents 9129c9d + 67d761f commit 11f49bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/warnet/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ def stop(scenario_name):
def stop_scenario(scenario_name):
"""Stop a single scenario using Helm"""
# Stop the pod immediately (faster than uninstalling)
cmd = f"kubectl delete pod {scenario_name} --grace-period=0 --force"
namespace = get_default_namespace()
cmd = f"kubectl --namespace {namespace} delete pod {scenario_name} --grace-period=0 --force"
if stream_command(cmd):
console.print(f"[bold green]Successfully stopped scenario: {scenario_name}[/bold green]")
else:
console.print(f"[bold red]Failed to stop scenario: {scenario_name}[/bold red]")

# Then uninstall via helm (non-blocking)
namespace = get_default_namespace()
command = f"helm uninstall {scenario_name} --namespace {namespace} --wait=false"

# Run the helm uninstall command in the background
Expand Down

0 comments on commit 11f49bf

Please sign in to comment.