Skip to content

Commit c961aaa

Browse files
author
Sam Naser
committed
Don't create MeshConfig if unset
1 parent 8ce0635 commit c961aaa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

modules/asm/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ resource "kubernetes_namespace" "system_namespace" {
3939
}
4040

4141
resource "kubernetes_config_map" "mesh_config" {
42+
count = length(var.mesh_config) == 0 ? 0 : 1
43+
4244
metadata {
4345
name = local.mesh_config_name
4446
namespace = kubernetes_namespace.system_namespace.metadata[0].name
4547
labels = {
4648
"istio.io/rev" = local.revision_name
4749
}
4850
}
51+
4952
data = {
5053
mesh = yamlencode(var.mesh_config)
5154
}
@@ -55,7 +58,8 @@ resource "kubernetes_config_map" "asm_options" {
5558
metadata {
5659
name = "asm-options"
5760
namespace = kubernetes_namespace.system_namespace.metadata[0].name
58-
}
61+
}
62+
5963

6064
data = {
6165
CROSS_CLUSTER_SERVICE_DISCOVERY = var.enable_cross_cluster_service_discovery ? "ON" : "OFF"

modules/asm/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ variable "enable_cross_cluster_service_discovery" {
6565
}
6666

6767
variable "mesh_config" {
68-
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"
68+
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"
6969
type = map(any)
7070
default = {}
7171
}

0 commit comments

Comments
 (0)