Skip to content

Commit e32bc39

Browse files
authored
add extra manifests support (external-secrets#3421)
Signed-off-by: upodroid <upodroid@users.noreply.github.com> Co-authored-by: upodroid <upodroid@users.noreply.github.com>
1 parent 1edd909 commit e32bc39

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

deploy/charts/external-secrets/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ The command removes all the Kubernetes components associated with the chart and
9595
| extraArgs | object | `{}` | |
9696
| extraContainers | list | `[]` | |
9797
| extraEnv | list | `[]` | |
98+
| extraObjects | list | `[]` | Extra Kubernetes manifests to deploy with the chart |
9899
| extraVolumeMounts | list | `[]` | |
99100
| extraVolumes | list | `[]` | |
100101
| fullnameOverride | string | `""` | |

deploy/charts/external-secrets/templates/_helpers.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,15 @@ Determine the image to use, including if using a flavour.
154154
{{ printf "%s:%s" .image.repository (.image.tag | default .chartAppVersion) }}
155155
{{- end }}
156156
{{- end }}
157+
158+
159+
{{/*
160+
Renders a complete tree, even values that contains template.
161+
*/}}
162+
{{- define "external-secrets.render" -}}
163+
{{- if typeIs "string" .value }}
164+
{{- tpl .value .context }}
165+
{{ else }}
166+
{{- tpl (.value | toYaml) .context }}
167+
{{- end }}
168+
{{- end -}}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- range .Values.extraObjects }}
2+
---
3+
{{ include "external-secrets.render" (dict "value" . "context" $) }}
4+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
suite: test adding extra kubernetes objects
2+
templates:
3+
- extra-manifests.yaml
4+
tests:
5+
- it: should load extra manifests
6+
set:
7+
extraObjects:
8+
- apiVersion: v1
9+
kind: ServiceAccount
10+
metadata:
11+
name: random
12+
asserts:
13+
- equal:
14+
path: kind
15+
value: ServiceAccount

deploy/charts/external-secrets/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ extraArgs: {}
114114
## -- Extra volumes to pass to pod.
115115
extraVolumes: []
116116

117+
## -- Extra Kubernetes objects to deploy with the helm chart
118+
extraObjects: []
119+
117120
## -- Extra volumes to mount to the container.
118121
extraVolumeMounts: []
119122

0 commit comments

Comments
 (0)