Handle GKE 1.12 node_config.metadata default value (#3233)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2019-03-13 11:02:55 -07:00 committed by Riley Karson
parent 1013601260
commit 5efcfae478
3 changed files with 17 additions and 1 deletions

View File

@ -96,6 +96,7 @@ var schemaNodeConfig = &schema.Schema{
"metadata": { "metadata": {
Type: schema.TypeMap, Type: schema.TypeMap,
Optional: true, Optional: true,
Computed: true,
ForceNew: true, ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString}, Elem: &schema.Schema{Type: schema.TypeString},
}, },

View File

@ -61,6 +61,10 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
preemptible = true preemptible = true
machine_type = "n1-standard-1" machine_type = "n1-standard-1"
metadata {
disable-legacy-endpoints = "true"
}
oauth_scopes = [ oauth_scopes = [
"https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/devstorage.read_only",
@ -107,6 +111,10 @@ resource "google_container_cluster" "primary" {
"https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/monitoring",
] ]
metadata {
disable-legacy-endpoints = "true"
}
labels = { labels = {
foo = "bar" foo = "bar"
} }
@ -481,7 +489,10 @@ The `node_config` block supports:
[here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType). [here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType).
* `metadata` - (Optional) The metadata key/value pairs assigned to instances in * `metadata` - (Optional) The metadata key/value pairs assigned to instances in
the cluster. the cluster. From GKE `1.12` onwards, `disable-legacy-endpoints` is set to
`true` by the API; if `metadata` is set but that default value is not
included, Terraform will attempt to unset the value. To avoid this, set the
value in your config.
* `min_cpu_platform` - (Optional) Minimum CPU platform to be used by this instance. * `min_cpu_platform` - (Optional) Minimum CPU platform to be used by this instance.
The instance may be scheduled on the specified or newer CPU platform. Applicable The instance may be scheduled on the specified or newer CPU platform. Applicable

View File

@ -84,6 +84,10 @@ resource "google_container_cluster" "primary" {
"https://www.googleapis.com/auth/monitoring", "https://www.googleapis.com/auth/monitoring",
] ]
metadata {
disable-legacy-endpoints = "true"
}
guest_accelerator { guest_accelerator {
type = "nvidia-tesla-k80" type = "nvidia-tesla-k80"
count = 1 count = 1