diff --git a/test/e2e/aks_autoscaler.go b/test/e2e/aks_autoscaler.go index 20690d96591..49d9bab51af 100644 --- a/test/e2e/aks_autoscaler.go +++ b/test/e2e/aks_autoscaler.go @@ -114,6 +114,7 @@ func validateAKSAutoscaleDisabled(agentPoolGetter func() (containerservice.Agent Eventually(func(g Gomega) { agentpool, err := agentPoolGetter() g.Expect(err).NotTo(HaveOccurred()) + g.Expect(agentpool.ProvisioningState).To(Equal(ptr.To("Succeeded"))) g.Expect(ptr.Deref(agentpool.EnableAutoScaling, false)).To(BeFalse()) }, inputGetter().WaitIntervals...).Should(Succeed()) } @@ -123,6 +124,7 @@ func validateAKSAutoscaleEnabled(agentPoolGetter func() (containerservice.AgentP Eventually(func(g Gomega) { agentpool, err := agentPoolGetter() g.Expect(err).NotTo(HaveOccurred()) + g.Expect(agentpool.ProvisioningState).To(Equal(ptr.To("Succeeded"))) g.Expect(ptr.Deref(agentpool.EnableAutoScaling, false)).To(BeTrue()) }, inputGetter().WaitIntervals...).Should(Succeed()) } diff --git a/test/e2e/aks_azure_cluster_autoscaler.go b/test/e2e/aks_azure_cluster_autoscaler.go index 541bb79ddda..d21b69ad1ad 100644 --- a/test/e2e/aks_azure_cluster_autoscaler.go +++ b/test/e2e/aks_azure_cluster_autoscaler.go @@ -66,6 +66,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func aks, err := containerserviceClient.Get(ctx, amcp.Spec.ResourceGroupName, amcp.Name, nil) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(aks.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded"))) aksInitialAutoScalerProfile := aks.Properties.AutoScalerProfile // Conditional is based off of the actual AKS settings not the AzureManagedControlPlane @@ -111,6 +112,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func // Check that the autoscaler settings have been sync'd to AKS aks, err := containerserviceClient.Get(ctx, amcp.Spec.ResourceGroupName, amcp.Name, nil) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(aks.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded"))) g.Expect(aks.Properties.AutoScalerProfile).ToNot(BeNil()) g.Expect(aks.Properties.AutoScalerProfile.Expander).To(Equal(&expectedAksExpander)) }, input.WaitIntervals...).Should(Succeed()) diff --git a/test/e2e/aks_node_labels.go b/test/e2e/aks_node_labels.go index b812e87c6c9..116969b9c63 100644 --- a/test/e2e/aks_node_labels.go +++ b/test/e2e/aks_node_labels.go @@ -81,6 +81,7 @@ func AKSNodeLabelsSpec(ctx context.Context, inputGetter func() AKSNodeLabelsSpec checkLabels := func(g Gomega) { agentpool, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(agentpool.ProvisioningState).To(Equal(ptr.To("Succeeded"))) var actualLabels map[string]string if agentpool.NodeLabels != nil { diff --git a/test/e2e/aks_node_taints.go b/test/e2e/aks_node_taints.go index 31073cb9621..cbe10f18cb1 100644 --- a/test/e2e/aks_node_taints.go +++ b/test/e2e/aks_node_taints.go @@ -30,6 +30,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/ptr" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -92,6 +93,7 @@ func AKSNodeTaintsSpec(ctx context.Context, inputGetter func() AKSNodeTaintsSpec agentpool, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(agentpool.ProvisioningState).To(Equal(ptr.To("Succeeded"))) actualTaintStrs := agentpool.NodeTaints if expectedTaintStrs == nil { g.Expect(actualTaintStrs).To(BeNil()) diff --git a/test/e2e/aks_tags.go b/test/e2e/aks_tags.go index 2f0020e65d7..cc41f73bad2 100644 --- a/test/e2e/aks_tags.go +++ b/test/e2e/aks_tags.go @@ -28,6 +28,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/ptr" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure/converters" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -86,6 +87,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional checkTags := func(g Gomega) { managedcluster, err := managedclustersClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(managedcluster.ProvisioningState).To(Equal(ptr.To("Succeeded"))) actualTags := converters.MapToTags(managedcluster.Tags) // Ignore tags not originally specified in spec.additionalTags for k := range nonAdditionalTagKeys { @@ -170,6 +172,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional checkTags := func(g Gomega) { agentpool, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(agentpool.ProvisioningState).To(Equal(ptr.To("Succeeded"))) actualTags := converters.MapToTags(agentpool.Tags) // Ignore tags not originally specified in spec.additionalTags for k := range nonAdditionalTagKeys { diff --git a/test/e2e/aks_upgrade.go b/test/e2e/aks_upgrade.go index 8b3678dc56b..5b4f7c2618e 100644 --- a/test/e2e/aks_upgrade.go +++ b/test/e2e/aks_upgrade.go @@ -26,6 +26,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure/auth" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "k8s.io/utils/ptr" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -69,6 +70,7 @@ func AKSUpgradeSpec(ctx context.Context, inputGetter func() AKSUpgradeSpecInput) Eventually(func(g Gomega) { aksCluster, err := managedClustersClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name) g.Expect(err).NotTo(HaveOccurred()) + g.Expect(aksCluster.ProvisioningState).To(Equal(ptr.To("Succeeded"))) g.Expect(aksCluster.ManagedClusterProperties).NotTo(BeNil()) g.Expect(aksCluster.ManagedClusterProperties.KubernetesVersion).NotTo(BeNil()) g.Expect("v" + *aksCluster.KubernetesVersion).To(Equal(input.KubernetesVersionUpgradeTo))