fix typo enque should be enqueue
This commit is contained in:
		@@ -131,9 +131,9 @@ func newMetaAllocator(client networkingv1alpha1client.NetworkingV1alpha1Interfac
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	_, _ = serviceCIDRInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
 | 
						_, _ = serviceCIDRInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
 | 
				
			||||||
		AddFunc: c.enqueServiceCIDR,
 | 
							AddFunc: c.enqueueServiceCIDR,
 | 
				
			||||||
		UpdateFunc: func(old, new interface{}) {
 | 
							UpdateFunc: func(old, new interface{}) {
 | 
				
			||||||
			c.enqueServiceCIDR(new)
 | 
								c.enqueueServiceCIDR(new)
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		// Process the deletion directly in the handler to be able to use the object fields
 | 
							// Process the deletion directly in the handler to be able to use the object fields
 | 
				
			||||||
		// without having to cache them. ServiceCIDRs are protected by finalizers
 | 
							// without having to cache them. ServiceCIDRs are protected by finalizers
 | 
				
			||||||
@@ -144,7 +144,7 @@ func newMetaAllocator(client networkingv1alpha1client.NetworkingV1alpha1Interfac
 | 
				
			|||||||
	return c
 | 
						return c
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *MetaAllocator) enqueServiceCIDR(obj interface{}) {
 | 
					func (c *MetaAllocator) enqueueServiceCIDR(obj interface{}) {
 | 
				
			||||||
	key, err := cache.MetaNamespaceKeyFunc(obj)
 | 
						key, err := cache.MetaNamespaceKeyFunc(obj)
 | 
				
			||||||
	if err == nil {
 | 
						if err == nil {
 | 
				
			||||||
		c.queue.Add(key)
 | 
							c.queue.Add(key)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -116,7 +116,7 @@ func TestCIDRAllocateMultiple(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr)
 | 
						r.enqueueServiceCIDR(cidr)
 | 
				
			||||||
	// wait for the cidr to be processed and set the informer synced
 | 
						// wait for the cidr to be processed and set the informer synced
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
				
			||||||
@@ -155,7 +155,7 @@ func TestCIDRAllocateMultiple(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr2)
 | 
						r.enqueueServiceCIDR(cidr2)
 | 
				
			||||||
	// wait for the cidr to be processed
 | 
						// wait for the cidr to be processed
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("10.0.0.11"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("10.0.0.11"), true)
 | 
				
			||||||
@@ -214,7 +214,7 @@ func TestCIDRAllocateShadow(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr)
 | 
						r.enqueueServiceCIDR(cidr)
 | 
				
			||||||
	// wait for the cidr to be processed and set the informer synced
 | 
						// wait for the cidr to be processed and set the informer synced
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.1.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.1.1"), true)
 | 
				
			||||||
@@ -242,7 +242,7 @@ func TestCIDRAllocateShadow(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr2)
 | 
						r.enqueueServiceCIDR(cidr2)
 | 
				
			||||||
	// wait for the cidr to be processed
 | 
						// wait for the cidr to be processed
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
				
			||||||
@@ -287,7 +287,7 @@ func TestCIDRAllocateGrow(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr)
 | 
						r.enqueueServiceCIDR(cidr)
 | 
				
			||||||
	// wait for the cidr to be processed
 | 
						// wait for the cidr to be processed
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
				
			||||||
@@ -325,7 +325,7 @@ func TestCIDRAllocateGrow(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr2)
 | 
						r.enqueueServiceCIDR(cidr2)
 | 
				
			||||||
	// wait for the cidr to be processed
 | 
						// wait for the cidr to be processed
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.253"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.253"), true)
 | 
				
			||||||
@@ -379,7 +379,7 @@ func TestCIDRAllocateShrink(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr)
 | 
						r.enqueueServiceCIDR(cidr)
 | 
				
			||||||
	// wait for the cidr to be processed
 | 
						// wait for the cidr to be processed
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
				
			||||||
@@ -425,7 +425,7 @@ func TestCIDRAllocateShrink(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr2)
 | 
						r.enqueueServiceCIDR(cidr2)
 | 
				
			||||||
	err = r.client.ServiceCIDRs().Delete(context.Background(), cidr.Name, metav1.DeleteOptions{})
 | 
						err = r.client.ServiceCIDRs().Delete(context.Background(), cidr.Name, metav1.DeleteOptions{})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
@@ -493,7 +493,7 @@ func TestCIDRAllocateDualWrite(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr)
 | 
						r.enqueueServiceCIDR(cidr)
 | 
				
			||||||
	// wait for the cidr to be processed and set the informer synced
 | 
						// wait for the cidr to be processed and set the informer synced
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
				
			||||||
@@ -563,7 +563,7 @@ func TestCIDRAllocateDualWriteCollision(t *testing.T) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		t.Fatal(err)
 | 
							t.Fatal(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	r.enqueServiceCIDR(cidr)
 | 
						r.enqueueServiceCIDR(cidr)
 | 
				
			||||||
	// wait for the cidr to be processed and set the informer synced
 | 
						// wait for the cidr to be processed and set the informer synced
 | 
				
			||||||
	err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
						err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
 | 
				
			||||||
		allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
							allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user