Skip to content

Commit 90431d8

Browse files
committed
feat(wal-e): add WALE_S3_SSE environment variable
1 parent 336b7d8 commit 90431d8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

charts/database/templates/database-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ spec:
4141
value: "{{.Values.global.storage}}"
4242
- name: PGCTLTIMEOUT
4343
value: "{{.Values.postgres.timeout}}"
44+
{{- if eq .Values.global.storage "s3" }}
45+
- name: S3_SSE
46+
value: "{{.Values.s3.use_sse}}"
47+
{{- end}}
4448
lifecycle:
4549
preStop:
4650
exec:

rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
1717
else
1818
echo "https+path://s3-${AWS_REGION}.amazonaws.com:443" > WALE_S3_ENDPOINT
1919
fi
20+
if [[ $S3_SSE ]]; then
21+
echo $S3_SSE > WALE_S3_SSE
22+
else
23+
echo "false" > WALE_S3_SSE
24+
fi
2025
else
2126
AWS_REGION="us-east-1"
2227
BUCKET_NAME="dbwal"

rootfs/patcher-script.d/patch_wal_e_s3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ def wrap_uri_put_file(creds, uri, fp, content_type=None, conn=None):
77
k = s3_util._uri_to_key(creds, uri, conn=conn)
88
if content_type is not None:
99
k.content_type = content_type
10+
encrypt_key = False
1011
if os.getenv('DATABASE_STORAGE') == 's3':
11-
encrypt_key=True
12-
else:
13-
encrypt_key=False
12+
if os.getenv('WALE_S3_SSE', 'false') == 'true':
13+
encrypt_key = True
1414
k.set_contents_from_file(fp, encrypt_key=encrypt_key)
1515
return k
1616
s3.uri_put_file = wrap_uri_put_file

0 commit comments

Comments
 (0)