Move types.Volumes optional fields under a new type
This allows us to hide those fields when they are not filled. Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> Upstream-commit: d36952749d7db1a7dac40f7ddf3ed485f23b33fc Component: engine
This commit is contained in:
@ -288,7 +288,7 @@ func (c *diskUsageVolumesContext) Active() string {
|
||||
|
||||
used := 0
|
||||
for _, v := range c.volumes {
|
||||
if v.RefCount > 0 {
|
||||
if v.UsageData.RefCount > 0 {
|
||||
used++
|
||||
}
|
||||
}
|
||||
@ -301,8 +301,8 @@ func (c *diskUsageVolumesContext) Size() string {
|
||||
|
||||
c.AddHeader(sizeHeader)
|
||||
for _, v := range c.volumes {
|
||||
if v.Size != -1 {
|
||||
size += v.Size
|
||||
if v.UsageData.Size != -1 {
|
||||
size += v.UsageData.Size
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,11 +315,11 @@ func (c *diskUsageVolumesContext) Reclaimable() string {
|
||||
|
||||
c.AddHeader(reclaimableHeader)
|
||||
for _, v := range c.volumes {
|
||||
if v.Size != -1 {
|
||||
if v.RefCount == 0 {
|
||||
reclaimable += v.Size
|
||||
if v.UsageData.Size != -1 {
|
||||
if v.UsageData.RefCount == 0 {
|
||||
reclaimable += v.UsageData.Size
|
||||
}
|
||||
totalSize += v.Size
|
||||
totalSize += v.UsageData.Size
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user