cluster: migrate to using pkg/rings for Addresses [WIP]

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2024-06-03 14:28:38 +00:00
parent 0409cc5e66
commit 9aee20f36f
14 changed files with 216 additions and 163 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import (
"github.com/gofrs/uuid/v5"
"git.jpi.io/amery/jpictl/pkg/ceph"
"git.jpi.io/amery/jpictl/pkg/rings"
)
// GetCephFSID returns our Ceph's FSID
@@ -66,7 +67,7 @@ func (m *Cluster) GenCephConfig() (*ceph.Config, error) {
m.ForEachZone(func(z *Zone) bool {
for _, p := range z.GetCephMonitors() {
addr, _ := RingOneAddress(z.ID, p.ID)
addr, _ := rings.RingOneAddress(z.RegionID(), z.ID, p.ID)
cfg.Global.Monitors = append(cfg.Global.Monitors, p.Name)
cfg.Global.MonitorsAddr = append(cfg.Global.MonitorsAddr, addr)