Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore AMMP-converges-to-failed-ready test spec #4555

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions test/e2e/aks_public_ip_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr
publicIPPrefix = resp.PublicIPPrefix
}, input.WaitIntervals...).Should(Succeed(), "failed to create public IP prefix")

By("Creating node pool with 2 nodes")
By("Creating node pool with 3 nodes")
infraMachinePool := &infrav1.AzureManagedMachinePool{
ObjectMeta: metav1.ObjectMeta{
Name: "pool3",
Expand All @@ -108,7 +108,7 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr
},
Spec: expv1.MachinePoolSpec{
ClusterName: input.Cluster.Name,
Replicas: ptr.To[int32](2),
Replicas: ptr.To[int32](3),
Template: clusterv1.MachineTemplateSpec{
Spec: clusterv1.MachineSpec{
Bootstrap: clusterv1.Bootstrap{
Expand Down Expand Up @@ -144,6 +144,27 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr
}, input.WaitIntervals...).Should(Succeed(), "Deleted AzureManagedMachinePool %s/%s still exists", infraMachinePool.Namespace, infraMachinePool.Name)
}()

By("Verifying the AzureManagedMachinePool converges to a failed ready status")
Eventually(func(g Gomega) {
infraMachinePool := &infrav1.AzureManagedMachinePool{}
err := mgmtClient.Get(ctx, client.ObjectKeyFromObject(machinePool), infraMachinePool)
g.Expect(err).NotTo(HaveOccurred())
cond := conditions.Get(infraMachinePool, infrav1.AgentPoolsReadyCondition)
g.Expect(cond).NotTo(BeNil())
g.Expect(cond.Status).To(Equal(corev1.ConditionFalse))
g.Expect(cond.Reason).To(Equal(infrav1.FailedReason))
g.Expect(cond.Message).To(ContainSubstring("PublicIpPrefixOutOfIpAddressesForVMScaleSet"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the error message we used to expect here changed (with SDKv2 I'm assuming).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup it's a more detailed error message than the previous one, but I think it's the same error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'd bet this same string appeared in the last error message too. At the very least, that string seems like a good indication of what I expect the error here to be.

}, input.WaitIntervals...).Should(Succeed())

By("Scaling the MachinePool to 2 nodes")
Eventually(func(g Gomega) {
err = mgmtClient.Get(ctx, client.ObjectKeyFromObject(machinePool), machinePool)
g.Expect(err).NotTo(HaveOccurred())
machinePool.Spec.Replicas = ptr.To[int32](2)
err = mgmtClient.Update(ctx, machinePool)
g.Expect(err).NotTo(HaveOccurred())
}, input.WaitIntervals...).Should(Succeed())

By("Verifying the AzureManagedMachinePool becomes ready")
Eventually(func(g Gomega) {
infraMachinePool := &infrav1.AzureManagedMachinePool{}
Expand Down