Compare commits

...

3 Commits

Author SHA1 Message Date
amery 4402555f04 Merge pull request 'cluster: ensure ceph monitors are set when loading a config file' (#23)
Reviewed-on: #23
2023-09-12 15:21:25 +02:00
amery 6e7f24f491 cluster: ensure ceph monitors are set when loading a config file
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-12 12:47:24 +00:00
amery 54b302c6d5 vscode: add asciigoat, cyclomatic and Wrapf to the dictionary
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-12 12:47:18 +00:00
3 changed files with 9 additions and 1 deletions
+3
View File
@@ -1,9 +1,12 @@
{ {
"cSpell.words": [ "cSpell.words": [
"asciigoat",
"ceph", "ceph",
"cyclomatic",
"darvaza", "darvaza",
"gofrs", "gofrs",
"jpictl", "jpictl",
"Wrapf",
"zerolog" "zerolog"
] ]
} }
+5 -1
View File
@@ -71,7 +71,7 @@ func newCephScanTODO(cfg *ceph.Config) *cephScanTODO {
return todo return todo
} }
func (m *Cluster) scanCephMonitors(_ *ScanOptions) error { func (m *Cluster) scanCephMonitors(opts *ScanOptions) error {
cfg, err := m.GetCephConfig() cfg, err := m.GetCephConfig()
switch { switch {
case os.IsNotExist(err): case os.IsNotExist(err):
@@ -94,6 +94,10 @@ func (m *Cluster) scanCephMonitors(_ *ScanOptions) error {
todo.LogMissing(m.log) todo.LogMissing(m.log)
} }
return m.initCephMonitors(opts)
}
func (m *Cluster) initCephMonitors(_ *ScanOptions) error {
// make sure every zone has one // make sure every zone has one
m.ForEachZone(func(z *Zone) bool { m.ForEachZone(func(z *Zone) bool {
_ = z.GetCephMonitors() _ = z.GetCephMonitors()
+1
View File
@@ -14,6 +14,7 @@ func (m *Cluster) init(opts *ScanOptions) error {
m.scanZoneIDs, m.scanZoneIDs,
m.scanSort, m.scanSort,
m.scanGateways, m.scanGateways,
m.initCephMonitors,
m.initRegions, m.initRegions,
} { } {
if err := fn(opts); err != nil { if err := fn(opts); err != nil {