Skip to content

Commit

Permalink
Don't create MeshConfig if unset
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Naser committed Feb 10, 2022
1 parent 8ce0635 commit c961aaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/asm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ resource "kubernetes_namespace" "system_namespace" {
}

resource "kubernetes_config_map" "mesh_config" {
count = length(var.mesh_config) == 0 ? 0 : 1

metadata {
name = local.mesh_config_name
namespace = kubernetes_namespace.system_namespace.metadata[0].name
labels = {
"istio.io/rev" = local.revision_name
}
}

data = {
mesh = yamlencode(var.mesh_config)
}
Expand All @@ -55,7 +58,8 @@ resource "kubernetes_config_map" "asm_options" {
metadata {
name = "asm-options"
namespace = kubernetes_namespace.system_namespace.metadata[0].name
}
}


data = {
CROSS_CLUSTER_SERVICE_DISCOVERY = var.enable_cross_cluster_service_discovery ? "ON" : "OFF"
Expand Down
2 changes: 1 addition & 1 deletion modules/asm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ variable "enable_cross_cluster_service_discovery" {
}

variable "mesh_config" {
description = "MeshConfig specifies configuration available to the control plane. The full list of options can be found at https://istio.io/latest/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig"
description = "MeshConfig specifies configuration available to the control plane. If unset the module will not attempt to create the MeshConfig (i.e. if managing this configuration elsewhere). The full list of options can be found at https://istio.io/latest/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig"
type = map(any)
default = {}
}

0 comments on commit c961aaa

Please sign in to comment.