From 9b993826708a14fb3dd4e194f23e82a3401d299f Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Wed, 13 Nov 2024 14:44:55 -0600 Subject: [PATCH] fix conflict on azure-cni daemonset in AKS e2e --- test/e2e/aks.go | 9 --------- test/e2e/azure_test.go | 2 -- test/e2e/cni.go | 15 +-------------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/test/e2e/aks.go b/test/e2e/aks.go index 6b01c0a0235..bf59186709f 100644 --- a/test/e2e/aks.go +++ b/test/e2e/aks.go @@ -49,20 +49,11 @@ type DiscoverAndWaitForAKSControlPlaneInput struct { // This will be invoked by cluster api e2e framework. func WaitForAKSControlPlaneInitialized(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, result *clusterctl.ApplyCustomClusterTemplateAndWaitResult) { client := input.ClusterProxy.GetClient() - cluster := framework.GetClusterByName(ctx, framework.GetClusterByNameInput{ - Getter: client, - Name: input.ClusterName, - Namespace: input.Namespace, - }) - DiscoverAndWaitForAKSControlPlaneInitialized(ctx, DiscoverAndWaitForAKSControlPlaneInput{ Lister: client, Getter: client, Cluster: result.Cluster, }, input.WaitForControlPlaneIntervals...) - if cluster.Spec.ClusterNetwork != nil && cluster.Spec.ClusterNetwork.Services != nil { - InstallCNIManifest(ctx, input, cluster.Spec.ClusterNetwork.Services.CIDRBlocks, true) - } } // WaitForAKSControlPlaneReady waits for the azure managed control plane to be ready. diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index be51f284abf..cc501675ce1 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -725,7 +725,6 @@ var _ = Describe("Workload cluster creation", func() { clusterTemplate := createApplyClusterTemplateInput( specName, withFlavor("aks"), - withAzureCNIv1Manifest(e2eConfig.GetVariable(AzureCNIv1Manifest)), withNamespace(namespace.Name), withClusterName(clusterName), withKubernetesVersion(kubernetesVersionUpgradeFrom), @@ -932,7 +931,6 @@ var _ = Describe("Workload cluster creation", func() { clusterctl.ApplyClusterTemplateAndWait(ctx, createApplyClusterTemplateInput( specName, withFlavor("aks-topology"), - withAzureCNIv1Manifest(e2eConfig.GetVariable(AzureCNIv1Manifest)), withNamespace(namespace.Name), withClusterName(clusterName), withKubernetesVersion(kubernetesVersionUpgradeFrom), diff --git a/test/e2e/cni.go b/test/e2e/cni.go index e1d64e569ab..cd0b3ed6216 100644 --- a/test/e2e/cni.go +++ b/test/e2e/cni.go @@ -44,24 +44,11 @@ const ( // EnsureCNI installs the CNI plugin depending on the input.CNIManifestPath func EnsureCNI(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, installHelmChart bool, cidrBlocks []string, hasWindows bool) { - if input.CNIManifestPath != "" { - InstallCNIManifest(ctx, input, cidrBlocks, hasWindows) - } else { + if input.CNIManifestPath == "" { EnsureCalicoIsReady(ctx, input, installHelmChart, cidrBlocks, hasWindows) } } -// InstallCNIManifest installs the CNI manifest provided by the user -func InstallCNIManifest(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, cidrBlocks []string, hasWindows bool) { //nolint:revive // leaving unused cidrBlocks and hasWindows for understanding - By("Installing a CNI plugin to the workload cluster") - workloadCluster := input.ClusterProxy.GetWorkloadCluster(ctx, input.Namespace, input.ClusterName) - - cniYaml, err := os.ReadFile(input.CNIManifestPath) - Expect(err).NotTo(HaveOccurred()) - - Expect(workloadCluster.CreateOrUpdate(ctx, cniYaml)).To(Succeed()) -} - // EnsureCalicoIsReady copies the kubeadm configmap to the calico-system namespace and waits for the calico pods to be ready. func EnsureCalicoIsReady(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, installHelmChart bool, cidrBlocks []string, hasWindows bool) { specName := "ensure-calico"