Skip to content

Commit

Permalink
change readinessprobe to be exec command to check sync info status
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Sep 4, 2024
1 parent 46b918b commit b7f7ea9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 additions & 3 deletions starship/charts/devnet/templates/chains/cosmos/genesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,21 @@ spec:
name: scripts
{{- if not ($chain.cometmock.enabled) }}
readinessProbe:
httpGet:
path: /status
port: 26657
exec:
command:
- bash
- -c
- |
# Try to see if the node is still catching up.
([[ $($CHAIN_BIN status 2>&1 | jq -r .SyncInfo.catching_up) == false ]]) &
tester=$!
# Kill the test if it takes longer than we expect.
(sleep 5; kill $tester 2>/dev/null) &
killer=$!
# Kill the killer before exiting.
trap 'kill $killer 2>/dev/null' EXIT
# Return the test's exit code, whether it succeeded, failed, or was killed.
wait $tester
initialDelaySeconds: 10
periodSeconds: 10
{{- end }}
Expand Down
18 changes: 15 additions & 3 deletions starship/charts/devnet/templates/chains/cosmos/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,21 @@ spec:
name: scripts
{{- if not ($chain.cometmock.enabled) }}
readinessProbe:
httpGet:
path: /status
port: 26657
exec:
command:
- bash
- -c
- |
# Try to see if the node is still catching up.
([[ $($CHAIN_BIN status 2>&1 | jq -r .SyncInfo.catching_up) == false ]]) &
tester=$!
# Kill the test if it takes longer than we expect.
(sleep 5; kill $tester 2>/dev/null) &
killer=$!
# Kill the killer before exiting.
trap 'kill $killer 2>/dev/null' EXIT
# Return the test's exit code, whether it succeeded, failed, or was killed.
wait $tester
initialDelaySeconds: 10
periodSeconds: 10
{{- end }}
Expand Down

0 comments on commit b7f7ea9

Please sign in to comment.