Skip to content

Commit

Permalink
cli: cluster delete mount optiion
Browse files Browse the repository at this point in the history
closes #387
  • Loading branch information
audrium committed Sep 7, 2020
1 parent 1eb7ad3 commit 8e4bb50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Expand Up @@ -4,6 +4,7 @@ Authors
The list of contributors in alphabetical order:

- `Anton Khodak <https://orcid.org/0000-0003-3263-4553>`_
- `Audrius Mecionis <https://orcid.org/0000-0002-3759-1663>`_
- `Dan Leehr <https://orcid.org/0000-0003-3221-9579>`_
- `Daniel Prelipcean <https://orcid.org/0000-0002-4855-194X>`_
- `Diego Rodriguez <https://orcid.org/0000-0003-0649-2002>`_
Expand Down
22 changes: 19 additions & 3 deletions reana/reana_dev/cluster.py
Expand Up @@ -376,10 +376,26 @@ def cluster_unpause():
run_command(cmd, "reana")


@click.option(
"-m",
"--mount",
"mounts",
multiple=True,
help="Which directories are used to mount the cluster nodes? [local_path:cluster_node_path]",
)
@cluster_commands.command(name="cluster-delete")
def cluster_delete():
"""Delete REANA cluster."""
cmd = "kind delete cluster"
def cluster_delete(mounts): # noqa: D301
"""Delete REANA cluster.
\b
Example:
$ reana-dev cluster-delete -m /var/reana:/var/reana
"""
cmd = ""
for mount in mounts:
cmd += "rm -rf {}; ".format(mount.split(":")[0])

cmd += "kind delete cluster"
run_command(cmd, "reana")


Expand Down

0 comments on commit 8e4bb50

Please sign in to comment.