Skip to content

Commit

Permalink
fix typo enque should be enqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
aojea committed Jun 27, 2024
1 parent 9b1bad4 commit fed0517
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pkg/registry/core/service/ipallocator/cidrallocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ func newMetaAllocator(client networkingv1alpha1client.NetworkingV1alpha1Interfac
}

_, _ = serviceCIDRInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: c.enqueServiceCIDR,
AddFunc: c.enqueueServiceCIDR,
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
// without having to cache them. ServiceCIDRs are protected by finalizers
Expand All @@ -144,7 +144,7 @@ func newMetaAllocator(client networkingv1alpha1client.NetworkingV1alpha1Interfac
return c
}

func (c *MetaAllocator) enqueServiceCIDR(obj interface{}) {
func (c *MetaAllocator) enqueueServiceCIDR(obj interface{}) {
key, err := cache.MetaNamespaceKeyFunc(obj)
if err == nil {
c.queue.Add(key)
Expand Down
20 changes: 10 additions & 10 deletions pkg/registry/core/service/ipallocator/cidrallocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestCIDRAllocateMultiple(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr)
r.enqueueServiceCIDR(cidr)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
Expand Down Expand Up @@ -155,7 +155,7 @@ func TestCIDRAllocateMultiple(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr2)
r.enqueueServiceCIDR(cidr2)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("10.0.0.11"), true)
Expand Down Expand Up @@ -214,7 +214,7 @@ func TestCIDRAllocateShadow(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr)
r.enqueueServiceCIDR(cidr)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.1.1"), true)
Expand Down Expand Up @@ -242,7 +242,7 @@ func TestCIDRAllocateShadow(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr2)
r.enqueueServiceCIDR(cidr2)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestCIDRAllocateGrow(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr)
r.enqueueServiceCIDR(cidr)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
Expand Down Expand Up @@ -325,7 +325,7 @@ func TestCIDRAllocateGrow(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr2)
r.enqueueServiceCIDR(cidr2)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.253"), true)
Expand Down Expand Up @@ -379,7 +379,7 @@ func TestCIDRAllocateShrink(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr)
r.enqueueServiceCIDR(cidr)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
Expand Down Expand Up @@ -425,7 +425,7 @@ func TestCIDRAllocateShrink(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr2)
r.enqueueServiceCIDR(cidr2)
err = r.client.ServiceCIDRs().Delete(context.Background(), cidr.Name, metav1.DeleteOptions{})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -493,7 +493,7 @@ func TestCIDRAllocateDualWrite(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr)
r.enqueueServiceCIDR(cidr)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
Expand Down Expand Up @@ -563,7 +563,7 @@ func TestCIDRAllocateDualWriteCollision(t *testing.T) {
if err != nil {
t.Fatal(err)
}
r.enqueServiceCIDR(cidr)
r.enqueueServiceCIDR(cidr)
// 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) {
allocator, err := r.getAllocator(netutils.ParseIPSloppy("192.168.0.1"), true)
Expand Down

0 comments on commit fed0517

Please sign in to comment.