Add purge-volumes command

This commit is contained in:
Moritz 2024-02-13 11:39:41 +01:00
parent 08b19f76eb
commit 0b85097295
1 changed files with 12 additions and 0 deletions

View File

@ -695,6 +695,18 @@ def purge_secrets(apps):
abra("app","secret" ,"rm", "-a", domain)
print(f"Secrets for {domain} purged")
@cli.command()
@click.option('-a', '--apps', multiple=True)
def purge_volumes(apps):
""" Remove all the apps secrets """
# TODO: check for deployed apps
pool_apps = print_all_apps(apps)
domains = list(zip(*sum(pool_apps.values(), [])))[1]
if input(f"Do you really want to purge the volumes for these apps? Type YES: ") == "YES":
for domain in domains:
logging.info(f'purge {domain}')
abra("app","volume" ,"rm", "-n", domain)
print(f"Volumes for {domain} purged")
if __name__ == '__main__':