File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -2745,7 +2745,37 @@ func TestNodeInitPrimarySubnetExclusionWithoutExistingPodIPs(t *testing.T) {
27452745 useSubnetDiscovery : true , // Enable subnet discovery
27462746 }
27472747
2748- eni1 , eni2 , _ := getDummyENIMetadata ()
2748+ // Create ENI metadata with NO secondary IPs for primary ENI (simulating fresh node)
2749+ primary := true
2750+ notPrimary := false
2751+ testAddr1 := ipaddr01
2752+ testAddr11 := ipaddr11
2753+ testAddr12 := ipaddr12
2754+ eni1 := awsutils.ENIMetadata {
2755+ ENIID : primaryENIid ,
2756+ MAC : primaryMAC ,
2757+ DeviceNumber : primaryDevice ,
2758+ SubnetIPv4CIDR : primarySubnet ,
2759+ IPv4Addresses : []ec2types.NetworkInterfacePrivateIpAddress {
2760+ {
2761+ PrivateIpAddress : & testAddr1 , Primary : & primary , // ← Only primary IP, no secondary IPs
2762+ },
2763+ },
2764+ }
2765+ eni2 := awsutils.ENIMetadata {
2766+ ENIID : secENIid ,
2767+ MAC : secMAC ,
2768+ DeviceNumber : secDevice ,
2769+ SubnetIPv4CIDR : secSubnet ,
2770+ IPv4Addresses : []ec2types.NetworkInterfacePrivateIpAddress {
2771+ {
2772+ PrivateIpAddress : & testAddr11 , Primary : & notPrimary ,
2773+ },
2774+ {
2775+ PrivateIpAddress : & testAddr12 , Primary : & notPrimary ,
2776+ },
2777+ },
2778+ }
27492779
27502780 var cidrs []string
27512781 m .awsutils .EXPECT ().GetENILimit ().Return (4 )
You can’t perform that action at this time.
0 commit comments