From 9347226b5031c847657354fa5b6152505b8b152f Mon Sep 17 00:00:00 2001 From: Shanshan Date: Tue, 12 Mar 2024 14:07:00 +0800 Subject: [PATCH] chore: update roles (#370) --- addons/mogdb/templates/clusterdefinition.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/mogdb/templates/clusterdefinition.yaml b/addons/mogdb/templates/clusterdefinition.yaml index 64be2c0b9..280b8e068 100644 --- a/addons/mogdb/templates/clusterdefinition.yaml +++ b/addons/mogdb/templates/clusterdefinition.yaml @@ -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: @@ -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: