Add support in UI for custom S3 endpoints for backups (#1152)

* Support custom S3 endpoint for backups

* Log info about AWS S3 endpoint during start up
This commit is contained in:
Jakub Warczarek
2020-10-28 10:56:50 +01:00
committed by GitHub
parent d658b9672e
commit e10e0fec9e
2 changed files with 7 additions and 2 deletions
+4 -2
View File
@@ -16,6 +16,8 @@ logger = getLogger(__name__)
session = Session()
AWS_ENDPOINT = getenv('AWS_ENDPOINT')
OPERATOR_CLUSTER_NAME_LABEL = getenv('OPERATOR_CLUSTER_NAME_LABEL', 'cluster-name')
COMMON_CLUSTER_LABEL = getenv('COMMON_CLUSTER_LABEL', '{"application":"spilo"}')
@@ -266,7 +268,7 @@ def read_stored_clusters(bucket, prefix, delimiter='/'):
return [
prefix['Prefix'].split('/')[-2]
for prefix in these(
client('s3').list_objects(
client('s3', endpoint_url=AWS_ENDPOINT).list_objects(
Bucket=bucket,
Delimiter=delimiter,
Prefix=prefix,
@@ -287,7 +289,7 @@ def read_versions(
return [
'base' if uid == 'wal' else uid
for prefix in these(
client('s3').list_objects(
client('s3', endpoint_url=AWS_ENDPOINT).list_objects(
Bucket=bucket,
Delimiter=delimiter,
Prefix=prefix + pg_cluster + delimiter,