mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
support for more helm template args (#4926)
* support for more helm template args * move templateArgs and unit tests to api/types * undo package name change * use our own simple helm chart instead of forking one * add argument to AsHelmArgs * code review * lint errors
This commit is contained in:
7
api/krusty/testdata/helmcharts/test-chart/templates/_helpers.tpl
vendored
Normal file
7
api/krusty/testdata/helmcharts/test-chart/templates/_helpers.tpl
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{{- define "apiversion" -}}
|
||||
{{- if .Capabilities.APIVersions.Has "foo/v1" -}}
|
||||
foo/v1
|
||||
{{- else -}}
|
||||
apps/v1
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
18
api/krusty/testdata/helmcharts/test-chart/templates/deployment.yaml
vendored
Normal file
18
api/krusty/testdata/helmcharts/test-chart/templates/deployment.yaml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
apiVersion: {{ template "apiversion" . }}
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
name: my-deploy
|
||||
namespace: {{ .Values.data.namespace }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Chart.Name }}
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: "{{ .Values.data.image.name }}:{{ .Values.data.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.data.image.imagePullPolicy }}
|
||||
6
api/krusty/testdata/helmcharts/test-chart/templates/tests/test-pod.yaml
vendored
Normal file
6
api/krusty/testdata/helmcharts/test-chart/templates/tests/test-pod.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: {{ template "apiversion" . }}
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
Reference in New Issue
Block a user