@@ -27,6 +27,7 @@ e2e_test_install() {
2727 VERSION_AS_NUMBER_1_13_0=" $( get_version_as_number 1.13.0-SNAPSHOT) "
2828 VERSION_AS_NUMBER_1_15_0=" $( get_version_as_number 1.15.0-SNAPSHOT) "
2929 VERSION_AS_NUMBER_1_16_0=" $( get_version_as_number 1.16.0-SNAPSHOT) "
30+ VERSION_AS_NUMBER_1_17_0=" $( get_version_as_number 1.17.0-SNAPSHOT) "
3031
3132 CLUSTER_CRD=" sgclusters.stackgres.io"
3233
@@ -807,7 +808,9 @@ check_cluster_before_security_upgrade() {
807808 jq -Sc ' .
808809 | if .synchronous_mode then . else del(.synchronous_node_count) end
809810 | .postgresql.parameters = (.postgresql.parameters
810- | if .listen_addresses == "localhost" then .listen_addresses = "0.0.0.0" else . end
811+ | if .ssl == null then .ssl = "on" else . end
812+ | if .ssl_cert_file == null then .ssl_cert_file = "/etc/ssl/tls.crt" else . end
813+ | if .ssl_key_file == null then .ssl_key_file = "/etc/ssl/tls.key" else . end
811814 | if .port == null then .port = "5432" else . end
812815 | if .autovacuum_vacuum_cost_delay == "2" then .autovacuum_vacuum_cost_delay = "2ms" else . end
813816 | if .checkpoint_timeout == "30" then .checkpoint_timeout = "30s" else . end
@@ -829,15 +832,21 @@ check_cluster_before_security_upgrade() {
829832 if [ " $CLUSTER_NAME " = " $DISTRIBUTEDLOGS_NAME " ]
830833 then
831834 PREVIOUS_PATRONI_CONFIG=" $( printf ' %s' " $PREVIOUS_PATRONI_CONFIG " | jq -Sc ' .
832- | del(.postgresql.parameters.dynamic_library_path)
833835 | del(.postgresql.recovery_conf)
834836 ' ) "
835837 fi
836838 if [ " $CLUSTER_NAME " = " $DISTRIBUTEDLOGS_NAME " ] \
837- && [ " $PREVIOUS_VERSION_AS_NUMBER " -lt " $VERSION_AS_NUMBER_1_15_0 " ]
839+ && [ " $PREVIOUS_VERSION_AS_NUMBER " -lt " $VERSION_AS_NUMBER_1_17_0 " ]
838840 then
839841 PREVIOUS_PATRONI_CONFIG=" $( printf ' %s' " $PREVIOUS_PATRONI_CONFIG " | jq -Sc ' .
840- | del(.postgresql.parameters.listen_addresses)
842+ | del(.postgresql.parameters.ssl)
843+ | del(.postgresql.parameters.ssl_cert_file)
844+ | del(.postgresql.parameters.ssl_key_file)
845+ ' ) "
846+ PATRONI_CONFIG=" $( printf ' %s' " $PATRONI_CONFIG " | jq -Sc ' .
847+ | del(.postgresql.parameters.ssl)
848+ | del(.postgresql.parameters.ssl_cert_file)
849+ | del(.postgresql.parameters.ssl_key_file)
841850 ' ) "
842851 fi
843852
@@ -861,6 +870,7 @@ check_cluster_before_security_upgrade() {
861870 PGBOUNCER_CONFIG=" $( kubectl get configmap -n " $CLUSTER_NAMESPACE " " $CLUSTER_NAME -connection-pooling-config" --template ' {{ index .data "pgbouncer.ini" }}' ) "
862871 PGBOUNCER_CONFIG=" $( printf ' %s' " $PGBOUNCER_CONFIG " ) "
863872 cat " $PREVIOUS_PGBOUNCER_CONFIG_PATH " \
873+ | sed ' \#^auth_user = #a client_tls_cert_file = /etc/ssl/tls.crt\nclient_tls_key_file = /etc/ssl/tls.key\nclient_tls_sslmode = prefer' \
864874 | sed ' /server_check_query = ;/d' \
865875 | sed ' s/stats_users = /server_check_query = ;\nstats_users = /' > " $LOG_PATH /previous-pgbouncer-config-filtered.ini"
866876 PREVIOUS_PGBOUNCER_CONFIG=" $( cat " $LOG_PATH /previous-pgbouncer-config-filtered.ini" ) "
@@ -901,19 +911,15 @@ check_sharded_cluster_security_upgrade() {
901911 local SHARDED_CLUSTER_NAME=" $1 "
902912 local DBOPS_NAME=" $2 "
903913 local METHOD=" $3 "
904- local CLUSTERS=" $4 "
905914 local PRIMARY_INSTANCE
906915 local CLUSTER_NAME
907916 shift 3
908917
909918 assert_sharded_dbops_completion " $DBOPS_NAME " " $CLUSTER_NAMESPACE " " $(( E2 E_TIMEOUT * 2 )) "
910919
911920 for CLUSTER_NAME in " $SHARDED_CLUSTER_NAME -coord" \
912- $( seq 0 " $(( CLUSTERS - 1 )) " \
913- | while read INDEX
914- do
915- printf %s " $SHARDED_CLUSTER_NAME -shard$INDEX "
916- done)
921+ " $SHARDED_CLUSTER_NAME -shard0" \
922+ " $SHARDED_CLUSTER_NAME -shard1"
917923 do
918924 check_cluster_after_security_upgrade
919925 done
0 commit comments