aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/mock_files/mock_charts/testchart3/templates
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2020-11-12 09:13:37 +0100
committerKonrad Bańka <k.banka@samsung.com>2020-11-18 14:16:29 +0100
commit8c86f56defd56c5ea02eb6952ba4b852599100d5 (patch)
tree22914b5a493ffdff2f540354e38019869976cbcb /src/k8splugin/mock_files/mock_charts/testchart3/templates
parent0c352ef0d74d4b51a0fce5123b34a6753e8ab6a4 (diff)
Improve early-detection of empty template
Previous empty template detection pattern matched only against templates resolved to empty-or-whitespace-only files. This change makes it handle other case of empty yaml correctly, namely, yaml containing comments only. Issue-ID: MULTICLOUD-1252 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I9132e167ec607c8a4a4ca5584141ed043c6ddd4f
Diffstat (limited to 'src/k8splugin/mock_files/mock_charts/testchart3/templates')
-rw-r--r--src/k8splugin/mock_files/mock_charts/testchart3/templates/always-empty.yaml9
-rw-r--r--src/k8splugin/mock_files/mock_charts/testchart3/templates/multi.yaml34
-rw-r--r--src/k8splugin/mock_files/mock_charts/testchart3/templates/only-comment.yaml6
3 files changed, 49 insertions, 0 deletions
diff --git a/src/k8splugin/mock_files/mock_charts/testchart3/templates/always-empty.yaml b/src/k8splugin/mock_files/mock_charts/testchart3/templates/always-empty.yaml
new file mode 100644
index 00000000..121130fc
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_charts/testchart3/templates/always-empty.yaml
@@ -0,0 +1,9 @@
+---
+{{ if eq 0 1 }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: dummy
+data:
+ key1: value1
+{{ end }}
diff --git a/src/k8splugin/mock_files/mock_charts/testchart3/templates/multi.yaml b/src/k8splugin/mock_files/mock_charts/testchart3/templates/multi.yaml
new file mode 100644
index 00000000..0539cfb4
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_charts/testchart3/templates/multi.yaml
@@ -0,0 +1,34 @@
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: dummy
+data:
+ key1: value1
+---
+{{ if .Values.goingEmpty }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: dummy
+spec:
+ template:
+ metadata:
+ labels:
+ app: dummy
+ spec:
+ container:
+ - name: dummy
+ image: dummy
+{{ end }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: dummy
+spec:
+ ports:
+ - port: 80
+ protocol: TCP
+ selector:
+ app: dummy
diff --git a/src/k8splugin/mock_files/mock_charts/testchart3/templates/only-comment.yaml b/src/k8splugin/mock_files/mock_charts/testchart3/templates/only-comment.yaml
new file mode 100644
index 00000000..aaacc787
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_charts/testchart3/templates/only-comment.yaml
@@ -0,0 +1,6 @@
+#not so empty?
+#Copyright or something similiar
+#Some license info
+{{/*
+ empty
+*/}}