Skip to content

Commit

Permalink
Fix upgrade_settings structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgEsteves committed Feb 5, 2023
1 parent 0ed57d6 commit 667a807
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 150 deletions.
20 changes: 10 additions & 10 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -685,26 +685,26 @@ resource "google_container_node_pool" "windows_pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -406,26 +406,26 @@ resource "google_container_node_pool" "pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down Expand Up @@ -599,26 +599,26 @@ resource "google_container_node_pool" "windows_pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -595,26 +595,26 @@ resource "google_container_node_pool" "pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down Expand Up @@ -828,26 +828,26 @@ resource "google_container_node_pool" "windows_pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -501,26 +501,26 @@ resource "google_container_node_pool" "pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down Expand Up @@ -733,26 +733,26 @@ resource "google_container_node_pool" "windows_pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -575,26 +575,26 @@ resource "google_container_node_pool" "pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down Expand Up @@ -807,26 +807,26 @@ resource "google_container_node_pool" "windows_pools" {
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "SURGE" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "SURGE" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "SURGE")
max_surge = lookup(each.value, "max_surge", 1)
max_unavailable = lookup(each.value, "max_unavailable", 0)
strategy = lookup(upgrade_settings.value, "strategy", "SURGE")
max_surge = lookup(upgrade_settings.value, "max_surge", 1)
max_unavailable = lookup(upgrade_settings.value, "max_unavailable", 0)
}
}

dynamic "upgrade_settings" {
for_each = lookup(each.value, "strategy", var.strategy) == "BLUE_GREEN" ? [each.value] : []
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [each.value] : []
content {
strategy = lookup(each.value, "strategy", "BLUE_GREEN")
strategy = lookup(upgrade_settings.value, "strategy")

blue_green_settings {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(upgrade_settings.value, "node_pool_soak_duration", "3600s")

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "60s")
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", null)
batch_soak_duration = lookup(upgrade_settings.value, "batch_soak_duration", "60s")
batch_percentage = lookup(upgrade_settings.value, "batch_percentage", null)
batch_node_count = lookup(upgrade_settings.value, "batch_node_count", null)
}
}
}
Expand Down
Loading

0 comments on commit 667a807

Please sign in to comment.