|
|
@ -68,7 +68,7 @@ func (m *Cluster) initRegions(_ *ScanOptions) error { |
|
|
|
|
|
|
|
|
|
|
|
// bind first level regions and their zones
|
|
|
|
// bind first level regions and their zones
|
|
|
|
for name, zones := range regions { |
|
|
|
for name, zones := range regions { |
|
|
|
m.syncRegions(name, zones...) |
|
|
|
m.setRegionZones(name, zones...) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// and combine zones to produce larger regions
|
|
|
|
// and combine zones to produce larger regions
|
|
|
@ -81,8 +81,10 @@ func (m *Cluster) initRegions(_ *ScanOptions) error { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (m *Cluster) syncRegions(name string, zones ...*Zone) { |
|
|
|
func (m *Cluster) setRegionZones(name string, zones ...*Zone) { |
|
|
|
for _, r := range m.Regions { |
|
|
|
for i := range m.Regions { |
|
|
|
|
|
|
|
r := &m.Regions[i] |
|
|
|
|
|
|
|
|
|
|
|
if r.Name == name { |
|
|
|
if r.Name == name { |
|
|
|
// found
|
|
|
|
// found
|
|
|
|
r.m = m |
|
|
|
r.m = m |
|
|
|