From d09f4e25c25dced54d688597b5e9a903c456573d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 23 Oct 2024 19:15:51 -0500 Subject: switched to pb.DropletState enum Signed-off-by: Jeff Carr --- http.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'http.go') diff --git a/http.go b/http.go index ba1559a..fd1ff1d 100644 --- a/http.go +++ b/http.go @@ -7,6 +7,7 @@ import ( "time" "go.wit.com/lib/gui/shell" + pb "go.wit.com/lib/protobuf/virtbuf" "go.wit.com/log" ) @@ -23,7 +24,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { // is the cluster running what it should? if tmp == "/droplets" { for _, d := range me.droplets { - if d.pb.StartState != "ON" { + if d.pb.StartState != pb.DropletState_ON { continue } dur := time.Since(d.lastpoll) // Calculate the elapsed time @@ -33,7 +34,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } else { hname = d.h.pb.Hostname } - if d.CurrentState != "ON" { + if d.CurrentState != pb.DropletState_ON { fmt.Fprintln(w, "BAD STATE ", d.pb.Hostname, hname, "(", d.pb.StartState, "vs", d.CurrentState, ")", shell.FormatDuration(dur)) } else { dur := time.Since(d.lastpoll) // Calculate the elapsed time -- cgit v1.2.3