From b819948e050c0e6991285be4cdcdf812352d28a2 Mon Sep 17 00:00:00 2001 From: Sijo George <87609749+sijo5722-2021@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:25:02 +0530 Subject: [PATCH] env netbird fix (#355) --- .../deploy-env-onboard/env-onboard-xplane-terraform.yaml | 4 +++- .../ccnew-config/env-onboard-config/netbird.tf | 2 +- .../ccnew-config/env-onboard-config/variables.tf | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gitops/applications/base/deploy-env-onboard/env-onboard-xplane-terraform.yaml b/gitops/applications/base/deploy-env-onboard/env-onboard-xplane-terraform.yaml index f87c42960..48b6f28de 100644 --- a/gitops/applications/base/deploy-env-onboard/env-onboard-xplane-terraform.yaml +++ b/gitops/applications/base/deploy-env-onboard/env-onboard-xplane-terraform.yaml @@ -59,7 +59,9 @@ spec: - key: managed_svc_enabled value: "${ARGOCD_ENV_managed_svc_enabled}" - key: "k8s_cluster_type" - value: "${ARGOCD_ENV_k8s_cluster_type}" + value: "${ARGOCD_ENV_k8s_cluster_type}" + - key: cc_cluster_name + value: ${ARGOCD_ENV_cluster_name} # All Terraform outputs are written to the connection secret. providerConfigRef: diff --git a/terraform/config-params/ccnew-config/env-onboard-config/netbird.tf b/terraform/config-params/ccnew-config/env-onboard-config/netbird.tf index 98dba8a7e..94c36c51f 100644 --- a/terraform/config-params/ccnew-config/env-onboard-config/netbird.tf +++ b/terraform/config-params/ccnew-config/env-onboard-config/netbird.tf @@ -48,7 +48,7 @@ data "netbird_groups" "all" { locals { cc_user_group_id = [for group in data.netbird_groups.all.groups : group.id if strcontains(group.name, "${local.netbird_project_id}:${var.netbird_user_rbac_group}")][0] env_k8s_peers_group_id = [for group in data.netbird_groups.all.groups : group.id if strcontains(group.name, "${var.env_name}-k8s-peers")][0] - cc_gw_group_id = [for group in data.netbird_groups.all.groups : group.id if strcontains(group.name, "cntrlcntr-gateway")][0] + cc_gw_group_id = [for group in data.netbird_groups.all.groups : group.id if strcontains(group.name, "${var.cc_cluster_name}-gateway")][0] } diff --git a/terraform/config-params/ccnew-config/env-onboard-config/variables.tf b/terraform/config-params/ccnew-config/env-onboard-config/variables.tf index 36dfb5032..48fbc8162 100644 --- a/terraform/config-params/ccnew-config/env-onboard-config/variables.tf +++ b/terraform/config-params/ccnew-config/env-onboard-config/variables.tf @@ -97,4 +97,8 @@ variable "managed_svc_enabled" { variable "k8s_cluster_type" { type = string description = "k8s distribution if its eks/microk8s" -} \ No newline at end of file +} + +variable "cc_cluster_name" { + description = "control center cluster name" +} \ No newline at end of file