mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
commit
144708beac
@ -128,7 +128,7 @@ func NewResourceQuotaController(options *ResourceQuotaControllerOptions) (*Resou
|
|||||||
// responsible for enqueue of all resource quotas when doing a full resync (enqueueAll)
|
// responsible for enqueue of all resource quotas when doing a full resync (enqueueAll)
|
||||||
oldResourceQuota := old.(*v1.ResourceQuota)
|
oldResourceQuota := old.(*v1.ResourceQuota)
|
||||||
curResourceQuota := cur.(*v1.ResourceQuota)
|
curResourceQuota := cur.(*v1.ResourceQuota)
|
||||||
if quota.V1Equals(oldResourceQuota.Spec.Hard, curResourceQuota.Spec.Hard) {
|
if quota.Equals(oldResourceQuota.Spec.Hard, curResourceQuota.Spec.Hard) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rq.addQuota(curResourceQuota)
|
rq.addQuota(curResourceQuota)
|
||||||
|
@ -45,25 +45,6 @@ func Equals(a corev1.ResourceList, b corev1.ResourceList) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// V1Equals returns true if the two lists are equivalent
|
|
||||||
func V1Equals(a corev1.ResourceList, b corev1.ResourceList) bool {
|
|
||||||
if len(a) != len(b) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for key, value1 := range a {
|
|
||||||
value2, found := b[key]
|
|
||||||
if !found {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if value1.Cmp(value2) != 0 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// LessThanOrEqual returns true if a < b for each key in b
|
// LessThanOrEqual returns true if a < b for each key in b
|
||||||
// If false, it returns the keys in a that exceeded b
|
// If false, it returns the keys in a that exceeded b
|
||||||
func LessThanOrEqual(a corev1.ResourceList, b corev1.ResourceList) (bool, []corev1.ResourceName) {
|
func LessThanOrEqual(a corev1.ResourceList, b corev1.ResourceList) (bool, []corev1.ResourceName) {
|
||||||
|
Loading…
Reference in New Issue
Block a user