Skip to content

Commit

Permalink
add taint
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Jan 11, 2024
1 parent 32c1969 commit 19619a8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/e2e/aks_marketplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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())
}

0 comments on commit 19619a8

Please sign in to comment.