From a97df839ea3d31ab666033965730b5d56b3b12e0 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 11 Oct 2017 18:04:39 -0700 Subject: [PATCH] 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 --- .../container-linux/kubernetes/controllers/controllers.tf | 3 +++ google-cloud/container-linux/kubernetes/workers/workers.tf | 3 +++ 2 files changed, 6 insertions(+) diff --git a/google-cloud/container-linux/kubernetes/controllers/controllers.tf b/google-cloud/container-linux/kubernetes/controllers/controllers.tf index 560f3c9f..abb8012b 100644 --- a/google-cloud/container-linux/kubernetes/controllers/controllers.tf +++ b/google-cloud/container-linux/kubernetes/controllers/controllers.tf @@ -55,6 +55,9 @@ resource "google_compute_instance_template" "controller" { boot = true source_image = "${var.os_image}" 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 { diff --git a/google-cloud/container-linux/kubernetes/workers/workers.tf b/google-cloud/container-linux/kubernetes/workers/workers.tf index 659e1963..094ba397 100644 --- a/google-cloud/container-linux/kubernetes/workers/workers.tf +++ b/google-cloud/container-linux/kubernetes/workers/workers.tf @@ -55,6 +55,9 @@ resource "google_compute_instance_template" "worker" { boot = true source_image = "${var.os_image}" 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 {