Skip to content

Commit

Permalink
chore: update roles (apecloud#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanshanying authored Mar 12, 2024
1 parent 2a9a4e6 commit 9347226
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/mogdb/templates/clusterdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ spec:
workloadType: Stateful
rsmSpec:
roles:
- name: Primary
- name: primary
accessMode: ReadWrite
isLeader: true
- name: Standby
- name: secondary
accessMode: Readonly
isLeader: false
roleProbe:
Expand All @@ -31,10 +31,10 @@ spec:
- -c
- |
role=$(gsql -h 127.0.0.1 -p 26000 -U ${MOGDB_USER} -W "${MOGDB_PASSWORD}" -dpostgres -t -c "select local_role from pg_stat_get_stream_replications() limit 1" | xargs echo -n)
if [ "$role"x == "Normal"x ]; then
echo -n "Primary"
if [[ "$role"x == "Normal"x || "$role"x == "Primary"x ]]; then
echo -n "primary"
else
echo -n $role
echo -n "secondary"
fi
characterType: mogdb
configSpecs:
Expand Down

0 comments on commit 9347226

Please sign in to comment.