diff --git a/pkg/coordinatormanager/coordinator_informer.go b/pkg/coordinatormanager/coordinator_informer.go index 5e60066deb..7bfa7799af 100644 --- a/pkg/coordinatormanager/coordinator_informer.go +++ b/pkg/coordinatormanager/coordinator_informer.go @@ -24,7 +24,6 @@ import ( "github.com/spidernet-io/spiderpool/pkg/utils" stringutil "github.com/spidernet-io/spiderpool/pkg/utils/string" networkingv1 "k8s.io/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/meta" "github.com/cilium/cilium/pkg/ipam/option" clientset "github.com/spidernet-io/spiderpool/pkg/k8s/client/clientset/versioned" @@ -554,7 +553,7 @@ func (cc *CoordinatorController) fetchServiceCIDR(ctx context.Context, logger *z var serviceCIDR networkingv1.ServiceCIDRList err := cc.APIReader.List(ctx, &serviceCIDR) - if err != nil && meta.IsNoMatchError(err) { + if err != nil { event.EventRecorder.Eventf( coordCopy, corev1.EventTypeWarning, diff --git a/test/Makefile b/test/Makefile index 9c428a2945..30441c47fe 100644 --- a/test/Makefile +++ b/test/Makefile @@ -152,7 +152,15 @@ setup_kind: else \ sed -i ''"$${INSERT_LINE}"' a \ podSubnet: "$(CLUSTER_POD_SUBNET_V4),$(CLUSTER_POD_SUBNET_V6)"' $${NEW_KIND_YAML} ; \ sed -i ''"$${INSERT_LINE}"' a \ serviceSubnet: "$(K8S_IPV4_SERVICE_CIDR),$(K8S_IPV6_SERVICE_CIDR)"' $${NEW_KIND_YAML} ; \ - fi + fi ; \ + MultiCIDRServiceGateVersion="v1.29.0" ; \ + if [ $$(echo -e "$(E2E_KIND_IMAGE_TAG)\n$${MultiCIDRServiceGateVersion}" | sort -V | tail -n1) == "$(E2E_KIND_IMAGE_TAG)" ]; then \ + echo "the following features are only fully supported in versions higher than $${MultiCIDRServiceGateVersion}." ; \ + sed -i '$$ a\featureGates: ' $${NEW_KIND_YAML} ; \ + sed -i '$$ a\ MultiCIDRServiceAllocator: true' $${NEW_KIND_YAML} ; \ + sed -i '$$ a\runtimeConfig: ' $${NEW_KIND_YAML} ; \ + sed -i '$$ a\ api/alpha: "true"' $${NEW_KIND_YAML} ; \ + fi $(QUIET) cat $(CLUSTER_DIR)/$(E2E_CLUSTER_NAME)/kind-config.yaml KIND_OPTION="" ; \ [ -n "$(E2E_KIND_IMAGE_TAG)" ] && KIND_OPTION=" --image $(E2E_KIND_IMAGE_NAME):$(E2E_KIND_IMAGE_TAG) " && echo "setup kind with $(E2E_KIND_IMAGE_NAME):$(E2E_KIND_IMAGE_TAG)"; \ diff --git a/test/scripts/install-default-cni.sh b/test/scripts/install-default-cni.sh index 3018a24c76..fe7f1c861a 100755 --- a/test/scripts/install-default-cni.sh +++ b/test/scripts/install-default-cni.sh @@ -194,7 +194,8 @@ function install_cilium() { --set tunnel=disabled \ --set ipv6NativeRoutingCIDR=${CILIUM_CLUSTER_POD_SUBNET_V6} \ --set autoDirectNodeRoutes=true \ - --set enableIPv6Masquerade=true " + --set enableIPv6Masquerade=true \ + --set routingMode=native " ;; dual) CILIUM_HELM_OPTIONS+=" --set ipam.operator.clusterPoolIPv4PodCIDRList=${CILIUM_CLUSTER_POD_SUBNET_V4} \ diff --git a/test/yamls/global-kind.yaml b/test/yamls/global-kind.yaml index 2911ca0a24..3a932a3d0d 100644 --- a/test/yamls/global-kind.yaml +++ b/test/yamls/global-kind.yaml @@ -18,7 +18,3 @@ kubeadmConfigPatches: nodes: - role: control-plane - role: worker -featureGates: - "MultiCIDRServiceAllocator": true -runtimeConfig: - "api/alpha": "true"