Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove max_pods_per_node from GA provider #2391

Merged
merged 1 commit into from
Nov 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions google/resource_container_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,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 @@ -475,12 +475,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 @@ -532,10 +526,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