mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -05:00
Validate tier manager is initialized in tier Empty() check (#14646)
Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
parent
e955aa7f2a
commit
9e25475475
@ -1651,13 +1651,13 @@ func getClusterTierMetrics() *MetricsGroup {
|
|||||||
cacheInterval: 10 * time.Second,
|
cacheInterval: 10 * time.Second,
|
||||||
}
|
}
|
||||||
mg.RegisterRead(func(ctx context.Context) (metrics []Metric) {
|
mg.RegisterRead(func(ctx context.Context) (metrics []Metric) {
|
||||||
if globalTierConfigMgr.Empty() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
objLayer := newObjectLayerFn()
|
objLayer := newObjectLayerFn()
|
||||||
if objLayer == nil || globalIsGateway {
|
if objLayer == nil || globalIsGateway {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if globalTierConfigMgr.Empty() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
dui, err := loadDataUsageFromBackend(GlobalContext, objLayer)
|
dui, err := loadDataUsageFromBackend(GlobalContext, objLayer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -148,6 +148,9 @@ func (config *TierConfigMgr) Verify(ctx context.Context, tier string) error {
|
|||||||
|
|
||||||
// Empty returns if tier targets are empty
|
// Empty returns if tier targets are empty
|
||||||
func (config *TierConfigMgr) Empty() bool {
|
func (config *TierConfigMgr) Empty() bool {
|
||||||
|
if config == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
return len(config.ListTiers()) == 0
|
return len(config.ListTiers()) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user