Skip to content

Commit fc261f0

Browse files
authored
Merge pull request #4255 from nojnhuh/aks-e2e-provstate
wait for provisioning state in AKS e2e tests
2 parents f1e0fbc + 201101f commit fc261f0

File tree

6 files changed

+11
-0
lines changed

6 files changed

+11
-0
lines changed

test/e2e/aks_autoscaler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func validateAKSAutoscaleDisabled(agentPoolGetter func() (armcontainerservice.Ag
111111
Eventually(func(g Gomega) {
112112
agentpool, err := agentPoolGetter()
113113
g.Expect(err).NotTo(HaveOccurred())
114+
g.Expect(agentpool.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
114115
g.Expect(ptr.Deref(agentpool.Properties.EnableAutoScaling, false)).To(BeFalse())
115116
}, inputGetter().WaitIntervals...).Should(Succeed())
116117
}
@@ -120,6 +121,7 @@ func validateAKSAutoscaleEnabled(agentPoolGetter func() (armcontainerservice.Age
120121
Eventually(func(g Gomega) {
121122
agentpool, err := agentPoolGetter()
122123
g.Expect(err).NotTo(HaveOccurred())
124+
g.Expect(agentpool.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
123125
g.Expect(ptr.Deref(agentpool.Properties.EnableAutoScaling, false)).To(BeTrue())
124126
}, inputGetter().WaitIntervals...).Should(Succeed())
125127
}

test/e2e/aks_azure_cluster_autoscaler.go

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

6262
aks, err := containerserviceClient.Get(ctx, amcp.Spec.ResourceGroupName, amcp.Name, nil)
6363
g.Expect(err).NotTo(HaveOccurred())
64+
g.Expect(aks.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
6465
aksInitialAutoScalerProfile := aks.Properties.AutoScalerProfile
6566

6667
// Conditional is based off of the actual AKS settings not the AzureManagedControlPlane
@@ -106,6 +107,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func
106107
// Check that the autoscaler settings have been sync'd to AKS
107108
aks, err := containerserviceClient.Get(ctx, amcp.Spec.ResourceGroupName, amcp.Name, nil)
108109
g.Expect(err).NotTo(HaveOccurred())
110+
g.Expect(aks.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
109111
g.Expect(aks.Properties.AutoScalerProfile).ToNot(BeNil())
110112
g.Expect(aks.Properties.AutoScalerProfile.Expander).To(Equal(&expectedAksExpander))
111113
}, input.WaitIntervals...).Should(Succeed())

test/e2e/aks_node_labels.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func AKSNodeLabelsSpec(ctx context.Context, inputGetter func() AKSNodeLabelsSpec
7878
checkLabels := func(g Gomega) {
7979
resp, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name, nil)
8080
g.Expect(err).NotTo(HaveOccurred())
81+
g.Expect(resp.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
8182

8283
agentpool := resp.AgentPool
8384
var actualLabels map[string]string

test/e2e/aks_node_taints.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func AKSNodeTaintsSpec(ctx context.Context, inputGetter func() AKSNodeTaintsSpec
8989

9090
resp, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name, nil)
9191
g.Expect(err).NotTo(HaveOccurred())
92+
g.Expect(resp.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
9293
actualTaintStrs := resp.AgentPool.Properties.NodeTaints
9394
if expectedTaintStrs == nil {
9495
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/ptr"
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"
@@ -83,6 +84,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional
8384
checkTags := func(g Gomega) {
8485
resp, err := managedclustersClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, nil)
8586
g.Expect(err).NotTo(HaveOccurred())
87+
g.Expect(resp.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
8688
actualTags := converters.MapToTags(resp.ManagedCluster.Tags)
8789
// Ignore tags not originally specified in spec.additionalTags
8890
for k := range nonAdditionalTagKeys {
@@ -167,6 +169,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional
167169
checkTags := func(g Gomega) {
168170
resp, err := agentpoolsClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, *ammp.Spec.Name, nil)
169171
g.Expect(err).NotTo(HaveOccurred())
172+
g.Expect(resp.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
170173
actualTags := converters.MapToTags(resp.AgentPool.Properties.Tags)
171174
// Ignore tags not originally specified in spec.additionalTags
172175
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/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4"
2727
. "github.com/onsi/ginkgo/v2"
2828
. "github.com/onsi/gomega"
29+
"k8s.io/utils/ptr"
2930
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3031
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3132
expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"
@@ -65,6 +66,7 @@ func AKSUpgradeSpec(ctx context.Context, inputGetter func() AKSUpgradeSpecInput)
6566
Eventually(func(g Gomega) {
6667
resp, err := managedClustersClient.Get(ctx, infraControlPlane.Spec.ResourceGroupName, infraControlPlane.Name, nil)
6768
g.Expect(err).NotTo(HaveOccurred())
69+
g.Expect(resp.Properties.ProvisioningState).To(Equal(ptr.To("Succeeded")))
6870
aksCluster := resp.ManagedCluster
6971
g.Expect(aksCluster.Properties).NotTo(BeNil())
7072
g.Expect(aksCluster.Properties.KubernetesVersion).NotTo(BeNil())

0 commit comments

Comments
 (0)