google-cloud: Set disk.device_name to match API default

* Terraform provider "google" plugin releases leave the disk
device_name as "" by default. Recently the API has started to
set a default name "persistent-disk-0". Plan and apply show
all instance groups need to be recreated to "fix" the name
* Impact: Controller and worker instance groups are deleted
and recreated, deleting data on controllers and bringing
down clusters
* Fix: Explicitly set the disk_name to persistent-disk-0 so
that terraform finds no diff needs to be applied.
* https://github.com/poseidon/typhoon/issues/34
* https://github.com/terraform-providers/terraform-provider-google/issues/574
This commit is contained in:
Dalton Hubble 2017-10-11 18:04:39 -07:00
parent a5290dac32
commit a97df839ea
2 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,9 @@ resource "google_compute_instance_template" "controller" {
boot = true boot = true
source_image = "${var.os_image}" source_image = "${var.os_image}"
disk_size_gb = "${var.disk_size}" disk_size_gb = "${var.disk_size}"
// Set explicit name to match the new default name set by the API.
// https://github.com/terraform-providers/terraform-provider-google/issues/574
device_name = "persistent-disk-0"
} }
network_interface { network_interface {

View File

@ -55,6 +55,9 @@ resource "google_compute_instance_template" "worker" {
boot = true boot = true
source_image = "${var.os_image}" source_image = "${var.os_image}"
disk_size_gb = "${var.disk_size}" disk_size_gb = "${var.disk_size}"
// Set explicit name to match the new default name set by the API.
// https://github.com/terraform-providers/terraform-provider-google/issues/574
device_name = "persistent-disk-0"
} }
network_interface { network_interface {