Skip to content

Commit 7af69a8

Browse files
committed
version: 1.18.0-SNAPSHOT
1 parent e5cb703 commit 7af69a8

176 files changed

Lines changed: 3025 additions & 454 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

stackgres-k8s/e2e/spec/operator-helm

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ e2e_test() {
2424
run_test "Check that operator can not be upgrade from an alpha version" check_operator_upgrade_alpha
2525
run_test "Check that operator can not be upgrade from a beta version" check_operator_upgrade_beta
2626
run_test "Check that operator can not be upgrade from version 0.9.5" check_operator_upgrade_0_9_5
27-
run_test "Check that operator can be upgrade from version 1.15.0" check_operator_upgrade_1_15_0
28-
run_test "Check that operator can be upgrade from version 1.16.0" check_operator_upgrade_1_16_0
27+
run_test "Check that operator can be upgrade from 1st older minor version" check_operator_upgrade_first_old_minor
28+
run_test "Check that operator can be upgrade from 2nd older minor version" check_operator_upgrade_second_old_minor
2929
run_test "Check that operator can not be upgrade with an SGCluster that uses version 0.9.5" check_operator_upgrade_with_cluster_using_0_9_5
30-
run_test "Check that operator can be upgrade with an SGCluster that uses version 1.15.0 and 1.16.0" check_operator_upgrade_with_cluster_using_1_15_0_and_1_16_0
30+
run_test "Check that operator can be upgrade with an SGCluster that uses 1st and 2nd older minot versions" check_operator_upgrade_with_cluster_using_first_and_second_old_versions
3131
run_test "Check that operator can be deleted" check_operator_delete
3232
run_test "Check that operator can be installed from outside" check_operator_install_outside
3333
run_test "Check that operator can be installed with load balancer" check_operator_install_load_balancer
@@ -163,31 +163,45 @@ check_operator_upgrade_0_9_5() {
163163
fi
164164
}
165165

166-
check_operator_upgrade_1_15_0() {
167-
local PREVIOUS_VERSION=1.15.0
166+
check_operator_upgrade_first_old_minor() {
167+
local PREVIOUS_VERSION="$(
168+
FIRST_OLDER_MINOR_VERSION="${STACKGRES_VERSION%.*}"
169+
FIRST_OLDER_MINOR_VERSION="${FIRST_OLDER_MINOR_VERSION#*.}"
170+
printf '%s.%s.%s' \
171+
"${STACKGRES_VERSION%%.*}" \
172+
"$((FIRST_OLDER_MINOR_VERSION - 1))" \
173+
"${STACKGRES_VERSION##*.}"
174+
)"
168175
kubectl label deployment -n "$OPERATOR_NAMESPACE" stackgres-operator \
169176
--overwrite "version=$PREVIOUS_VERSION"
170177
local EXIT_CODE RESULT
171178
try_function upgrade_operator
172179
if "$RESULT"
173180
then
174-
success "Upgrade did not failed when previous version was 1.15.0"
181+
success "Upgrade did not failed when previous version was $PREVIOUS_VERSION"
175182
else
176-
fail "Upgrade failed when previous version was 1.15.0"
183+
fail "Upgrade failed when previous version was $PREVIOUS_VERSION"
177184
fi
178185
}
179186

180-
check_operator_upgrade_1_16_0() {
181-
local PREVIOUS_VERSION=1.16.0
187+
check_operator_upgrade_second_old_minor() {
188+
local PREVIOUS_VERSION="$(
189+
FIRST_OLDER_MINOR_VERSION="${STACKGRES_VERSION%.*}"
190+
FIRST_OLDER_MINOR_VERSION="${FIRST_OLDER_MINOR_VERSION#*.}"
191+
printf '%s.%s.%s' \
192+
"${STACKGRES_VERSION%%.*}" \
193+
"$((FIRST_OLDER_MINOR_VERSION - 2))" \
194+
"${STACKGRES_VERSION##*.}"
195+
)"
182196
kubectl label deployment -n "$OPERATOR_NAMESPACE" stackgres-operator \
183197
--overwrite "version=$PREVIOUS_VERSION"
184198
local EXIT_CODE RESULT
185199
try_function upgrade_operator
186200
if "$RESULT"
187201
then
188-
success "Upgrade did not failed when previous version was 1.16.0"
202+
success "Upgrade did not failed when previous version was $PREVIOUS_VERSION"
189203
else
190-
fail "Upgrade failed when previous version was 1.16.0"
204+
fail "Upgrade failed when previous version was $PREVIOUS_VERSION"
191205
fi
192206
}
193207

@@ -214,13 +228,27 @@ check_operator_upgrade_with_cluster_using_0_9_5() {
214228
remove_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
215229
}
216230

217-
check_operator_upgrade_with_cluster_using_1_15_0_and_1_16_0() {
231+
check_operator_upgrade_with_cluster_using_first_and_second_old_versions() {
218232
CLUSTER_1_NAME="$(get_sgcluster_name "$SPEC_NAME-1")"
219233
CLUSTER_2_NAME="$(get_sgcluster_name "$SPEC_NAME-2")"
220234
NODE_LABEL_KEY="$(random_string)"
221235
NODE_LABEL_VALUE="$(random_string)"
222-
local PREVIOUS_VERSION_1=1.15.0
223-
local PREVIOUS_VERSION_2=1.16.0
236+
local PREVIOUS_VERSION_1="$(
237+
FIRST_OLDER_MINOR_VERSION="${STACKGRES_VERSION%.*}"
238+
FIRST_OLDER_MINOR_VERSION="${FIRST_OLDER_MINOR_VERSION#*.}"
239+
printf '%s.%s.%s' \
240+
"${STACKGRES_VERSION%%.*}" \
241+
"$((FIRST_OLDER_MINOR_VERSION - 1))" \
242+
"${STACKGRES_VERSION##*.}"
243+
)"
244+
local PREVIOUS_VERSION_2="$(
245+
SECOND_OLDER_MINOR_VERSION="${STACKGRES_VERSION%.*}"
246+
SECOND_OLDER_MINOR_VERSION="${SECOND_OLDER_MINOR_VERSION#*.}"
247+
printf '%s.%s.%s' \
248+
"${STACKGRES_VERSION%%.*}" \
249+
"$((SECOND_OLDER_MINOR_VERSION - 2))" \
250+
"${STACKGRES_VERSION##*.}"
251+
)"
224252
create_or_replace_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE" 1 \
225253
--set cluster.create=false \
226254
--set-string cluster.postgres.version=13.9
@@ -246,9 +274,9 @@ check_operator_upgrade_with_cluster_using_1_15_0_and_1_16_0() {
246274
try_function upgrade_operator
247275
if "$RESULT"
248276
then
249-
success "Upgrade did not failed with an SGCluster that uses version 1.15.0 and 1.16.0"
277+
success "Upgrade did not failed with an SGCluster that uses version $PREVIOUS_VERSION_1 and $PREVIOUS_VERSION_2"
250278
else
251-
fail "Upgrade failed with an SGCluster that uses version 1.15.0 and 1.16.0"
279+
fail "Upgrade failed with an SGCluster that uses version $PREVIOUS_VERSION_1 and $PREVIOUS_VERSION_2"
252280
fi
253281
remove_cluster "$CLUSTER_1_NAME" "$CLUSTER_NAMESPACE"
254282
remove_cluster "$CLUSTER_2_NAME" "$CLUSTER_NAMESPACE"

stackgres-k8s/e2e/spec/previous/1.15/spec/stream-to-cloudevent.files/Dockerfile

Lines changed: 0 additions & 39 deletions
This file was deleted.

stackgres-k8s/e2e/spec/previous/1.15/spec/stream-to-cloudevent.files/index.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

stackgres-k8s/e2e/spec/previous/1.15/spec/stream-to-cloudevent.files/package.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

stackgres-k8s/e2e/spec/previous/1.15/spec/abstract/backup renamed to stackgres-k8s/e2e/spec/previous/1.17/spec/abstract/backup

File renamed without changes.

stackgres-k8s/e2e/spec/previous/1.15/spec/abstract/dbops-major-version-upgrade renamed to stackgres-k8s/e2e/spec/previous/1.17/spec/abstract/dbops-major-version-upgrade

File renamed without changes.

stackgres-k8s/e2e/spec/previous/1.15/spec/abstract/dbops-minor-version-upgrade renamed to stackgres-k8s/e2e/spec/previous/1.17/spec/abstract/dbops-minor-version-upgrade

File renamed without changes.

stackgres-k8s/e2e/spec/previous/1.15/spec/abstract/dbops-pgbench renamed to stackgres-k8s/e2e/spec/previous/1.17/spec/abstract/dbops-pgbench

File renamed without changes.

stackgres-k8s/e2e/spec/previous/1.15/spec/abstract/dbops-restart renamed to stackgres-k8s/e2e/spec/previous/1.17/spec/abstract/dbops-restart

File renamed without changes.

stackgres-k8s/e2e/spec/previous/1.15/spec/abstract/metrics renamed to stackgres-k8s/e2e/spec/previous/1.17/spec/abstract/metrics

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,30 @@ check_metrics() {
2121
fi
2222
done
2323

24-
if kubectl exec -i -n "$CLUSTER_NAMESPACE" curl \
25-
-- curl -s -f "http://$CLUSTER_POD_IP:8001/stats/prometheus" \
26-
| grep -q "^envoy_postgres_ingress_postgres_sessions"
24+
if ! kubectl get sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" --template '{{ .spec.pods.disableEnvoy }}' | grep -qxF true
2725
then
28-
echo "Envoy metric envoy_postgres_ingress_postgres_sessions was found"
29-
else
30-
echo "Envoy metric envoy_postgres_ingress_postgres_sessions wasn't found"
31-
return 1
32-
fi
33-
34-
for ENVOY_CLUSTER in patroni_cluster postgres_cluster postgres_cluster_pool
35-
do
3626
if kubectl exec -i -n "$CLUSTER_NAMESPACE" curl \
3727
-- curl -s -f "http://$CLUSTER_POD_IP:8001/stats/prometheus" \
38-
| grep "^envoy_cluster_upstream_cx_active" \
39-
| grep -q "envoy_cluster_name=\"$ENVOY_CLUSTER\""
28+
| grep -q "^envoy_postgres_ingress_postgres_sessions"
4029
then
41-
echo "Envoy metric envoy_cluster_upstream_cx_active for cluster $ENVOY_CLUSTER was found"
30+
echo "Envoy metric envoy_postgres_ingress_postgres_sessions was found"
4231
else
43-
echo "Envoy metric envoy_cluster_upstream_cx_active for cluster $ENVOY_CLUSTER wasn't found"
32+
echo "Envoy metric envoy_postgres_ingress_postgres_sessions wasn't found"
4433
return 1
4534
fi
46-
done
35+
36+
for ENVOY_CLUSTER in patroni_cluster postgres_cluster postgres_cluster_pool
37+
do
38+
if kubectl exec -i -n "$CLUSTER_NAMESPACE" curl \
39+
-- curl -s -f "http://$CLUSTER_POD_IP:8001/stats/prometheus" \
40+
| grep "^envoy_cluster_upstream_cx_active" \
41+
| grep -q "envoy_cluster_name=\"$ENVOY_CLUSTER\""
42+
then
43+
echo "Envoy metric envoy_cluster_upstream_cx_active for cluster $ENVOY_CLUSTER was found"
44+
else
45+
echo "Envoy metric envoy_cluster_upstream_cx_active for cluster $ENVOY_CLUSTER wasn't found"
46+
return 1
47+
fi
48+
done
49+
fi
4750
}

0 commit comments

Comments
 (0)