From 300eb1f2cee66a5057380967e09d1340e74b545a Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Wed, 17 Aug 2022 11:15:17 -0700 Subject: [PATCH] fix: change asm module depends_on method (#1354) --- modules/asm/README.md | 2 +- modules/asm/main.tf | 4 ++-- modules/asm/variables.tf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/asm/README.md b/modules/asm/README.md index d37a185c6..fd2b9c0dd 100644 --- a/modules/asm/README.md +++ b/modules/asm/README.md @@ -60,7 +60,7 @@ To deploy this config: | enable\_vpc\_sc | Determines whether to enable VPC-SC for this ASM installation. For more information read https://cloud.google.com/service-mesh/docs/managed/vpc-sc | `bool` | `false` | no | | fleet\_id | The fleet to use for this ASM installation. | `string` | `""` | no | | internal\_ip | Use internal ip for the cluster endpoint when running kubectl commands. | `bool` | `false` | no | -| module\_depends\_on | List of modules or resources this module depends on. | `list(any)` | `[]` | no | +| module\_depends\_on | List of modules or resources this module depends on. If multiple, all items must be the same type. | `list(any)` | `[]` | no | | multicluster\_mode | [Preview] Determines whether remote secrets should be autogenerated across fleet cluster. | `string` | `"manual"` | no | | project\_id | The project in which the resource belongs. | `string` | n/a | yes | diff --git a/modules/asm/main.tf b/modules/asm/main.tf index 31276b7c2..a6110cb30 100644 --- a/modules/asm/main.tf +++ b/modules/asm/main.tf @@ -48,7 +48,7 @@ resource "kubernetes_config_map" "asm_options" { ASM_OPTS = var.enable_cni ? "CNI=on" : null } - depends_on = [google_gke_hub_membership.membership, google_gke_hub_feature.mesh] + depends_on = [google_gke_hub_membership.membership, google_gke_hub_feature.mesh, var.module_depends_on] } module "cpr" { @@ -63,5 +63,5 @@ module "cpr" { kubectl_create_command = "${path.module}/scripts/create_cpr.sh ${local.revision_name} ${local.channel} ${var.enable_cni} ${var.enable_vpc_sc}" kubectl_destroy_command = "${path.module}/scripts/destroy_cpr.sh ${local.revision_name}" - module_depends_on = concat([kubernetes_config_map.asm_options], var.module_depends_on) + module_depends_on = [kubernetes_config_map.asm_options] } diff --git a/modules/asm/variables.tf b/modules/asm/variables.tf index ca0818ad1..ab69bee5f 100644 --- a/modules/asm/variables.tf +++ b/modules/asm/variables.tf @@ -94,7 +94,7 @@ variable "internal_ip" { } variable "module_depends_on" { - description = "List of modules or resources this module depends on." + description = "List of modules or resources this module depends on. If multiple, all items must be the same type." type = list(any) default = [] }