Skip to content

Commit

Permalink
feat: add location_policy and fix permadiff (#1452)
Browse files Browse the repository at this point in the history
fix: location-policy permadrifting #1445
  • Loading branch information
bogaertg authored Nov 7, 2022
1 parent 92ebb00 commit aecccf0
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 28 deletions.
1 change: 1 addition & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ resource "google_container_node_pool" "windows_pools" {
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -483,8 +484,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -754,8 +755,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -662,8 +663,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -735,8 +736,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -643,8 +644,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -588,8 +589,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down
10 changes: 6 additions & 4 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ resource "google_container_node_pool" "pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down Expand Up @@ -496,8 +497,9 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "autoscaling" {
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
content {
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
min_node_count = lookup(autoscaling.value, "min_count", 1)
max_node_count = lookup(autoscaling.value, "max_count", 100)
location_policy = lookup(autoscaling.value, "location_policy", null)
}
}

Expand Down

0 comments on commit aecccf0

Please sign in to comment.