This repository was archived by the owner on Jan 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 44
44
TMPDIR=$1
45
45
NAMESPACE=$2
46
46
47
- if kubectl -n ${NAMESPACE} get pod ${NAMESPACE} -stolon-keeper-0 ; then
48
- CONTAINER=${NAMESPACE} - stolon-keeper-0
47
+ if kubectl -n ${NAMESPACE} get pods --selector=app= ${NAMESPACE} -stolon-proxy -o jsonpath= ' {.items[*].metadata.name} ' ; then
48
+ CONTAINER=$( kubectl -n $ {NAMESPACE} get pods --selector=app= ${NAMESPACE} - stolon-proxy -o jsonpath= ' {.items[*].metadata.name} ' )
49
49
elif kubectl -n ${NAMESPACE} get pod acid-${NAMESPACE} -0; then
50
50
CONTAINER=acid-${NAMESPACE} -0
51
51
else
Original file line number Diff line number Diff line change 59
59
TMPDIR=$1
60
60
NAMESPACE=$2
61
61
62
- if kubectl -n ${NAMESPACE} get pod ${NAMESPACE} -stolon-keeper-0 > /dev/null 2>&1 ; then
63
- CONTAINER=${NAMESPACE} - stolon-keeper-0
62
+ if kubectl -n ${NAMESPACE} get pods --selector=app= ${NAMESPACE} -stolon-proxy -o jsonpath= ' {.items[*].metadata.name} ' > /dev/null 2>&1 ; then
63
+ CONTAINER=$( kubectl -n $ {NAMESPACE} get pods --selector=app= ${NAMESPACE} - stolon-proxy -o jsonpath= ' {.items[*].metadata.name} ' )
64
64
elif kubectl -n ${NAMESPACE} get pod acid-${NAMESPACE} -1 > /dev/null 2>&1 ; then
65
65
CONTAINER=acid-${NAMESPACE} -0
66
66
else
@@ -120,17 +120,17 @@ if [ -z "${DBONLY}" ]; then
120
120
echo " password:" ${PASSWORD}
121
121
echo " new superpassword:" ${NEW_SUPERPASSWORD}
122
122
123
- echo kubectl -n ${NAMESPACE} exec -i ${CONTAINER} -- /bin/bash -c " export PGPASSWORD=${PASSWORD} ; export PGSSLMODE=require ; psql -h ${HOSTNAME} -U ${USERNAME} -d ${DBNAME} "
123
+ echo kubectl -n ${NAMESPACE} exec -i ${CONTAINER} -- /bin/bash -c " export PGPASSWORD=${PASSWORD} ; export PGSSLMODE=allow ; psql -h ${HOSTNAME} -U ${USERNAME} -d ${DBNAME} "
124
124
125
- if (echo " ALTER USER oisp_user WITH PASSWORD '${NEW_USERPASSWORD} ';" | kubectl -n ${NAMESPACE} exec -i ${CONTAINER} -- /bin/bash -c " export PGPASSWORD=${PASSWORD} ; export PGSSLMODE=require ; psql -h ${HOSTNAME} -U ${USERNAME} -d ${DBNAME} " ); then
125
+ if (echo " ALTER USER oisp_user WITH PASSWORD '${NEW_USERPASSWORD} ';" | kubectl -n ${NAMESPACE} exec -i ${CONTAINER} -- /bin/bash -c " export PGPASSWORD=${PASSWORD} ; export PGSSLMODE=allow ; psql -h ${HOSTNAME} -U ${USERNAME} -d ${DBNAME} " ); then
126
126
echo " User password changed"
127
127
else
128
128
echo " Failed to change user password."
129
129
exit 1;
130
130
fi
131
131
echo " Moving on the superuser"
132
132
133
- echo " ALTER USER superuser WITH PASSWORD '${NEW_SUPERPASSWORD} ';" | kubectl -n ${NAMESPACE} exec -i ${CONTAINER} -- /bin/bash -c " export PGPASSWORD=${PASSWORD} ; export PGSSLMODE=require ; psql -h ${HOSTNAME} -U ${USERNAME} -d ${DBNAME} -h ${HOSTNAME} "
133
+ echo " ALTER USER superuser WITH PASSWORD '${NEW_SUPERPASSWORD} ';" | kubectl -n ${NAMESPACE} exec -i ${CONTAINER} -- /bin/bash -c " export PGPASSWORD=${PASSWORD} ; export PGSSLMODE=allow ; psql -h ${HOSTNAME} -U ${USERNAME} -d ${DBNAME} -h ${HOSTNAME} "
134
134
echo " Password restored"
135
135
else
136
136
SCRIPT_DIR=$( cd -P -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd -P)
You can’t perform that action at this time.
0 commit comments