Skip to content

Commit

Permalink
change pvc storage underscore to a hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebot committed Oct 23, 2024
1 parent 7823f78 commit 8431ac5
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions smol_k8s_lab/k8s_apps/social/mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,22 +547,23 @@ def restore_mastodon(argocd: ArgoCD,
argocd.k8s.apply_manifests(podconfig_yaml, argocd.namespace)

# then we begin the restic restore of all the mastodon PVCs we lost
for pvc in ['valkey-primary', 'valkey-replica']:
for pvc in ['valkey_primary', 'valkey_replica']:
pvc_enabled = secrets.get('valkey_pvc_enabled', 'false')
if pvc_enabled and pvc_enabled.lower() != 'false':
# restores the mastodon pvc
k8up_restore_pvc(k8s_obj=argocd.k8s,
app='mastodon',
pvc=f'mastodon-{pvc}',
namespace='mastodon',
s3_endpoint=s3_backup_endpoint,
s3_bucket=s3_backup_bucket,
access_key_id=access_key_id,
secret_access_key=secret_access_key,
restic_repo_password=restic_repo_password,
snapshot_id=snapshot_ids[f'mastodon_{pvc}'],
pod_config="file-backups-podconfig"
)
k8up_restore_pvc(
k8s_obj=argocd.k8s,
app='mastodon',
pvc=f'mastodon-{pvc.replace("_","-")}',
namespace='mastodon',
s3_endpoint=s3_backup_endpoint,
s3_bucket=s3_backup_bucket,
access_key_id=access_key_id,
secret_access_key=secret_access_key,
restic_repo_password=restic_repo_password,
snapshot_id=snapshot_ids[f'mastodon_{pvc}'],
pod_config="file-backups-podconfig"
)

# todo: from here on out, this could be async to start on other tasks
# install mastodon as usual, but wait on it this time
Expand Down

0 comments on commit 8431ac5

Please sign in to comment.