mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	remove redundant quota.V1Equals
This commit is contained in:
		@@ -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) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user