diff --git a/tests/integration/update_cluster/ha_gce/kubernetes.tf b/tests/integration/update_cluster/ha_gce/kubernetes.tf index 3703551febde9..a60851a05602d 100644 --- a/tests/integration/update_cluster/ha_gce/kubernetes.tf +++ b/tests/integration/update_cluster/ha_gce/kubernetes.tf @@ -501,8 +501,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-ha-gce-exa name = "a-master-us-test1-a-ha-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-ha-gce-example-com.self_link @@ -519,8 +520,9 @@ resource "google_compute_instance_group_manager" "a-nodes-ha-gce-example-com" { name = "a-nodes-ha-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-ha-gce-example-com.self_link @@ -537,8 +539,9 @@ resource "google_compute_instance_group_manager" "b-master-us-test1-b-ha-gce-exa name = "b-master-us-test1-b-ha-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-b-ha-gce-example-com.self_link @@ -555,8 +558,9 @@ resource "google_compute_instance_group_manager" "b-nodes-ha-gce-example-com" { name = "b-nodes-ha-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-ha-gce-example-com.self_link @@ -573,8 +577,9 @@ resource "google_compute_instance_group_manager" "c-master-us-test1-c-ha-gce-exa name = "c-master-us-test1-c-ha-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-c-ha-gce-example-com.self_link @@ -591,8 +596,9 @@ resource "google_compute_instance_group_manager" "c-nodes-ha-gce-example-com" { name = "c-nodes-ha-gce-example-com" target_size = 0 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-ha-gce-example-com.self_link diff --git a/tests/integration/update_cluster/many-addons-gce/kubernetes.tf b/tests/integration/update_cluster/many-addons-gce/kubernetes.tf index 88489af93399a..c2dc0a7905bec 100644 --- a/tests/integration/update_cluster/many-addons-gce/kubernetes.tf +++ b/tests/integration/update_cluster/many-addons-gce/kubernetes.tf @@ -429,8 +429,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-ex name = "a-master-us-test1-a-minimal-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-example-com.self_link @@ -447,8 +448,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-example-com" { name = "a-nodes-minimal-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce/kubernetes.tf b/tests/integration/update_cluster/minimal_gce/kubernetes.tf index 5e7f4132ff5c8..683e88075db7f 100644 --- a/tests/integration/update_cluster/minimal_gce/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce/kubernetes.tf @@ -397,8 +397,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc name = "a-master-us-test1-a-minimal-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-example-com.self_link @@ -415,8 +416,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-example-co name = "a-nodes-minimal-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-example-com.self_link @@ -433,8 +435,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-example-co name = "b-nodes-minimal-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce_dns-none/kubernetes.tf b/tests/integration/update_cluster/minimal_gce_dns-none/kubernetes.tf index c9f3c7ba2c1ab..cb15a40223953 100644 --- a/tests/integration/update_cluster/minimal_gce_dns-none/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce_dns-none/kubernetes.tf @@ -469,8 +469,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc name = "a-master-us-test1-a-minimal-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-example-com.self_link @@ -487,8 +488,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-example-co name = "a-nodes-minimal-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-example-com.self_link @@ -505,8 +507,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-example-co name = "b-nodes-minimal-gce-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce_ilb/kubernetes.tf b/tests/integration/update_cluster/minimal_gce_ilb/kubernetes.tf index b5964667b2012..6ef9c2927a310 100644 --- a/tests/integration/update_cluster/minimal_gce_ilb/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce_ilb/kubernetes.tf @@ -438,8 +438,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc name = "a-master-us-test1-a-minimal-gce-ilb-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-ilb-example-com.self_link @@ -456,8 +457,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-ilb-exampl name = "a-nodes-minimal-gce-ilb-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-ilb-example-com.self_link @@ -474,8 +476,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-ilb-exampl name = "b-nodes-minimal-gce-ilb-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-ilb-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce_ilb_longclustername/kubernetes.tf b/tests/integration/update_cluster/minimal_gce_ilb_longclustername/kubernetes.tf index 3df6d301d550e..637c4fc9ccb06 100644 --- a/tests/integration/update_cluster/minimal_gce_ilb_longclustername/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce_ilb_longclustername/kubernetes.tf @@ -438,8 +438,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc name = "a-master-us-test1-a-minimal-gce-with-a-very-very-very-ve-j0fh8f" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com.self_link @@ -456,8 +457,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-with-a-ver name = "a-nodes-minimal-gce-with-a-very-very-very-very-very-long-qk78uj" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com.self_link @@ -474,8 +476,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-with-a-ver name = "b-nodes-minimal-gce-with-a-very-very-very-very-very-long-h6o2lg" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce_longclustername/kubernetes.tf b/tests/integration/update_cluster/minimal_gce_longclustername/kubernetes.tf index a6e573eba4761..bac977d976d9d 100644 --- a/tests/integration/update_cluster/minimal_gce_longclustername/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce_longclustername/kubernetes.tf @@ -405,8 +405,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc name = "a-master-us-test1-a-minimal-gce-with-a-very-very-very-ve-j0fh8f" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com.self_link @@ -423,8 +424,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-with-a-ver name = "a-nodes-minimal-gce-with-a-very-very-very-very-very-long-qk78uj" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com.self_link @@ -441,8 +443,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-with-a-ver name = "b-nodes-minimal-gce-with-a-very-very-very-very-very-long-h6o2lg" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce_plb/kubernetes.tf b/tests/integration/update_cluster/minimal_gce_plb/kubernetes.tf index a97a5c952e9a0..f8e12dc9be91f 100644 --- a/tests/integration/update_cluster/minimal_gce_plb/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce_plb/kubernetes.tf @@ -462,8 +462,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc target_pools = [google_compute_target_pool.api-minimal-gce-plb-example-com.self_link] target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-plb-example-com.self_link @@ -480,8 +481,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-plb-exampl name = "a-nodes-minimal-gce-plb-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-plb-example-com.self_link @@ -498,8 +500,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-plb-exampl name = "b-nodes-minimal-gce-plb-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-plb-example-com.self_link diff --git a/tests/integration/update_cluster/minimal_gce_private/kubernetes.tf b/tests/integration/update_cluster/minimal_gce_private/kubernetes.tf index f1587836715a2..d51a0d8273662 100644 --- a/tests/integration/update_cluster/minimal_gce_private/kubernetes.tf +++ b/tests/integration/update_cluster/minimal_gce_private/kubernetes.tf @@ -405,8 +405,9 @@ resource "google_compute_instance_group_manager" "a-master-us-test1-a-minimal-gc name = "a-master-us-test1-a-minimal-gce-private-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.master-us-test1-a-minimal-gce-private-example-com.self_link @@ -423,8 +424,9 @@ resource "google_compute_instance_group_manager" "a-nodes-minimal-gce-private-ex name = "a-nodes-minimal-gce-private-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-private-example-com.self_link @@ -441,8 +443,9 @@ resource "google_compute_instance_group_manager" "b-nodes-minimal-gce-private-ex name = "b-nodes-minimal-gce-private-example-com" target_size = 1 update_policy { - minimal_action = "REPLACE" - type = "OPPORTUNISTIC" + max_unavailable_fixed = 1 + minimal_action = "REPLACE" + type = "OPPORTUNISTIC" } version { instance_template = google_compute_instance_template.nodes-minimal-gce-private-example-com.self_link diff --git a/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager.go b/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager.go index 4fcef2a49a0e3..58e65669ad374 100644 --- a/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager.go +++ b/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager.go @@ -199,9 +199,9 @@ type terraformInstanceGroupManager struct { } type terraformUpdatePolicy struct { - MinimalAction string `cty:"minimal_action"` - MaxUnavailableFixed int `cty:"max_unavailable_fixed"` - Type string `cty:"type"` + MinimalAction string `cty:"minimal_action"` + MaxUnavailableFixed int `cty:"max_unavailable_fixed"` + Type string `cty:"type"` } type terraformVersion struct { @@ -221,9 +221,9 @@ func (_ *InstanceGroupManager) RenderTerraform(t *terraform.TerraformTarget, a, } if policy := e.UpdatePolicy; policy != nil { tf.UpdatePolicy = &terraformUpdatePolicy{ - MinimalAction: policy.MinimalAction, + MinimalAction: policy.MinimalAction, MaxUnavailableFixed: 1, - Type: policy.Type, + Type: policy.Type, } } tf.Version = &terraformVersion{