Skip to content

Commit

Permalink
google-cloud: Set disk.device_name to match API default
Browse files Browse the repository at this point in the history
* 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.
* poseidon#34
* hashicorp/terraform-provider-google#574
  • Loading branch information
dghubble committed Oct 12, 2017
1 parent a5290da commit a97df83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions google-cloud/container-linux/kubernetes/workers/workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a97df83

Please sign in to comment.