Skip to content

Commit 9329d23

Browse files
committed
update app names
1 parent a55be32 commit 9329d23

27 files changed

+60
-28
lines changed

charts/platform/templates/_helpers.tpl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ release: {{ .Release.Name | quote }}
6868

6969
{{- define "platform.argocd.application" -}}
7070
{{- $root := .root -}}
71+
{{- $clusterName := include "platform.clusterName" $root -}}
72+
{{- $defaultName := printf "%s--%s" $clusterName .name -}}
73+
{{- $name := ternary .name $defaultName (contains $clusterName .name) -}}
7174
{{- $project := default "default" $root.Values.argocd.project -}}
7275
{{- $destServer := default "https://kubernetes.default.svc" $root.Values.argocd.destination.server -}}
7376
{{- $destNs := default $root.Release.Namespace $root.Values.argocd.destination.namespace -}}
@@ -80,7 +83,7 @@ release: {{ .Release.Name | quote }}
8083
apiVersion: argoproj.io/v1alpha1
8184
kind: Application
8285
metadata:
83-
name: {{ .name | trunc 63 | trimSuffix "-" }}
86+
name: {{ $name | trunc 63 | trimSuffix "-" }}
8487
labels:
8588
{{- include "platform.labels.common" $root | nindent 4 }}
8689
{{- if gt (len $labels) 0 }}
@@ -107,8 +110,10 @@ spec:
107110
chart: {{ required (printf "chart for %s application is required" .name) .chart }}
108111
targetRevision: {{ .targetRevision | default "latest" | quote }}
109112
helm:
110-
{{- with .releaseName }}
111-
releaseName: {{ . }}
113+
{{- if .releaseName }}
114+
releaseName: {{ .releaseName }}
115+
{{- else }}
116+
releaseName: {{ .name }}
112117
{{- end }}
113118
{{- with $helmValues }}
114119
valuesObject:

charts/platform/templates/kube-prometheus-stack-application.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ route:
3030

3131
{{- define "platform.argocd.applications.kubePrometheusStack.values" -}}
3232
{{- $platformTokenSecretName := dig "valueFrom" "secretKeyRef" "name" "" (include "platform.token" . | fromYaml) -}}
33+
nameOverride: prometheus
34+
fullnameOverride: prometheus
3335
global:
3436
imageRegistry: ghcr.io
3537
{{- with .Values.imagePullSecrets }}

charts/platform/tests/__snapshot__/alloy-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ should match snapshot:
88
chart: platform-1.0.0
99
heritage: Helm
1010
release: platform
11-
name: alloy
11+
name: test-cluster--alloy
1212
spec:
1313
destination:
1414
namespace: platform
@@ -17,6 +17,7 @@ should match snapshot:
1717
source:
1818
chart: alloy
1919
helm:
20+
releaseName: alloy
2021
valuesObject:
2122
alloy:
2223
configMap:

charts/platform/tests/__snapshot__/docker-registry-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ should match snapshot:
88
chart: platform-1.0.0
99
heritage: Helm
1010
release: platform
11-
name: docker-registry
11+
name: test-cluster--docker-registry
1212
spec:
1313
destination:
1414
namespace: platform
@@ -17,6 +17,7 @@ should match snapshot:
1717
source:
1818
chart: docker-registry
1919
helm:
20+
releaseName: docker-registry
2021
valuesObject:
2122
configData:
2223
storage:

charts/platform/tests/__snapshot__/external-secrets-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ should match snapshot:
1010
chart: platform-1.0.0
1111
heritage: Helm
1212
release: platform
13-
name: external-secrets
13+
name: test-cluster--external-secrets
1414
spec:
1515
destination:
1616
namespace: platform
@@ -19,6 +19,7 @@ should match snapshot:
1919
source:
2020
chart: external-secrets
2121
helm:
22+
releaseName: external-secrets
2223
valuesObject:
2324
installCRDs: true
2425
podLabels:

charts/platform/tests/__snapshot__/grafana-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ should match snapshot:
88
chart: platform-1.0.0
99
heritage: Helm
1010
release: platform
11-
name: grafana
11+
name: test-cluster--grafana
1212
spec:
1313
destination:
1414
namespace: platform
@@ -17,6 +17,7 @@ should match snapshot:
1717
source:
1818
chart: grafana
1919
helm:
20+
releaseName: grafana
2021
valuesObject:
2122
dashboardProviders:
2223
dashboardproviders.yaml:

charts/platform/tests/__snapshot__/keda-add-ons-http-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ should match snapshot:
88
chart: platform-1.0.0
99
heritage: Helm
1010
release: platform
11-
name: keda-add-ons-http
11+
name: test-cluster--keda-add-ons-http
1212
spec:
1313
destination:
1414
namespace: platform
@@ -17,6 +17,7 @@ should match snapshot:
1717
source:
1818
chart: keda-add-ons-http
1919
helm:
20+
releaseName: keda-add-ons-http
2021
valuesObject:
2122
interceptor:
2223
replicas:

charts/platform/tests/__snapshot__/keda-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ should match snapshot:
1010
chart: platform-1.0.0
1111
heritage: Helm
1212
release: platform
13-
name: keda
13+
name: test-cluster--keda
1414
spec:
1515
destination:
1616
namespace: platform
@@ -19,6 +19,7 @@ should match snapshot:
1919
source:
2020
chart: keda
2121
helm:
22+
releaseName: keda
2223
valuesObject:
2324
operator:
2425
replicaCount: 1

charts/platform/tests/__snapshot__/kube-prometheus-stack-application_test.yaml.snap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ should match snapshot:
1010
chart: platform-1.0.0
1111
heritage: Helm
1212
release: platform
13-
name: prometheus
13+
name: test-cluster--prometheus
1414
spec:
1515
destination:
1616
namespace: platform
@@ -19,6 +19,7 @@ should match snapshot:
1919
source:
2020
chart: kube-prometheus-stack
2121
helm:
22+
releaseName: prometheus
2223
valuesObject:
2324
alertmanager:
2425
alertmanagerSpec:
@@ -61,6 +62,7 @@ should match snapshot:
6162
enabled: false
6263
defaultRules:
6364
create: false
65+
fullnameOverride: prometheus
6466
global:
6567
imageRegistry: ghcr.io
6668
grafana:
@@ -122,6 +124,7 @@ should match snapshot:
122124
serviceMonitor:
123125
additionalLabels:
124126
platform.apolo.us/scrape-metrics: "true"
127+
nameOverride: prometheus
125128
nodeExporter:
126129
enabled: true
127130
prometheus:

charts/platform/tests/__snapshot__/loki-application_test.yaml.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ should match snapshot:
88
chart: platform-1.0.0
99
heritage: Helm
1010
release: platform
11-
name: loki
11+
name: test-cluster--loki
1212
spec:
1313
destination:
1414
namespace: platform
@@ -17,6 +17,7 @@ should match snapshot:
1717
source:
1818
chart: loki
1919
helm:
20+
releaseName: loki
2021
valuesObject:
2122
backend:
2223
podLabels:

0 commit comments

Comments
 (0)