|
1 | 1 | # Infrastructure providers |
2 | | -{{- range $name, $infra := $.Values.infrastructure }} |
3 | | - {{- $infrastructureNamespace := default ( printf "%s-%s" $name "infrastructure-system" ) (get $infra "namespace") }} |
4 | | - {{- $infrastructureName := $name }} |
5 | | - {{- $infrastructureVersion := get $infra "version" }} |
| 2 | +{{- if .Values.infrastructure }} |
| 3 | +{{- $infrastructures := split ";" .Values.infrastructure }} |
| 4 | +{{- $infrastructureNamespace := "" }} |
| 5 | +{{- $infrastructureName := "" }} |
| 6 | +{{- $infrastructureVersion := "" }} |
| 7 | +{{- range $infrastructure := $infrastructures }} |
| 8 | +{{- $infrastructureArgs := split ":" $infrastructure }} |
| 9 | +{{- $infrastructureArgsLen := len $infrastructureArgs }} |
| 10 | +{{- if eq $infrastructureArgsLen 3 }} |
| 11 | + {{- $infrastructureNamespace = $infrastructureArgs._0 }} |
| 12 | + {{- $infrastructureName = $infrastructureArgs._1 }} |
| 13 | + {{- $infrastructureVersion = $infrastructureArgs._2 }} |
| 14 | +{{- else if eq $infrastructureArgsLen 2 }} |
| 15 | + {{- $infrastructureNamespace = print $infrastructureArgs._0 "-infrastructure-system" }} |
| 16 | + {{- $infrastructureName = $infrastructureArgs._0 }} |
| 17 | + {{- $infrastructureVersion = $infrastructureArgs._1 }} |
| 18 | +{{- else if eq $infrastructureArgsLen 1 }} |
| 19 | + {{- $infrastructureNamespace = print $infrastructureArgs._0 "-infrastructure-system" }} |
| 20 | + {{- $infrastructureName = $infrastructureArgs._0 }} |
| 21 | +{{- else }} |
| 22 | + {{- fail "infrastructure provider argument should have the following format aws:v1.0.0 or mynamespace:aws:v1.0.0" }} |
| 23 | +{{- end }} |
6 | 24 | --- |
7 | 25 | apiVersion: v1 |
8 | 26 | kind: Namespace |
|
65 | 83 | {{- if $.Values.additionalDeployments }} |
66 | 84 | additionalDeployments: {{ toYaml $.Values.additionalDeployments | nindent 4 }} |
67 | 85 | {{- end }} |
68 | | -{{- if $infra.manifestPatches }} |
69 | | - manifestPatches: {{- toYaml $infra.manifestPatches | nindent 4 }} |
70 | | -{{- end }} {{/* if $infra.manifestPatches */}} |
71 | | -{{- if $infra.additionalManifests }} |
72 | | - additionalManifests: |
73 | | - name: {{ $infra.additionalManifests.name }} |
74 | | - {{- if $infra.additionalManifests.namespace }} |
75 | | - namespace: {{ $infra.additionalManifests.namespace }} |
76 | | - {{- end }} {{/* if $infra.additionalManifests.namespace */}} |
77 | | -{{- end }} {{/* if $infra.additionalManifests */}} |
78 | | -{{- if $infra.additionalManifests }} |
79 | | ---- |
80 | | -apiVersion: v1 |
81 | | -kind: ConfigMap |
82 | | -metadata: |
83 | | - name: {{ $infra.additionalManifests.name }} |
84 | | - namespace: {{ default $infrastructureNamespace $infra.additionalManifests.namespace }} |
85 | | -data: |
86 | | - manifests: {{- toYaml $infra.additionalManifests.manifests | nindent 4 }} |
87 | 86 | {{- end }} |
88 | | -{{- end }} {{/* range $name, $infra := .Values.infrastructure */}} |
| 87 | +{{- end }} |
0 commit comments