Skip to content

Commit 7b0f51a

Browse files
authored
chore: improve pg init container scripts (#2463)
1 parent 92f0edb commit 7b0f51a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

addons/postgresql/scripts/init_container.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ cp "$postgres_template_conf_file" "$postgres_conf_dir"
2020
chmod 755 "$postgres_conf_dir"
2121
chmod 664 "$postgres_conf_file"
2222

23-
# Copy wal-g binary
24-
mkdir -p "$postgres_walg_dir"
25-
cp /spilo-init/bin/wal-g ${postgres_walg_dir}/wal-g
23+
# Copy wal-g binary if it exists, the wal-g-archive backup use the spilo image,
24+
# so we need to copy the wal-g binary to the spilo image.
25+
# Why wal-g-archive backup use the spilo image instead of the walg image?
26+
# Because the wal-g-archive uses the pg_waldump binary, which is not in the walg image.
27+
if [ -f /spilo-init/bin/wal-g ]; then
28+
mkdir -p "$postgres_walg_dir"
29+
cp /spilo-init/bin/wal-g ${postgres_walg_dir}/wal-g
30+
fi

0 commit comments

Comments
 (0)