Skip to content

Commit fc1767b

Browse files
Move flex_start to beta-only (#13789) (#22542)
[upstream:42c9194b7a2592ad8fd603591520b35f8093b681] Signed-off-by: Modular Magician <[email protected]>
1 parent 681c7bd commit fc1767b

File tree

5 files changed

+4
-164
lines changed

5 files changed

+4
-164
lines changed

.changelog/13789.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
container: added `flex_start` to `node_config` in `google_container_cluster` and `google_container_node_pool` (ga revert)
3+
```

google/services/container/node_config.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -830,12 +830,6 @@ func schemaNodeConfig() *schema.Schema {
830830
ForceNew: true,
831831
Description: `The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s".`,
832832
},
833-
"flex_start": {
834-
Type: schema.TypeBool,
835-
Optional: true,
836-
ForceNew: true,
837-
Description: `Enables Flex Start provisioning model for the node pool`,
838-
},
839833
},
840834
},
841835
}
@@ -1215,10 +1209,6 @@ func expandNodeConfig(v interface{}) *container.NodeConfig {
12151209
nc.MaxRunDuration = v.(string)
12161210
}
12171211

1218-
if v, ok := nodeConfig["flex_start"]; ok {
1219-
nc.FlexStart = v.(bool)
1220-
}
1221-
12221212
if v, ok := nodeConfig["confidential_nodes"]; ok {
12231213
nc.ConfidentialNodes = expandConfidentialNodes(v)
12241214
}
@@ -1618,7 +1608,6 @@ func flattenNodeConfig(c *container.NodeConfig, v interface{}) []map[string]inte
16181608
"node_group": c.NodeGroup,
16191609
"advanced_machine_features": flattenAdvancedMachineFeaturesConfig(c.AdvancedMachineFeatures),
16201610
"max_run_duration": c.MaxRunDuration,
1621-
"flex_start": c.FlexStart,
16221611
"sole_tenant_config": flattenSoleTenantConfig(c.SoleTenantConfig),
16231612
"fast_socket": flattenFastSocket(c.FastSocket),
16241613
"resource_manager_tags": flattenResourceManagerTags(c.ResourceManagerTags),

google/services/container/resource_container_cluster_test.go

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -505,38 +505,6 @@ func TestAccContainerCluster_withMaxRunDuration(t *testing.T) {
505505
})
506506
}
507507

508-
func TestAccContainerCluster_withFlexStart(t *testing.T) {
509-
t.Parallel()
510-
511-
clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
512-
networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
513-
subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
514-
npName := fmt.Sprintf("tf-test-node-pool-%s", acctest.RandString(t, 10))
515-
516-
acctest.VcrTest(t, resource.TestCase{
517-
PreCheck: func() { acctest.AccTestPreCheck(t) },
518-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
519-
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
520-
Steps: []resource.TestStep{
521-
{
522-
Config: testAccContainerCluster_withFlexStart(clusterName, npName, networkName, subnetworkName),
523-
Check: resource.ComposeTestCheckFunc(
524-
resource.TestCheckResourceAttr("google_container_cluster.flex_start", "node_pool.0.node_config.0.machine_type", "n1-standard-1"),
525-
resource.TestCheckResourceAttr("google_container_cluster.flex_start",
526-
"node_pool.0.node_config.0.reservation_affinity.0.consume_reservation_type", "NO_RESERVATION"),
527-
resource.TestCheckResourceAttr("google_container_cluster.flex_start", "node_pool.0.node_config.0.flex_start", "true"),
528-
),
529-
},
530-
{
531-
ResourceName: "google_container_cluster.flex_start",
532-
ImportState: true,
533-
ImportStateVerify: true,
534-
ImportStateVerifyIgnore: []string{"deletion_protection", "min_master_version", "node_pool.0.node_config.0.taint"},
535-
},
536-
},
537-
})
538-
}
539-
540508
func TestAccContainerCluster_withILBSubsetting(t *testing.T) {
541509
t.Parallel()
542510

@@ -6635,52 +6603,6 @@ resource "google_container_cluster" "max_run_duration" {
66356603
`, clusterName, npName, duration, networkName, subnetworkName)
66366604
}
66376605

6638-
func testAccContainerCluster_withFlexStart(clusterName, npName, networkName, subnetworkName string) string {
6639-
return fmt.Sprintf(`
6640-
resource "google_container_cluster" "flex_start" {
6641-
min_master_version = "1.32.3-gke.1717000"
6642-
6643-
name = "%s"
6644-
location = "us-central1-a"
6645-
6646-
release_channel {
6647-
channel = "RAPID"
6648-
}
6649-
6650-
6651-
node_pool {
6652-
name = "%s"
6653-
initial_node_count = 0
6654-
autoscaling {
6655-
total_min_node_count = 0
6656-
total_max_node_count = 1
6657-
}
6658-
6659-
node_config {
6660-
machine_type = "n1-standard-1"
6661-
flex_start = true
6662-
max_run_duration = "604800s"
6663-
6664-
reservation_affinity {
6665-
consume_reservation_type = "NO_RESERVATION"
6666-
}
6667-
6668-
taint {
6669-
key = "taint_key"
6670-
value = "taint_value"
6671-
effect = "NO_SCHEDULE"
6672-
}
6673-
}
6674-
}
6675-
6676-
deletion_protection = false
6677-
network = "%s"
6678-
subnetwork = "%s"
6679-
6680-
}
6681-
`, clusterName, npName, networkName, subnetworkName)
6682-
}
6683-
66846606
func testAccContainerCluster_withILBSubSetting(clusterName, npName, networkName, subnetworkName string) string {
66856607
return fmt.Sprintf(`
66866608
resource "google_container_cluster" "confidential_nodes" {

google/services/container/resource_container_node_pool_test.go

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4327,80 +4327,6 @@ resource "google_container_node_pool" "np" {
43274327
`, clusterName, networkName, subnetworkName, np)
43284328
}
43294329

4330-
func TestAccContainerNodePool_withFlexStart(t *testing.T) {
4331-
t.Parallel()
4332-
4333-
clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
4334-
np := fmt.Sprintf("tf-test-cluster-nodepool-%s", acctest.RandString(t, 10))
4335-
networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster")
4336-
subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName)
4337-
4338-
acctest.VcrTest(t, resource.TestCase{
4339-
PreCheck: func() { acctest.AccTestPreCheck(t) },
4340-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
4341-
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
4342-
Steps: []resource.TestStep{
4343-
{
4344-
Config: testAccContainerNodePool_withFlexStart(clusterName, np, networkName, subnetworkName),
4345-
Check: resource.ComposeTestCheckFunc(
4346-
resource.TestCheckResourceAttr("google_container_node_pool.np", "node_config.0.machine_type", "n1-standard-1"),
4347-
resource.TestCheckResourceAttr("google_container_node_pool.np",
4348-
"node_config.0.reservation_affinity.0.consume_reservation_type", "NO_RESERVATION"),
4349-
resource.TestCheckResourceAttr("google_container_node_pool.np", "node_config.0.flex_start", "true"),
4350-
),
4351-
},
4352-
{
4353-
ResourceName: "google_container_node_pool.np",
4354-
ImportState: true,
4355-
ImportStateVerify: true,
4356-
ImportStateVerifyIgnore: []string{"node_config.0.taint"},
4357-
},
4358-
},
4359-
})
4360-
}
4361-
4362-
func testAccContainerNodePool_withFlexStart(clusterName, np, networkName, subnetworkName string) string {
4363-
return fmt.Sprintf(`
4364-
resource "google_container_cluster" "cluster" {
4365-
min_master_version = "1.32.3-gke.1717000"
4366-
4367-
name = "%s"
4368-
location = "us-central1-a"
4369-
initial_node_count = 1
4370-
deletion_protection = false
4371-
network = "%s"
4372-
subnetwork = "%s"
4373-
}
4374-
4375-
resource "google_container_node_pool" "np" {
4376-
name = "%s"
4377-
location = "us-central1-a"
4378-
cluster = google_container_cluster.cluster.name
4379-
initial_node_count = 0
4380-
autoscaling {
4381-
total_min_node_count = 0
4382-
total_max_node_count = 1
4383-
}
4384-
4385-
node_config {
4386-
machine_type = "n1-standard-1"
4387-
flex_start = true
4388-
max_run_duration = "604800s"
4389-
4390-
reservation_affinity {
4391-
consume_reservation_type = "NO_RESERVATION"
4392-
}
4393-
4394-
taint {
4395-
key = "taint_key"
4396-
value = "taint_value"
4397-
effect = "NO_SCHEDULE"
4398-
}
4399-
}
4400-
}
4401-
`, clusterName, networkName, subnetworkName, np)
4402-
}
4403-
44044330
func TestAccContainerNodePool_tpuTopology(t *testing.T) {
44054331
t.Parallel()
44064332
t.Skip("https://github.com/hashicorp/terraform-provider-google/issues/15254#issuecomment-1646277473")

website/docs/r/container_cluster.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ gvnic {
931931

932932
* `max_run_duration` - (Optional) The runtime of each node in the node pool in seconds, terminated by 's'. Example: "3600s".
933933

934-
* `flex_start` - (Optional) Enables Flex Start provisioning model for the node pool.
934+
* `flex_start` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))) Enables Flex Start provisioning model for the node pool.
935935

936936
* `local_ssd_count` - (Optional) The amount of local SSD disks that will be
937937
attached to each cluster node. Defaults to 0.

0 commit comments

Comments
 (0)