Commit a8c3e1cc authored by Tim Bleimehl's avatar Tim Bleimehl 🤸🏼
Browse files

wip

parent 7596d441
......@@ -157,6 +157,8 @@ def backup_kubernetes(namespace, all_namespaces):
os.environ["CONFIGS_KUBECTL_NAMESPACE_PARAM"] = "--all-namespaces"
else:
os.environ["CONFIGS_KUBECTL_NAMESPACE_PARAM"] = f"-n {namespace}"
click.echo(f"Backup all DBs in namespace '{namespace}'")
i = 0
for podname in ContainerHelper.kubernetes_get_pod_names_to_be_backed_up():
config_labels = ContainerHelper.kubernetes_get_config_by_labels(
pod_name=podname
......@@ -179,7 +181,9 @@ def backup_kubernetes(namespace, all_namespaces):
databases=databases,
retention_type=RetentionType.DAILY,
)
i += 1
bu.manager.rotate_existing_backups()
click.echo(f"\nBackuped {i} databases")
@backup_cli.command(name="docker")
......@@ -368,16 +372,18 @@ def restore_kubernetes_list(pod, databases, yaml, base_path):
elif config_labels[ValidLabels.database_names].val:
databases = config_labels[ValidLabels.database_names].val.split(",")
else:
databases = None
databases = bu.list_databases()
bu.manager.base_path = Path(
PurePath(
bu.manager.base_path, config_labels[ValidLabels.backup_dir].val
)
)
# YOU ARE HERE. list databases bakcups
backup_list[f"{container_name}/{da}"]
for db in databases:
db_backups = bu.manager.list_backups(database_name=db)
backup_list[f"{container_name}/{db}"] = db_backups
click.echo(bu.manager.list_backups())
click.echo(backup_list)
if __name__ == "__main__":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment