Skip to content

Commit 2ca8173

Browse files
author
Rahul Sharma
committed
make sure disabling ipv6 for nodeipam works
1 parent f3eb36f commit 2ca8173

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cloud/nodeipam/ipam/cloud_allocator.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ func (c *cloudAllocator) AllocateOrOccupyCIDR(ctx context.Context, node *v1.Node
414414
// If IPv6 CIDR allocation is disabled, log and return early.
415415
if c.disableIPv6NodeCIDRAllocation {
416416
logger.V(4).Info("IPv6 CIDR allocation disabled; using only IPv4", "node", klog.KObj(node))
417+
// remove the second CIDR from the allocatedCIDRs slice
418+
// since we are not allocating IPv6 CIDR
419+
allocatedCIDRs = allocatedCIDRs[:1]
417420
return c.enqueueCIDRUpdate(ctx, node.Name, allocatedCIDRs)
418421
}
419422
// Allocate IPv6 CIDR for the node.

0 commit comments

Comments
 (0)