Skip to content

Commit

Permalink
Make liveness probe work with old etcdbr
Browse files Browse the repository at this point in the history
  • Loading branch information
jknipper committed Nov 8, 2023
1 parent df7e9fc commit 7530734
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/all/api-liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ func main() {
current := 0
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
if line := scanner.Text(); strings.HasPrefix(line, "etcdbr_restoration_duration_seconds_count{restore=\"single_node\",succeeded=\"true\"}") {
if line := scanner.Text(); strings.HasPrefix(line, "etcdbr_restoration_duration_seconds_count{succeeded=\"true\"}") ||
strings.HasPrefix(line, "etcdbr_restoration_duration_seconds_count{restore=\"single_node\",succeeded=\"true\"}") {
c := strings.Split(line, " ")
if current, err = strconv.Atoi(c[1]); err != nil {
log.Fatalf("Error converting current: %s", err)
Expand Down

0 comments on commit 7530734

Please sign in to comment.