Skip to content

Commit

Permalink
azurerm_kubernetes_cluster: Fix maintenance window order (#21190)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored Apr 2, 2023
1 parent 2067091 commit 6227b19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ func TestAccKubernetesCluster_basicMaintenanceConfig(t *testing.T) {
Config: r.basicMaintenanceConfig(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("maintenance_window.0.allowed.0.hours.0").HasValue("2"),
check.That(data.ResourceName).Key("maintenance_window.0.allowed.0.hours.1").HasValue("1"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -568,6 +570,8 @@ func TestAccKubernetesCluster_updateMaintenanceConfig(t *testing.T) {
Config: r.basicMaintenanceConfig(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("maintenance_window.0.allowed.0.hours.0").HasValue("2"),
check.That(data.ResourceName).Key("maintenance_window.0.allowed.0.hours.1").HasValue("1"),
),
},
data.ImportStep(),
Expand All @@ -582,6 +586,8 @@ func TestAccKubernetesCluster_updateMaintenanceConfig(t *testing.T) {
Config: r.basicMaintenanceConfig(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("maintenance_window.0.allowed.0.hours.0").HasValue("2"),
check.That(data.ResourceName).Key("maintenance_window.0.allowed.0.hours.1").HasValue("1"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -1948,7 +1954,7 @@ resource "azurerm_kubernetes_cluster" "test" {
maintenance_window {
allowed {
day = "Monday"
hours = [1, 2]
hours = [2, 1]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ func resourceKubernetesCluster() *pluginsdk.Resource {
},

"hours": {
Type: pluginsdk.TypeSet,
Type: pluginsdk.TypeList,
Required: true,
MinItems: 1,
Elem: &pluginsdk.Schema{
Expand Down

0 comments on commit 6227b19

Please sign in to comment.