Do not issue freespace metric when free-space is 0.
This commit is contained in:
parent
0b25f9ce60
commit
060ef812b2
|
@ -127,8 +127,12 @@ func (disk *Informer) GetMetrics(ctx context.Context) []api.Metric {
|
|||
total := repoStat.StorageMax
|
||||
if size < total {
|
||||
metric = total - size
|
||||
} else { // Make sure we don't underflow
|
||||
} else {
|
||||
// Make sure we don't underflow and stop
|
||||
// sending this metric when space is exhausted.
|
||||
metric = 0
|
||||
valid = false
|
||||
logger.Warn("reported freespace is 0")
|
||||
}
|
||||
case MetricRepoSize:
|
||||
metric = repoStat.RepoSize
|
||||
|
|
Loading…
Reference in New Issue
Block a user