Skip to content

Commit

Permalink
Remove max_pods_per_node from GA provider (hashicorp#2391)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and Lawrence, Andrew committed Nov 2, 2018
1 parent 22574c6 commit d055acf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 90 deletions.
20 changes: 5 additions & 15 deletions google/resource_container_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{}
Expand Down Expand Up @@ -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,
Expand Down
75 changes: 0 additions & 75 deletions google/resource_container_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit d055acf

Please sign in to comment.