Skip to content

Commit

Permalink
Adds an --rm flag to optionally remove the pod after completion
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibson91 committed Dec 12, 2024
1 parent 913851f commit 345be9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deployer/commands/exec/infra_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
def root_homes(
cluster_name: str = typer.Argument(..., help="Name of cluster to operate on"),
hub_name: str = typer.Argument(..., help="Name of hub to operate on"),
rm_pod: bool = typer.Option(False, "--rm", help="Automatically delete the pod after completing"),
extra_nfs_server: str = typer.Option(
None, help="IP address of an extra NFS server to mount"
),
Expand Down Expand Up @@ -134,6 +135,9 @@ def root_homes(
subprocess.check_call(create_cmd)
subprocess.check_call(exec_cmd)

# I want to ensure this code runs event if the exec cmd returns an exit code other than 0
if rm_pod:
delete_pod(pod_name, hub_name)

# I want to ensure this code runs event if the exec cmd returns an exit code other than 0
# Delete temporary pod spec file
Expand Down

0 comments on commit 345be9c

Please sign in to comment.