From 19619a8b9b1af80a822ccc8026e75a4fcb039e24 Mon Sep 17 00:00:00 2001 From: willie-yao Date: Wed, 10 Jan 2024 23:58:13 +0000 Subject: [PATCH] add taint --- test/e2e/aks_marketplace.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/e2e/aks_marketplace.go b/test/e2e/aks_marketplace.go index b603ba02fcb..61157ad7de7 100644 --- a/test/e2e/aks_marketplace.go +++ b/test/e2e/aks_marketplace.go @@ -63,6 +63,23 @@ func AKSMarketplaceExtensionSpec(ctx context.Context, inputGetter func() AKSMark extensionClient, err := armkubernetesconfiguration.NewExtensionsClient(amcp.Spec.SubscriptionID, cred, nil) Expect(err).NotTo(HaveOccurred()) + By("Adding a taint to the Windows node pool") + Eventually(func(g Gomega) { + ammp := &infrav1.AzureManagedMachinePool{} + err = mgmtClient.Get(ctx, types.NamespacedName{ + Namespace: input.Cluster.Namespace, + Name: input.Cluster.Name + "-pool2", + }, ammp) + g.Expect(err).NotTo(HaveOccurred()) + ammp.Spec.Taints = []infrav1.Taint{ + { + Effect: "NoSchedule", + Key: "test", + Value: "test", + }, + } + }, input.WaitIntervals...).Should(Succeed()) + By("Adding an AKS Marketplace Extension to the AzureManagedControlPlane") var infraControlPlane = &infrav1.AzureManagedControlPlane{} Eventually(func(g Gomega) { @@ -102,4 +119,15 @@ func AKSMarketplaceExtensionSpec(ctx context.Context, inputGetter func() AKSMark g.Expect(extension.Properties.AutoUpgradeMinorVersion).To(Equal(ptr.To(true))) g.Expect(extension.Properties.ExtensionType).To(Equal(ptr.To("testtestindustryexperiencestest.azurecomps"))) }, input.WaitIntervals...).Should(Succeed()) + + By("Removing the taint from the Windows node pool") + Eventually(func(g Gomega) { + ammp := &infrav1.AzureManagedMachinePool{} + err = mgmtClient.Get(ctx, types.NamespacedName{ + Namespace: input.Cluster.Namespace, + Name: input.Cluster.Name + "-pool2", + }, ammp) + g.Expect(err).NotTo(HaveOccurred()) + ammp.Spec.Taints = []infrav1.Taint{} + }, input.WaitIntervals...).Should(Succeed()) }