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 10, 2024
1 parent 4555b7b commit de36256
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 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 All @@ -71,11 +88,11 @@ func AKSMarketplaceExtensionSpec(ctx context.Context, inputGetter func() AKSMark
infraControlPlane.Spec.MarketplaceExtensions = []infrav1.MarketplaceExtension{
{
Name: extensionName,
ExtensionType: ptr.To("TraefikLabs.TraefikProxy"),
ExtensionType: ptr.To("testtestindustryexperiencestest.azurecomps"),
Plan: &infrav1.MarketplacePlan{
Name: "traefik-proxy",
Product: "traefik-proxy",
Publisher: "containous",
Name: "publicplanforprivatepo",
Product: "msalemcontainerdemo1",
Publisher: "testtestindustryexperiencestest",
},
},
}
Expand All @@ -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 de36256

Please sign in to comment.