From d055acf03dc37307fd98a618b9a864476c72a08d Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 2 Nov 2018 11:22:48 -0700 Subject: [PATCH] Remove max_pods_per_node from GA provider (#2391) /cc @rileykarson --- google/resource_container_node_pool.go | 20 ++---- google/resource_container_node_pool_test.go | 75 --------------------- 2 files changed, 5 insertions(+), 90 deletions(-) diff --git a/google/resource_container_node_pool.go b/google/resource_container_node_pool.go index 6726ca7d0a8..6bdf3448f84 100644 --- a/google/resource_container_node_pool.go +++ b/google/resource_container_node_pool.go @@ -85,11 +85,11 @@ var schemaNodePool = map[string]*schema.Schema{ }, "max_pods_per_node": &schema.Schema{ - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Computed: true, + Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, }, "initial_node_count": &schema.Schema{ @@ -474,12 +474,6 @@ func expandNodePool(d *schema.ResourceData, prefix string) (*containerBeta.NodeP } } - if v, ok := d.GetOk(prefix + "max_pods_per_node"); ok { - np.MaxPodsConstraint = &containerBeta.MaxPodsConstraint{ - MaxPodsPerNode: int64(v.(int)), - } - } - if v, ok := d.GetOk(prefix + "management"); ok { managementConfig := v.([]interface{})[0].(map[string]interface{}) np.Management = &containerBeta.NodeManagement{} @@ -531,10 +525,6 @@ func flattenNodePool(d *schema.ResourceData, config *Config, np *containerBeta.N } } - if np.MaxPodsConstraint != nil { - nodePool["max_pods_per_node"] = np.MaxPodsConstraint.MaxPodsPerNode - } - nodePool["management"] = []map[string]interface{}{ { "auto_repair": np.Management.AutoRepair, diff --git a/google/resource_container_node_pool_test.go b/google/resource_container_node_pool_test.go index db07087f408..3bb8b998631 100644 --- a/google/resource_container_node_pool_test.go +++ b/google/resource_container_node_pool_test.go @@ -32,29 +32,6 @@ func TestAccContainerNodePool_basic(t *testing.T) { }) } -func TestAccContainerNodePool_maxPodsPerNode(t *testing.T) { - t.Parallel() - - cluster := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10)) - np := fmt.Sprintf("tf-nodepool-test-%s", acctest.RandString(10)) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckContainerNodePoolDestroy, - Steps: []resource.TestStep{ - resource.TestStep{ - Config: testAccContainerNodePool_maxPodsPerNode(cluster, np), - }, - resource.TestStep{ - ResourceName: "google_container_node_pool.np", - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccContainerNodePool_noName(t *testing.T) { t.Parallel() @@ -513,58 +490,6 @@ resource "google_container_node_pool" "np" { }`, cluster, np) } -func testAccContainerNodePool_maxPodsPerNode(cluster, np string) string { - return fmt.Sprintf(` -resource "google_compute_network" "container_network" { - name = "container-net-%s" - auto_create_subnetworks = false -} - -resource "google_compute_subnetwork" "container_subnetwork" { - name = "${google_compute_network.container_network.name}" - network = "${google_compute_network.container_network.name}" - ip_cidr_range = "10.0.36.0/24" - region = "us-central1" - private_ip_google_access = true - - secondary_ip_range { - range_name = "pod" - ip_cidr_range = "10.0.0.0/19" - } - - secondary_ip_range { - range_name = "svc" - ip_cidr_range = "10.0.32.0/22" - } -} - -resource "google_container_cluster" "cluster" { - name = "%s" - zone = "us-central1-a" - initial_node_count = 3 - - network = "${google_compute_network.container_network.name}" - subnetwork = "${google_compute_subnetwork.container_subnetwork.name}" - private_cluster = true - master_ipv4_cidr_block = "10.42.0.0/28" - ip_allocation_policy { - cluster_secondary_range_name = "${google_compute_subnetwork.container_subnetwork.secondary_ip_range.0.range_name}" - services_secondary_range_name = "${google_compute_subnetwork.container_subnetwork.secondary_ip_range.1.range_name}" - } - master_authorized_networks_config { - cidr_blocks = [] - } -} - -resource "google_container_node_pool" "np" { - name = "%s" - zone = "us-central1-a" - cluster = "${google_container_cluster.cluster.name}" - max_pods_per_node = 30 - initial_node_count = 2 -}`, cluster, cluster, np) -} - func testAccContainerNodePool_regionalClusters(cluster, np string) string { return fmt.Sprintf(` resource "google_container_cluster" "cluster" {