-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(argo-cd): represent cluster credentials as a map
So it can be merged with values coming from different sources. Closes #2592 Signed-off-by: Nacho Barrientos <nacho.barrientos@cern.ch>
- Loading branch information
1 parent
408500c
commit 8eba6e7
Showing
4 changed files
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions
26
charts/argo-cd/templates/argocd-configs/cluster-secrets.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
{{- range .Values.configs.clusterCredentials }} | ||
{{- range $cluster_key, $cluster_value := .Values.configs.clusterCredentials }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "argo-cd.name" $ }}-cluster-{{ .name }} | ||
name: {{ include "argo-cd.name" $ }}-cluster-{{ $cluster_key }} | ||
namespace: {{ $.Release.Namespace | quote }} | ||
labels: | ||
{{- include "argo-cd.labels" (dict "context" $) | nindent 4 }} | ||
{{- with .labels }} | ||
{{- with $cluster_value.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
argocd.argoproj.io/secret-type: cluster | ||
{{- with .annotations }} | ||
{{- with $cluster_value.annotations }} | ||
annotations: | ||
{{- range $key, $value := . }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
type: Opaque | ||
stringData: | ||
name: {{ required "A valid .Values.configs.clusterCredentials[].name entry is required!" .name }} | ||
server: {{ required "A valid .Values.configs.clusterCredentials[].server entry is required!" .server }} | ||
{{- if .namespaces }} | ||
namespaces: {{ .namespaces }} | ||
{{- if .clusterResources }} | ||
clusterResources: {{ .clusterResources | quote }} | ||
name: {{ required "A valid .Values.configs.clusterCredentials.CLUSTERNAME.name entry is required!" $cluster_key }} | ||
server: {{ required "A valid .Values.configs.clusterCredentials.CLUSTERNAME.server entry is required!" $cluster_value.server }} | ||
{{- if $cluster_value.namespaces }} | ||
namespaces: {{ $cluster_value.namespaces }} | ||
{{- if $cluster_value.clusterResources }} | ||
clusterResources: {{ $cluster_value.clusterResources | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .project }} | ||
project: {{ .project | quote }} | ||
{{- if $cluster_value.project }} | ||
project: {{ $cluster_value.project | quote }} | ||
{{- end }} | ||
config: | | ||
{{- required "A valid .Values.configs.clusterCredentials[].config entry is required!" .config | toRawJson | nindent 4 }} | ||
{{- required "A valid .Values.configs.clusterCredentials.CLUSTERNAME.config entry is required!" $cluster_value.config | toRawJson | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters