Make default format right for nil values

This commit is contained in:
derekwaynecarr
2016-02-11 13:49:49 -05:00
parent acb160739f
commit a03361bd84
3 changed files with 22 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ func (self *ResourceList) Cpu() *resource.Quantity {
if val, ok := (*self)[ResourceCPU]; ok {
return &val
}
return &resource.Quantity{}
return &resource.Quantity{Format: resource.DecimalSI}
}
// Returns the Memory limit if specified.
@@ -38,7 +38,7 @@ func (self *ResourceList) Memory() *resource.Quantity {
if val, ok := (*self)[ResourceMemory]; ok {
return &val
}
return &resource.Quantity{}
return &resource.Quantity{Format: resource.BinarySI}
}
func (self *ResourceList) Pods() *resource.Quantity {