cluster: ensure ceph monitors are set when loading a config file

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-12 00:35:01 +00:00
parent 8b07a8e8fd
commit b267bdfe5f
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -71,7 +71,7 @@ func newCephScanTODO(cfg *ceph.Config) *cephScanTODO {
return todo
}
func (m *Cluster) scanCephMonitors(_ *ScanOptions) error {
func (m *Cluster) scanCephMonitors(opts *ScanOptions) error {
cfg, err := m.GetCephConfig()
switch {
case os.IsNotExist(err):
@@ -94,6 +94,10 @@ func (m *Cluster) scanCephMonitors(_ *ScanOptions) error {
todo.LogMissing(m.log)
}
return m.initCephMonitors(opts)
}
func (m *Cluster) initCephMonitors(_ *ScanOptions) error {
// make sure every zone has one
m.ForEachZone(func(z *Zone) bool {
_ = z.GetCephMonitors()
+1
View File
@@ -14,6 +14,7 @@ func (m *Cluster) init(opts *ScanOptions) error {
m.scanZoneIDs,
m.scanSort,
m.scanGateways,
m.initCephMonitors,
m.initRegions,
} {
if err := fn(opts); err != nil {