Skip to content

Commit

Permalink
fix: orchestrator roleProbe can not work in raft mode
Browse files Browse the repository at this point in the history
Signed-off-by: PhantomMaa <[email protected]>
  • Loading branch information
PhantomMaa committed Sep 4, 2024
1 parent 3d322a8 commit c04d863
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions addons/orchestrator/templates/cmpd-raft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c04d863

Please sign in to comment.