Move resource.Quantity rounding to defaulter

This reverts commit feb56cc486.
This commit is contained in:
Clayton Coleman
2016-10-26 12:18:33 -04:00
parent d089eda524
commit 3ff5cb6ec7
3 changed files with 40 additions and 3 deletions

View File

@@ -739,15 +739,15 @@ func Convert_v1_ResourceList_To_api_ResourceList(in *ResourceList, out *api.Reso
if *in == nil {
return nil
}
if *out == nil {
*out = make(api.ResourceList, len(*in))
}
for key, val := range *in {
// Moved to defaults
// TODO(#18538): We round up resource values to milli scale to maintain API compatibility.
// In the future, we should instead reject values that need rounding.
const milliScale = -3
val.RoundUp(milliScale)
// const milliScale = -3
// val.RoundUp(milliScale)
(*out)[api.ResourceName(key)] = val
}