Skip to content

Commit

Permalink
Fix tests for HPAv2Beta2 since it is unavailable in 1.26 (#2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybolovlev authored Apr 18, 2023
1 parent 5de2ce8 commit ded42cd
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestAccKubernetesHorizontalPodAutoscalerV2Beta2_minimal(t *testing.T) {
PreCheck: func() {
testAccPreCheck(t)
skipIfClusterVersionLessThan(t, "1.23.0")
skipIfClusterVersionGreaterThanOrEqual(t, "1.26.0")
},
IDRefreshName: resourceName,
ProviderFactories: testAccProviderFactories,
Expand Down Expand Up @@ -59,7 +60,11 @@ func TestAccKubernetesHorizontalPodAutoscalerV2Beta2_basic(t *testing.T) {
resourceName := "kubernetes_horizontal_pod_autoscaler_v2beta2.test"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() {
testAccPreCheck(t)
skipIfClusterVersionLessThan(t, "1.23.0")
skipIfClusterVersionGreaterThanOrEqual(t, "1.26.0")
},
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"metadata.0.resource_version"},
ProviderFactories: testAccProviderFactories,
Expand Down Expand Up @@ -177,7 +182,11 @@ func TestAccKubernetesHorizontalPodAutoscalerV2Beta2_containerResource(t *testin
resourceName := "kubernetes_horizontal_pod_autoscaler_v2beta2.test"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() {
testAccPreCheck(t)
skipIfClusterVersionLessThan(t, "1.23.0")
skipIfClusterVersionGreaterThanOrEqual(t, "1.26.0")
},
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"metadata.0.resource_version"},
ProviderFactories: testAccProviderFactories,
Expand Down

0 comments on commit ded42cd

Please sign in to comment.