diff --git a/.flyctl/cmd/pg-failover/main.go b/.flyctl/cmd/pg-failover/main.go index 55f53937..206ce07b 100644 --- a/.flyctl/cmd/pg-failover/main.go +++ b/.flyctl/cmd/pg-failover/main.go @@ -25,7 +25,7 @@ func main() { // Discover keepers that are eligible for promotion. eligibleCount := 0 for _, keeper := range data.Keepers { - if keeper.Status.Healthy && keeper.Status.CanBeMaster != nil && keeper.UID != currentMasterUID { + if keeper.Status.Healthy && keeper.Status.CanBeMaster && keeper.UID != currentMasterUID { fmt.Printf("Keeper %s is eligible! Master is %s\n", keeper.UID, currentMasterUID) eligibleCount++ } diff --git a/pkg/commands/admin.go b/pkg/commands/admin.go index c5346405..1521c65d 100644 --- a/pkg/commands/admin.go +++ b/pkg/commands/admin.go @@ -34,7 +34,7 @@ func handleFailoverTrigger(w http.ResponseWriter, r *http.Request) { // Discover keepers that are eligible for promotion. eligibleCount := 0 for _, keeper := range data.Keepers { - if keeper.Status.Healthy && keeper.Status.CanBeMaster != nil && keeper.UID != currentMasterUID { + if keeper.Status.Healthy && keeper.Status.CanBeMaster && keeper.UID != currentMasterUID { fmt.Printf("Keeper %s is eligible! Master is %s\n", keeper.UID, currentMasterUID) eligibleCount++ } diff --git a/pkg/flypg/stolon/clusterdata.go b/pkg/flypg/stolon/clusterdata.go index 51463252..cfa46e5b 100644 --- a/pkg/flypg/stolon/clusterdata.go +++ b/pkg/flypg/stolon/clusterdata.go @@ -253,7 +253,7 @@ type KeeperStatus struct { ForceFail bool `json:"forceFail,omitempty"` - CanBeMaster *bool `json:"canBeMaster,omitempty"` + CanBeMaster bool `json:"canBeMaster,omitempty"` CanBeSynchronousReplica *bool `json:"canBeSynchronousReplica,omitempty"` }