|
1 | 1 | # Infrastructure providers |
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 }} |
| 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" }} |
24 | 6 | --- |
25 | 7 | apiVersion: v1 |
26 | 8 | kind: Namespace |
|
83 | 65 | {{- if $.Values.additionalDeployments }} |
84 | 66 | additionalDeployments: {{ toYaml $.Values.additionalDeployments | nindent 4 }} |
85 | 67 | {{- 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 }} |
86 | 87 | {{- end }} |
87 | | -{{- end }} |
| 88 | +{{- end }} {{/* range $name, $infra := .Values.infrastructure */}} |
0 commit comments