From c04d86313624b1f8efdaa2ee174f687d1e0b90ba Mon Sep 17 00:00:00 2001 From: PhantomMaa <494078416@qq.com> Date: Wed, 4 Sep 2024 16:59:14 +0800 Subject: [PATCH] fix: orchestrator roleProbe can not work in raft mode Signed-off-by: PhantomMaa <494078416@qq.com> --- addons/orchestrator/templates/cmpd-raft.yaml | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/addons/orchestrator/templates/cmpd-raft.yaml b/addons/orchestrator/templates/cmpd-raft.yaml index 1061a736b..546a91fb5 100644 --- a/addons/orchestrator/templates/cmpd-raft.yaml +++ b/addons/orchestrator/templates/cmpd-raft.yaml @@ -18,19 +18,21 @@ spec: lifecycleActions: roleProbe: - exec: - command: - - /bin/bash - - -c - - | - role=$(curl -s http://127.0.0.1:3000/api/leader-check) - if [[ $role == "\"OK\"" ]]; then - echo -n "primary" - elif [[ $role == "\"Not leader\"" ]]; then - echo -n "secondary" - else - echo -n "" - fi + builtinHandler: custom + customHandler: + exec: + command: + - /bin/bash + - -c + - | + role=$(curl -s http://127.0.0.1:3000/api/leader-check) + if [[ $role == "\"OK\"" ]]; then + echo -n "primary" + elif [[ $role == "\"Not leader\"" ]]; then + echo -n "secondary" + else + echo -n "" + fi services: - name: orchestrator