Skip to content

Commit a8f4934

Browse files
committed
feat: disable Envoy by default
1 parent e04ad24 commit a8f4934

2 files changed

Lines changed: 24 additions & 15 deletions

File tree

stackgres-k8s/e2e/spec/ssl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ ssl_check() {
6666
local EXIT_CODE RESULT
6767
while [ "$RETRY" -gt 0 ]
6868
do
69-
if ! wait_until -t "$((E2E_TIMEOUT / 4))" run_query -m require -h "$CLUSTER_NAME" -i 1 -p 5432
69+
if ! kubectl get sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json | jq .spec.pods.disableEnvoy | grep -qxF true
7070
then
71-
if ! kubectl get sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json | jq .spec.pods.disableEnvoy | grep -qxF true
71+
if ! wait_until -t "$((E2E_TIMEOUT / 4))" run_query -m require -h "$CLUSTER_NAME" -i 1 -p 5432
7272
then
7373
echo "WARNING: SSL was not updated automatically... seems an envoy bug, will restart it"
7474
kubectl delete pod -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME-0"
@@ -93,16 +93,16 @@ ssl_check() {
9393
local EXIT_CODE RESULT
9494
while [ "$RETRY" -gt 0 ]
9595
do
96-
if ! wait_until -t "$((E2E_TIMEOUT / 4))" run_query -m require -h "$CLUSTER_NAME"-replicas -i 0 -p 5432
96+
if ! kubectl get sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json | jq .spec.pods.disableEnvoy | grep -qxF true
9797
then
98-
if ! kubectl get sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json | jq .spec.pods.disableEnvoy | grep -qxF true
98+
if ! wait_until -t "$((E2E_TIMEOUT / 4))" run_query -m require -h "$CLUSTER_NAME"-replicas -i 0 -p 5432
9999
then
100100
echo "WARNING: SSL was not updated automatically... seems an envoy bug, will restart it"
101+
kubectl delete pod -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME-1"
102+
wait_pods_running "$CLUSTER_NAMESPACE" 2
103+
wait_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
104+
switch_cluster_to_first "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
101105
fi
102-
kubectl delete pod -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME-1"
103-
wait_pods_running "$CLUSTER_NAMESPACE" 2
104-
wait_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
105-
switch_cluster_to_first "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
106106
fi
107107
try_function wait_until -t "$((E2E_TIMEOUT / 4))" run_query -m require -h "$CLUSTER_NAME"-replicas -i 0 -p 5432
108108
if "$RESULT"

stackgres-k8s/e2e/utils/connectivity

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@ check_connectivity(){
44
RESPONSE_5432="$(wait_until run_query -p 5432 "$@")"
55
RESPONSE_6432="$(wait_until run_query -p 6432 "$@")"
66

7-
RESPONSE_7432="$(wait_until run_query -p 7432 "$@")"
8-
RESPONSE_7433="$(wait_until run_query -p 7433 "$@")"
9-
10-
if [ "$RESPONSE_5432" = "1" ] && [ "$RESPONSE_6432" = "1" ] && [ "$RESPONSE_7432" = "1" ] && [ "$RESPONSE_7433" = "1" ]
7+
if ! kubectl get sgcluster -n "$CLUSTER_NAMESPACE" "$CLUSTER_NAME" -o json | jq .spec.pods.disableEnvoy | grep -qxF true
118
then
12-
return 0
13-
else
14-
return 1
9+
RESPONSE_7432="$(wait_until run_query -p 7432 "$@")"
10+
RESPONSE_7433="$(wait_until run_query -p 7433 "$@")"
11+
if [ "$RESPONSE_5432" = "1" ] && [ "$RESPONSE_6432" = "1" ] && [ "$RESPONSE_7432" = "1" ] && [ "$RESPONSE_7433" = "1" ]
12+
then
13+
return 0
14+
else
15+
return 1
16+
fi
17+
else
18+
if [ "$RESPONSE_5432" = "1" ] && [ "$RESPONSE_6432" = "1" ]
19+
then
20+
return 0
21+
else
22+
return 1
23+
fi
1524
fi
1625
}
1726

0 commit comments

Comments
 (0)