Skip to content

Commit 13948ae

Browse files
authored
Fix timescaledb installation logic (zalando#1079)
- properly delete *.so for different setups - always keep the latest compatible and transition timescaledb ver without specifying in a build arg
1 parent 871b7b9 commit 13948ae

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

delivery.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ pipeline:
3434
--build-arg PGVERSION="$PGVERSION" \
3535
--build-arg BASE_IMAGE="$BASE_IMAGE" \
3636
--build-arg PGOLDVERSIONS="14 15 16" \
37-
--build-arg TIMESCALEDB="2.17.2" \
3837
-t "$ECR_TEST_IMAGE" \
3938
--push .
4039
@@ -64,7 +63,6 @@ pipeline:
6463
--build-arg PGVERSION="$PGVERSION" \
6564
--build-arg BASE_IMAGE="$BASE_IMAGE" \
6665
--build-arg PGOLDVERSIONS="14 15 16" \
67-
--build-arg TIMESCALEDB="2.17.2" \
6866
-t "$ECR_TEST_IMAGE" \
6967
--push .
7068
cdp-promote-image "$ECR_TEST_IMAGE"
@@ -96,7 +94,6 @@ pipeline:
9694
--build-arg PGVERSION="$PGVERSION" \
9795
--build-arg BASE_IMAGE="$BASE_IMAGE" \
9896
--build-arg PGOLDVERSIONS="14 15 16" \
99-
--build-arg TIMESCALEDB="2.17.2" \
10097
-t "$ECR_TEST_IMAGE" \
10198
--push .
10299
cdp-promote-image "$ECR_TEST_IMAGE"

postgres-appliance/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
ARG BASE_IMAGE=ubuntu:22.04
22
ARG PGVERSION=17
3-
ARG TIMESCALEDB="2.15.3 2.18.0"
43
ARG DEMO=false
54
ARG COMPRESS=false
65
ARG ADDITIONAL_LOCALES=
@@ -44,7 +43,6 @@ COPY build_scripts/base.sh /builddeps/
4443
COPY --from=dependencies-builder /builddeps/*.deb /builddeps/
4544

4645
ARG PGVERSION
47-
ARG TIMESCALEDB
4846
ARG TIMESCALEDB_APACHE_ONLY=true
4947
ARG TIMESCALEDB_TOOLKIT=true
5048
ARG COMPRESS

postgres-appliance/build_scripts/base.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
121121
"postgresql-${version}-pg-stat-kcache" \
122122
"${EXTRAS[@]}"
123123

124-
# Clean up timescaledb versions except the highest compatible version
124+
# Clean up timescaledb versions except the highest compatible and transition version
125125
exclude_patterns=()
126-
exclude_patterns_tsl=()
127-
for ts_version in ${TIMESCALEDB}; do
126+
prev_highest_ver="$ts_highest_ver"
127+
ts_highest_ver=$(find "/usr/lib/postgresql/$version/lib/" -name 'timescaledb-2.*.so' | sed -rn 's/.*timescaledb-([1-9]+\.[0-9]+\.[0-9]+)\.so$/\1/p' | sort -rV | head -n1)
128+
if [ "$prev_highest_ver" != "$ts_highest_ver" ]; then
129+
ts_transition_version="$prev_highest_ver"
130+
fi
131+
for ts_version in "$ts_transition_version" "$ts_highest_ver"; do
128132
exclude_patterns+=(! -name timescaledb-"${ts_version}".so)
129-
exclude_patterns_tsl+=(! -name timescaledb-tsl-"${ts_version}".so)
133+
exclude_patterns+=(! -name timescaledb-tsl-"${ts_version}".so)
130134
done
131-
find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-2.*.so' "${exclude_patterns[@]}" -delete;
132-
133-
if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ]; then
134-
find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-tsl-2.*.so' "${exclude_patterns_tsl[@]}" -delete;
135-
fi
135+
find "/usr/lib/postgresql/$version/lib/" \( -name 'timescaledb-2.*.so' -o -name 'timescaledb-tsl-2.*.so' \) "${exclude_patterns[@]}" -delete
136136

137137
# Install 3rd party stuff
138138

0 commit comments

Comments
 (0)