Skip to content

Commit 0a18777

Browse files
authored
Merge pull request #4272 from mboersma/cherry-pick-4255-to-release-1.10
[release-1.10] wait for provisioning state in AKS e2e tests
2 parents 0740df0 + 931645f commit 0a18777

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

test/e2e/aks_autoscaler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func validateAKSAutoscaleDisabled(agentPoolGetter func() (containerservice.Agent
114114
Eventually(func(g Gomega) {
115115
agentpool, err := agentPoolGetter()
116116
g.Expect(err).NotTo(HaveOccurred())
117+
g.Expect(agentpool.ProvisioningState).To(Equal(pointer.String("Succeeded")))
117118
g.Expect(pointer.BoolDeref(agentpool.EnableAutoScaling, false)).To(BeFalse())
118119
}, inputGetter().WaitIntervals...).Should(Succeed())
119120
}
@@ -123,6 +124,7 @@ func validateAKSAutoscaleEnabled(agentPoolGetter func() (containerservice.AgentP
123124
Eventually(func(g Gomega) {
124125
agentpool, err := agentPoolGetter()
125126
g.Expect(err).NotTo(HaveOccurred())
127+
g.Expect(agentpool.ProvisioningState).To(Equal(pointer.String("Succeeded")))
126128
g.Expect(pointer.BoolDeref(agentpool.EnableAutoScaling, false)).To(BeTrue())
127129
}, inputGetter().WaitIntervals...).Should(Succeed())
128130
}

test/e2e/aks_azure_cluster_autoscaler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func
6464

6565
aks, err := containerserviceClient.Get(ctx, amcp.Spec.ResourceGroupName, amcp.Name)
6666
g.Expect(err).NotTo(HaveOccurred())
67+
g.Expect(aks.ProvisioningState).To(Equal(pointer.String("Succeeded")))
6768
aksInitialAutoScalerProfile := aks.AutoScalerProfile
6869

6970
// Conditional is based off of the actual AKS settings not the AzureManagedControlPlane
@@ -109,6 +110,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func
109110
// Check that the autoscaler settings have been sync'd to AKS
110111
aks, err := containerserviceClient.Get(ctx, amcp.Spec.ResourceGroupName, amcp.Name)
111112
g.Expect(err).NotTo(HaveOccurred())
113+
g.Expect(aks.ProvisioningState).To(Equal(pointer.String("Succeeded")))
112114
g.Expect(aks.AutoScalerProfile).ToNot(BeNil())
113115
g.Expect(aks.AutoScalerProfile.Expander).To(Equal(expectedAksExpander))
114116
}, input.WaitIntervals...).Should(Succeed())

test/e2e/aks_node_labels.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func AKSNodeLabelsSpec(ctx context.Context, inputGetter func() AKSNodeLabelsSpec
8181
checkLabels := func(g Gomega) {
8282
agentpool, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name)
8383
g.Expect(err).NotTo(HaveOccurred())
84+
g.Expect(agentpool.ProvisioningState).To(Equal(pointer.String("Succeeded")))
8485

8586
var actualLabels map[string]string
8687
if agentpool.NodeLabels != nil {

test/e2e/aks_node_taints.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
. "github.com/onsi/gomega"
3131
corev1 "k8s.io/api/core/v1"
3232
"k8s.io/apimachinery/pkg/types"
33+
"k8s.io/utils/pointer"
3334
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3435
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3536
expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"
@@ -92,6 +93,7 @@ func AKSNodeTaintsSpec(ctx context.Context, inputGetter func() AKSNodeTaintsSpec
9293

9394
agentpool, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name)
9495
g.Expect(err).NotTo(HaveOccurred())
96+
g.Expect(agentpool.ProvisioningState).To(Equal(pointer.String("Succeeded")))
9597
actualTaintStrs := agentpool.NodeTaints
9698
if expectedTaintStrs == nil {
9799
g.Expect(actualTaintStrs).To(BeNil())

test/e2e/aks_tags.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
. "github.com/onsi/ginkgo/v2"
2929
. "github.com/onsi/gomega"
3030
"k8s.io/apimachinery/pkg/types"
31+
"k8s.io/utils/pointer"
3132
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3233
"sigs.k8s.io/cluster-api-provider-azure/azure/converters"
3334
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -86,6 +87,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional
8687
checkTags := func(g Gomega) {
8788
managedcluster, err := managedclustersClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name)
8889
g.Expect(err).NotTo(HaveOccurred())
90+
g.Expect(managedcluster.ProvisioningState).To(Equal(pointer.String("Succeeded")))
8991
actualTags := converters.MapToTags(managedcluster.Tags)
9092
// Ignore tags not originally specified in spec.additionalTags
9193
for k := range nonAdditionalTagKeys {
@@ -170,6 +172,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional
170172
checkTags := func(g Gomega) {
171173
agentpool, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name)
172174
g.Expect(err).NotTo(HaveOccurred())
175+
g.Expect(agentpool.ProvisioningState).To(Equal(pointer.String("Succeeded")))
173176
actualTags := converters.MapToTags(agentpool.Tags)
174177
// Ignore tags not originally specified in spec.additionalTags
175178
for k := range nonAdditionalTagKeys {

test/e2e/aks_upgrade.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/Azure/go-autorest/autorest/azure/auth"
2727
. "github.com/onsi/ginkgo/v2"
2828
. "github.com/onsi/gomega"
29+
"k8s.io/utils/pointer"
2930
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3031
azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure"
3132
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -69,6 +70,7 @@ func AKSUpgradeSpec(ctx context.Context, inputGetter func() AKSUpgradeSpecInput)
6970
Eventually(func(g Gomega) {
7071
aksCluster, err := managedClustersClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name)
7172
g.Expect(err).NotTo(HaveOccurred())
73+
g.Expect(aksCluster.ProvisioningState).To(Equal(pointer.String("Succeeded")))
7274
g.Expect(aksCluster.ManagedClusterProperties).NotTo(BeNil())
7375
g.Expect(aksCluster.ManagedClusterProperties.KubernetesVersion).NotTo(BeNil())
7476
g.Expect("v" + *aksCluster.KubernetesVersion).To(Equal(input.KubernetesVersionUpgradeTo))

0 commit comments

Comments
 (0)