Skip to content

Commit

Permalink
Update AKS acceptance/mock tests to use kubernetes 1.27.9
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
gshaw-pivotal committed Feb 23, 2024
1 parent 7b21fe2 commit 663f12f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions internal/resources/akscluster/resource_akscluster_acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import (
testhelper "github.com/vmware/terraform-provider-tanzu-mission-control/internal/resources/testing"
)

// Version of Kubernetes to deploy during acceptance tests.
var aksKubernetesVersion = "1.27.9"

func validateSetup(t *testing.T) {
// Check if the required environment variables are set
for _, name := range []string{"AKS_CREDENTIAL_NAME", "AKS_SUBSCRIPTION_ID"} {
Expand Down Expand Up @@ -393,7 +396,7 @@ func testAKSCluster(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) st
spec {
config {
location = "eastus"
kubernetes_version = "1.26.6"
kubernetes_version = "%s"
network_config {
network_plugin = "azure"
dns_prefix = "dns-tf-test"
Expand All @@ -415,7 +418,7 @@ func testAKSCluster(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) st
}
}
}
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name)
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name, aksKubernetesVersion)
}

func testAKSClusterEnableCSI(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) string {
Expand All @@ -427,7 +430,7 @@ func testAKSClusterEnableCSI(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFul
spec {
config {
location = "eastus"
kubernetes_version = "1.26.6"
kubernetes_version = "%s"
network_config {
network_plugin = "azure"
dns_prefix = "dns-tf-test"
Expand All @@ -449,7 +452,7 @@ func testAKSClusterEnableCSI(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFul
}
}
}
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name)
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name, aksKubernetesVersion)
}

func testAKSClusterAddUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) string {
Expand All @@ -461,7 +464,7 @@ func testAKSClusterAddUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1Aksclus
spec {
config {
location = "eastus"
kubernetes_version = "1.26.6"
kubernetes_version = "%s"
network_config {
network_plugin = "azure"
dns_prefix = "dns-tf-test"
Expand Down Expand Up @@ -491,7 +494,7 @@ func testAKSClusterAddUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1Aksclus
}
}
}
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name)
}`, fn.Name, fn.CredentialName, fn.SubscriptionID, fn.Name, aksKubernetesVersion)
}

func testAKSClusterRemoveUserNodepool(fn *aksmodel.VmwareTanzuManageV1alpha1AksclusterFullName) string {
Expand Down Expand Up @@ -520,7 +523,7 @@ func mockCluster(w ...clusterWither) *aksmodel.VmwareTanzuManageV1alpha1AksClust
IdentityConfig: &aksmodel.VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig{
Type: aksmodel.VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeSYSTEMASSIGNED.Pointer(),
},
Version: "1.26.6",
Version: aksKubernetesVersion,
},
},
Status: &aksmodel.VmwareTanzuManageV1alpha1AksclusterStatus{
Expand Down

0 comments on commit 663f12f

Please sign in to comment.