mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #115882 from binacs/binacs/controller-use-issuperset
cleanup(controller): use IsSuperset to avoid interim slice
This commit is contained in:
		@@ -35,7 +35,7 @@ func CheckQueueEq(lhs []string, rhs TimedQueue) bool {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func CheckSetEq(lhs, rhs sets.String) bool {
 | 
					func CheckSetEq(lhs, rhs sets.String) bool {
 | 
				
			||||||
	return lhs.HasAll(rhs.List()...) && rhs.HasAll(lhs.List()...)
 | 
						return lhs.IsSuperset(rhs) && rhs.IsSuperset(lhs)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestAddNode(t *testing.T) {
 | 
					func TestAddNode(t *testing.T) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,7 @@ import (
 | 
				
			|||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"k8s.io/api/core/v1"
 | 
						v1 "k8s.io/api/core/v1"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/api/resource"
 | 
						"k8s.io/apimachinery/pkg/api/resource"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/labels"
 | 
						"k8s.io/apimachinery/pkg/labels"
 | 
				
			||||||
@@ -797,7 +797,7 @@ func TestSyncResourceQuota(t *testing.T) {
 | 
				
			|||||||
		for _, action := range kubeClient.Actions() {
 | 
							for _, action := range kubeClient.Actions() {
 | 
				
			||||||
			actionSet.Insert(strings.Join([]string{action.GetVerb(), action.GetResource().Resource, action.GetSubresource()}, "-"))
 | 
								actionSet.Insert(strings.Join([]string{action.GetVerb(), action.GetResource().Resource, action.GetSubresource()}, "-"))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if !actionSet.HasAll(testCase.expectedActionSet.List()...) {
 | 
							if !actionSet.IsSuperset(testCase.expectedActionSet) {
 | 
				
			||||||
			t.Errorf("test: %s,\nExpected actions:\n%v\n but got:\n%v\nDifference:\n%v", testName, testCase.expectedActionSet, actionSet, testCase.expectedActionSet.Difference(actionSet))
 | 
								t.Errorf("test: %s,\nExpected actions:\n%v\n but got:\n%v\nDifference:\n%v", testName, testCase.expectedActionSet, actionSet, testCase.expectedActionSet.Difference(actionSet))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user