diff --git a/charts/wonderwall/Feature.yaml b/charts/wonderwall/Feature.yaml index 792c990..846e7bf 100644 --- a/charts/wonderwall/Feature.yaml +++ b/charts/wonderwall/Feature.yaml @@ -110,3 +110,7 @@ values: type: string ignoreKind: - legacy + resourceSuffix: + description: Suffix for resources that may conflict in parallel environments. + config: + type: string diff --git a/charts/wonderwall/templates/_helpers.tpl b/charts/wonderwall/templates/_helpers.tpl index 05afc91..4fcb66f 100644 --- a/charts/wonderwall/templates/_helpers.tpl +++ b/charts/wonderwall/templates/_helpers.tpl @@ -121,7 +121,13 @@ Aiven instance name. The last part of the fully qualified name (e.g. in `redis--`) */}} {{- define "aiven.instanceName" -}} -{{- printf "wonderwall-%s" . }} +{{- $root := .root }} +{{- $provider := .provider }} +{{- if $root.Values.resourceSuffix }} +{{- printf "wonderwall-%s-%s" $provider $root.Values.resourceSuffix }} +{{- else }} +{{- printf "wonderwall-%s" $provider }} +{{- end }} {{- end }} {{/* @@ -134,7 +140,7 @@ Expects a dict with the following keys: {{- define "aiven.redisName" -}} {{- $root := .root }} {{- $provider := .provider }} -{{- printf "redis-%s-%s" $root.Release.Namespace (include "aiven.instanceName" $provider) }} +{{- printf "redis-%s-%s" $root.Release.Namespace (include "aiven.instanceName" (dict "provider" $provider "root" $root)) }} {{- end }} {{/* @@ -147,5 +153,5 @@ Expects a dict with the following keys: {{- define "aiven.serviceintegrationName" -}} {{- $root := .root }} {{- $provider := .provider }} -{{- printf "serviceintegration-%s-%s" $root.Release.Namespace (include "aiven.instanceName" $provider) }} +{{- printf "serviceintegration-%s-%s" $root.Release.Namespace (include "aiven.instanceName" (dict "provider" $provider "root" $root)) }} {{- end }} diff --git a/charts/wonderwall/templates/_resources.yaml b/charts/wonderwall/templates/_resources.yaml index b9248c7..c25092c 100644 --- a/charts/wonderwall/templates/_resources.yaml +++ b/charts/wonderwall/templates/_resources.yaml @@ -65,7 +65,7 @@ Expects a dict as input with the following keys: {{- $provider := .provider }} {{- $access := .access }} {{- $secretName := .secretName -}} -{{- $instance := include "aiven.instanceName" $provider }} +{{- $instance := include "aiven.instanceName" (dict "provider" $provider "root" $root) }} --- apiVersion: aiven.nais.io/v1 kind: AivenApplication diff --git a/charts/wonderwall/templates/fa-azureapp.yaml b/charts/wonderwall/templates/fa-azureapp.yaml index 348776d..317f220 100644 --- a/charts/wonderwall/templates/fa-azureapp.yaml +++ b/charts/wonderwall/templates/fa-azureapp.yaml @@ -3,7 +3,11 @@ apiVersion: nais.io/v1 kind: AzureAdApplication metadata: + {{- if .Values.resourceSuffix }} + name: {{ include "wonderwall.fullname" . }}-fa-{{ .Values.resourceSuffix }} + {{- else }} name: {{ include "wonderwall.fullname" . }}-fa + {{- end }} labels: {{- include "wonderwall.labelsForwardAuth" . | nindent 4 }} spec: diff --git a/charts/wonderwall/values.yaml b/charts/wonderwall/values.yaml index 7c4d414..979ba60 100644 --- a/charts/wonderwall/values.yaml +++ b/charts/wonderwall/values.yaml @@ -70,6 +70,7 @@ resources: requests: cpu: 100m memory: 64Mi +resourceSuffix: "" podDisruptionBudget: maxUnavailable: 1 otel: