From 64f72b7b177ec8190ab500416554296796f7c5fa Mon Sep 17 00:00:00 2001 From: Archisman Date: Wed, 9 Oct 2024 00:03:37 +0530 Subject: [PATCH] Make customerid optional in CAPI Cluster Helm values Signed-off-by: Archisman --- .../capi-cluster/templates/provider-aws.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/argocd-helm-charts/capi-cluster/templates/provider-aws.yaml b/argocd-helm-charts/capi-cluster/templates/provider-aws.yaml index b6a0c895b..8e202b5b2 100644 --- a/argocd-helm-charts/capi-cluster/templates/provider-aws.yaml +++ b/argocd-helm-charts/capi-cluster/templates/provider-aws.yaml @@ -1,13 +1,24 @@ {{- if (.Values.provider).aws }} + +# For non Obmondo users, no customerid is needed. +{{- $name := "aws" }} +{{- $namespace := "capi-cluster" }} + +# For obmondo customers. +{{- if .Values.global.customerid }} +{{- $name = printf "%s-%s" $name .Values.global.customerid }} +{{- $namespace = printf "%s-%s" $namespace .Values.global.customerid }} +{{- end }} + apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: - name: aws-{{ .Values.global.customerid }} - namespace: capi-cluster-{{ .Values.global.customerid }} + name: {{ $name }} + namespace: {{ $namespace }} spec: configSecret: name: {{ .Values.aws.secretName }} - namespace: capi-cluster-{{ .Values.global.customerid }} + namespace: {{ $namespace }} version: {{ .Values.global.capa.version }} fetchConfig: url: https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/{{ .Values.global.capa.version }}/infrastructure-components.yaml