From 8b6b5ea7198e9487ef9cd867b4e9dc63f8c294ac Mon Sep 17 00:00:00 2001 From: Icarus9913 Date: Mon, 21 Aug 2023 20:09:34 +0800 Subject: [PATCH] in dual stack env, support only ipv4 or ipv6 address in SpiderSubnet feature (#2205) Signed-off-by: Icarus9913 --- pkg/ipam/pool_selections.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/ipam/pool_selections.go b/pkg/ipam/pool_selections.go index 0cd25eccaf..3dc1acf179 100644 --- a/pkg/ipam/pool_selections.go +++ b/pkg/ipam/pool_selections.go @@ -105,12 +105,12 @@ func (i *ipam) getPoolFromSubnetAnno(ctx context.Context, pod *corev1.Pod, nic s return nil, fmt.Errorf("there are no subnet specified: %v", subnetAnnoConfig) } - if i.config.EnableIPv4 && len(subnetItem.IPv4) == 0 { - return nil, fmt.Errorf("the pod subnetAnnotation doesn't specify IPv4 SpiderSubnet") - } - if i.config.EnableIPv6 && len(subnetItem.IPv6) == 0 { - return nil, fmt.Errorf("the pod subnetAnnotation doesn't specify IPv6 SpiderSubnet") - } + //if i.config.EnableIPv4 && len(subnetItem.IPv4) == 0 { + // return nil, fmt.Errorf("the pod subnetAnnotation doesn't specify IPv4 SpiderSubnet") + //} + //if i.config.EnableIPv6 && len(subnetItem.IPv6) == 0 { + // return nil, fmt.Errorf("the pod subnetAnnotation doesn't specify IPv6 SpiderSubnet") + //} result := &ToBeAllocated{ NIC: nic,