Skip to content

Commit

Permalink
Add support for WALG_FILE_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
samgabriel authored Nov 19, 2024
1 parent 937815a commit 853ddc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions postgres-appliance/scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
USE_KUBERNETES = os.environ.get('KUBERNETES_SERVICE_HOST') is not None
KUBERNETES_DEFAULT_LABELS = '{"application": "spilo"}'
PATRONI_DCS = ('kubernetes', 'zookeeper', 'exhibitor', 'consul', 'etcd3', 'etcd')
AUTO_ENABLE_WALG_RESTORE = ('WAL_S3_BUCKET', 'WALE_S3_PREFIX', 'WALG_S3_PREFIX', 'WALG_AZ_PREFIX', 'WALG_SSH_PREFIX')
AUTO_ENABLE_WALG_RESTORE = ('WAL_S3_BUCKET', 'WALE_S3_PREFIX', 'WALG_S3_PREFIX', 'WALG_AZ_PREFIX', 'WALG_SSH_PREFIX', 'WALG_FILE_PREFIX')
WALG_SSH_NAMES = ['WALG_SSH_PREFIX', 'SSH_PRIVATE_KEY_PATH', 'SSH_USERNAME', 'SSH_PORT']


Expand Down Expand Up @@ -818,6 +818,7 @@ def write_wale_environment(placeholders, prefix, overwrite):
'SWIFT_AUTH_VERSION', 'SWIFT_ENDPOINT_TYPE', 'SWIFT_REGION', 'SWIFT_DOMAIN_NAME', 'SWIFT_DOMAIN_ID',
'SWIFT_PROJECT_NAME', 'SWIFT_PROJECT_ID', 'SWIFT_PROJECT_DOMAIN_NAME', 'SWIFT_PROJECT_DOMAIN_ID']
ssh_names = WALG_SSH_NAMES
file_names = ['WALG_FILE_PREFIX']
walg_names = ['WALG_DELTA_MAX_STEPS', 'WALG_DELTA_ORIGIN', 'WALG_DOWNLOAD_CONCURRENCY',
'WALG_UPLOAD_CONCURRENCY', 'WALG_UPLOAD_DISK_CONCURRENCY', 'WALG_DISK_RATE_LIMIT',
'WALG_NETWORK_RATE_LIMIT', 'WALG_COMPRESSION_METHOD', 'USE_WALG_BACKUP',
Expand All @@ -831,7 +832,7 @@ def write_wale_environment(placeholders, prefix, overwrite):
for name in ['PGVERSION', 'PGPORT', 'WALE_ENV_DIR', 'SCOPE', 'WAL_BUCKET_SCOPE_PREFIX', 'WAL_BUCKET_SCOPE_SUFFIX',
'WAL_S3_BUCKET', 'WAL_GCS_BUCKET', 'WAL_GS_BUCKET', 'WAL_SWIFT_BUCKET', 'BACKUP_NUM_TO_RETAIN',
'ENABLE_WAL_PATH_COMPAT'] + s3_names + swift_names + gs_names + walg_names + azure_names + \
azure_auth_names + ssh_names:
azure_auth_names + ssh_names + file_names:
wale[name] = placeholders.get(prefix + name, '')

if wale.get('WAL_S3_BUCKET') or wale.get('WALE_S3_PREFIX') or wale.get('WALG_S3_PREFIX'):
Expand Down Expand Up @@ -918,6 +919,8 @@ def write_wale_environment(placeholders, prefix, overwrite):

elif wale.get("WALG_SSH_PREFIX"):
write_envdir_names = ssh_names + walg_names
elif wale.get("WALG_FILE_PREFIX"):
write_envdir_names = file_names + walg_names
else:
return

Expand Down

0 comments on commit 853ddc2

Please sign in to comment.