Skip to content

Commit c06ec5b

Browse files
committed
Update AKS acceptance/mock tests to use kubernetes 1.27.9
- Kubernetes 1.26.x in Azure is reaching EOL and various patch versions are starting to become unavailable for use. - Kubernetes 1.27 has EOL in Jul 2024 and LTS until Jul 2025. - To make it easier to update the version in the future, added a variable to hold the version string. Signed-off-by: Gavin Shaw gavins@vmware.com Signed-off-by: Gavin Shaw gshaw+github@pivotal.io
1 parent 7b21fe2 commit c06ec5b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

internal/resources/akscluster/resource_akscluster_acc_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ import (
3737
testhelper "github.com/vmware/terraform-provider-tanzu-mission-control/internal/resources/testing"
3838
)
3939

40+
// Version of Kubernetes to deploy during acceptance tests.
41+
var aksKubernetesVersion = "1.27.9"
42+
4043
func validateSetup(t *testing.T) {
4144
// Check if the required environment variables are set
4245
for _, name := range []string{"AKS_CREDENTIAL_NAME", "AKS_SUBSCRIPTION_ID"} {
@@ -393,7 +396,7 @@ func testAKSCluster(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) st
393396
spec {
394397
config {
395398
location = "eastus"
396-
kubernetes_version = "1.26.6"
399+
kubernetes_version = "%s"
397400
network_config {
398401
network_plugin = "azure"
399402
dns_prefix = "dns-tf-test"
@@ -415,7 +418,7 @@ func testAKSCluster(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) st
415418
}
416419
}
417420
}
418-
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name)
421+
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name, aksKubernetesVersion)
419422
}
420423

421424
func testAKSClusterEnableCSI(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) string {
@@ -427,7 +430,7 @@ func testAKSClusterEnableCSI(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFul
427430
spec {
428431
config {
429432
location = "eastus"
430-
kubernetes_version = "1.26.6"
433+
kubernetes_version = "%s"
431434
network_config {
432435
network_plugin = "azure"
433436
dns_prefix = "dns-tf-test"
@@ -449,7 +452,7 @@ func testAKSClusterEnableCSI(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFul
449452
}
450453
}
451454
}
452-
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name)
455+
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name, aksKubernetesVersion)
453456
}
454457

455458
func testAKSClusterAddUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) string {
@@ -461,7 +464,7 @@ func testAKSClusterAddUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1Aksclus
461464
spec {
462465
config {
463466
location = "eastus"
464-
kubernetes_version = "1.26.6"
467+
kubernetes_version = "%s"
465468
network_config {
466469
network_plugin = "azure"
467470
dns_prefix = "dns-tf-test"
@@ -491,7 +494,7 @@ func testAKSClusterAddUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1Aksclus
491494
}
492495
}
493496
}
494-
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name)
497+
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name, aksKubernetesVersion)
495498
}
496499

497500
func testAKSClusterRemoveUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) string {
@@ -520,7 +523,7 @@ func mockCluster(w ...clusterWither) *aksmodel.VmwareTanzuManageV1alpha1AksClust
520523
IdentityConfig: &aksmodel.VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig{
521524
Type: aksmodel.VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeSYSTEMASSIGNED.Pointer(),
522525
},
523-
Version: "1.26.6",
526+
Version: aksKubernetesVersion,
524527
},
525528
},
526529
Status: &aksmodel.VmwareTanzuManageV1alpha1AksclusterStatus{

0 commit comments

Comments
 (0)