Skip to content

Commit c61787a

Browse files
author
Sam Naser
committed
Fix enable_mdp to just enable CNI
1 parent 5235884 commit c61787a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

modules/asm/main.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ locals {
2121
// In order or precedence, use (1) user specified channel, (2) GKE release channel, and (3) regular channel
2222
channel = lower(coalesce(var.channel, local.gke_release_channel_fixed, "regular"))
2323
revision_name = "asm-managed${local.channel == "regular" ? "" : "-${local.channel}"}"
24-
mesh_config_name= "istio-${local.revision_name}"
24+
mesh_config_name = "istio-${local.revision_name}"
25+
// CNI should be enabled if either enable_cni or enable_mdp are set
26+
enable_cni = var.enable_cni || var.enable_mdp
2527
}
2628

2729
data "google_container_cluster" "asm_cluster" {
@@ -45,9 +47,6 @@ resource "kubernetes_config_map" "mesh_config" {
4547
metadata {
4648
name = local.mesh_config_name
4749
namespace = kubernetes_namespace.system_namespace.metadata[0].name
48-
annotations = {
49-
"mesh.cloud.google.com/proxy" = "{\"managed\": \"${var.enable_mdp}\"}"
50-
}
5150
labels = {
5251
"istio.io/rev" = local.revision_name
5352
}
@@ -82,7 +81,7 @@ module "cpr" {
8281
cluster_name = var.cluster_name
8382
cluster_location = var.cluster_location
8483

85-
kubectl_create_command = "${path.module}/scripts/create_cpr.sh ${local.revision_name} ${local.channel} ${var.enable_cni}"
84+
kubectl_create_command = "${path.module}/scripts/create_cpr.sh ${local.revision_name} ${local.channel} ${local.enable_cni}"
8685
kubectl_destroy_command = "${path.module}/scripts/destroy_cpr.sh ${local.revision_name}"
8786

8887
module_depends_on = [kubernetes_config_map.asm_options, kubernetes_config_map.mesh_config]

modules/asm/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ variable "enable_cni" {
5050
default = true
5151
}
5252

53+
// This should be validated so that it cannot be enabled while CNI is disabled
54+
// but validating based on other variables is not possible today (https://github.com/hashicorp/terraform/issues/25609)
5355
variable "enable_mdp" {
5456
description = "Determines whether to enable Managed Data Plane (MDP) for this ASM installation."
5557
type = bool

0 commit comments

Comments
 (0)