cluster: use rings.ZoneID and rings.NodeID types

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2024-06-02 22:04:54 +00:00
parent 4812cb7d5d
commit e33ef0019f
10 changed files with 62 additions and 73 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"git.jpi.io/amery/jpictl/pkg/rings"
"gopkg.in/yaml.v3"
)
@@ -45,7 +46,7 @@ func (m *Cluster) initZones(opts *ScanOptions) error {
func (m *Cluster) initZone(z *Zone, _ *ScanOptions) error {
var hasMissing bool
var lastMachineID int
var lastMachineID rings.NodeID
z.zones = m
z.logger = m
@@ -58,7 +59,7 @@ func (m *Cluster) initZone(z *Zone, _ *ScanOptions) error {
case p.ID == 0:
hasMissing = true
case p.ID > lastMachineID:
lastMachineID = z.ID
lastMachineID = p.ID
}
return false