"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/quota/v1/resources.go" between
kubernetes-1.18.14.tar.gz and kubernetes-1.18.15.tar.gz

About: Kubernetes is a platform for automating deployment, scaling, and operations of application containers across clusters of hosts (written in "Go"). 1.18.x series.

resources.go  (kubernetes-1.18.14):resources.go  (kubernetes-1.18.15)
skipping to change at line 229 skipping to change at line 229
func IsZero(a corev1.ResourceList) bool { func IsZero(a corev1.ResourceList) bool {
zero := resource.MustParse("0") zero := resource.MustParse("0")
for _, v := range a { for _, v := range a {
if v.Cmp(zero) != 0 { if v.Cmp(zero) != 0 {
return false return false
} }
} }
return true return true
} }
// RemoveZeros returns a new resource list that only has no zero values
func RemoveZeros(a corev1.ResourceList) corev1.ResourceList {
result := corev1.ResourceList{}
for key, value := range a {
if !value.IsZero() {
result[key] = value
}
}
return result
}
// IsNegative returns the set of resource names that have a negative value. // IsNegative returns the set of resource names that have a negative value.
func IsNegative(a corev1.ResourceList) []corev1.ResourceName { func IsNegative(a corev1.ResourceList) []corev1.ResourceName {
results := []corev1.ResourceName{} results := []corev1.ResourceName{}
zero := resource.MustParse("0") zero := resource.MustParse("0")
for k, v := range a { for k, v := range a {
if v.Cmp(zero) < 0 { if v.Cmp(zero) < 0 {
results = append(results, k) results = append(results, k)
} }
} }
return results return results
 End of changes. 1 change blocks. 
0 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)