Prevent helm from adding meaningless blank lines to kubernetes objects YAML (#1065)

This commit is contained in:
Chia-Chun Tai
2019-01-21 19:54:40 +08:00
committed by Ta-Ching Chen
parent 3c4fdb0659
commit 2efa255eb4
11 changed files with 34 additions and 35 deletions
+7 -8
View File
@@ -1,4 +1,3 @@
---
{{- if .Values.createNamespace }} {{- if .Values.createNamespace }}
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
@@ -403,8 +402,8 @@ spec:
name: influxdb name: influxdb
key: password key: password
---
{{- if .Values.heapster }} {{- if .Values.heapster }}
---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@@ -444,9 +443,8 @@ spec:
- /heapster - /heapster
- --source=kubernetes:https://kubernetes.default - --source=kubernetes:https://kubernetes.default
serviceAccount: {{ .Release.Namespace }}/fission-svc serviceAccount: {{ .Release.Namespace }}/fission-svc
---
{{- end }} {{- end }}
---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
@@ -495,8 +493,8 @@ spec:
# args: ["proxy", "--port", "8001", "--address", "127.0.0.1"] # args: ["proxy", "--port", "8001", "--address", "127.0.0.1"]
# serviceAccount: fission-svc # serviceAccount: fission-svc
---
{{- if .Values.nats.enabled }} {{- if .Values.nats.enabled }}
---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
@@ -518,7 +516,6 @@ spec:
"--auth", "{{ .Values.nats.authToken }}", "--auth", "{{ .Values.nats.authToken }}",
"--max_channels", "0" "--max_channels", "0"
] ]
ports: ports:
- containerPort: 4222 - containerPort: 4222
hostPort: 4222 hostPort: 4222
@@ -551,8 +548,9 @@ spec:
value: nats://{{ .Values.nats.authToken }}@nats-streaming:4222 value: nats://{{ .Values.nats.authToken }}@nats-streaming:4222
serviceAccount: fission-svc serviceAccount: fission-svc
{{- end }} {{- end }}
---
{{- if .Values.kafka.enabled }} {{- if .Values.kafka.enabled }}
---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
@@ -582,8 +580,9 @@ spec:
value: "{{.Values.kafka.version}}" value: "{{.Values.kafka.version}}"
serviceAccount: fission-svc serviceAccount: fission-svc
{{- end }} {{- end }}
---
{{- if .Values.azureStorageQueue.enabled }} {{- if .Values.azureStorageQueue.enabled }}
---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
+2 -2
View File
@@ -7,12 +7,12 @@ kind: ConfigMap
metadata: metadata:
name: {{ .Release.Name }}-fission-fluentd name: {{ .Release.Name }}-fission-fluentd
data: data:
{{ if .Files.Get "config/fluentd.conf" }} {{- if .Files.Get "config/fluentd.conf" }}
td-agent.conf: | td-agent.conf: |
{{ .Files.Get "config/fluentd.conf" | indent 3 }} {{ .Files.Get "config/fluentd.conf" | indent 3 }}
{{ else }} {{ else }}
{{ fail "invalid chart" }} {{ fail "invalid chart" }}
{{ end }} {{- end }}
--- ---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: DaemonSet kind: DaemonSet
@@ -1,4 +1,4 @@
{{ if .Values.analyticsNonHelmInstall }} {{- if .Values.analyticsNonHelmInstall }}
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@@ -28,4 +28,4 @@ spec:
- name: post-install-job - name: post-install-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"yaml-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"yaml-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }} {{- if .Values.analytics }}
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-install-job - name: post-install-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }} {{- if .Values.analytics }}
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-upgrade-job - name: post-upgrade-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{- end }}
+1 -1
View File
@@ -9,8 +9,8 @@ data:
username: {{ .Values.logger.influxdbAdmin | b64enc | quote }} username: {{ .Values.logger.influxdbAdmin | b64enc | quote }}
password: {{ randAlphaNum 20 | b64enc | quote }} password: {{ randAlphaNum 20 | b64enc | quote }}
---
{{- if .Values.azureStorageQueue.enabled }} {{- if .Values.azureStorageQueue.enabled }}
---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
+7 -7
View File
@@ -11,9 +11,9 @@ spec:
ports: ports:
- port: 80 - port: 80
targetPort: 8888 targetPort: 8888
{{ if eq .Values.routerServiceType "NodePort" }} {{- if eq .Values.routerServiceType "NodePort" }}
nodePort: {{ .Values.routerPort }} nodePort: {{ .Values.routerPort }}
{{ end }} {{- end }}
selector: selector:
svc: router svc: router
@@ -31,14 +31,14 @@ spec:
ports: ports:
- port: 80 - port: 80
targetPort: 8888 targetPort: 8888
{{ if eq .Values.serviceType "NodePort" }} {{- if eq .Values.serviceType "NodePort" }}
nodePort: {{ .Values.controllerPort }} nodePort: {{ .Values.controllerPort }}
{{ end }} {{- end }}
selector: selector:
svc: controller svc: controller
---
{{- if .Values.nats.enabled }} {{- if .Values.nats.enabled }}
---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@@ -51,9 +51,9 @@ spec:
ports: ports:
- port: 4222 - port: 4222
targetPort: 4222 targetPort: 4222
{{ if eq .Values.serviceType "NodePort" }} {{- if eq .Values.serviceType "NodePort" }}
nodePort: {{ .Values.natsStreamingPort }} nodePort: {{ .Values.natsStreamingPort }}
{{ end }} {{- end }}
selector: selector:
svc: nats-streaming svc: nats-streaming
{{- end }} {{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analyticsNonHelmInstall }} {{- if .Values.analyticsNonHelmInstall }}
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@@ -28,4 +28,4 @@ spec:
- name: post-install-job - name: post-install-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"yaml-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"yaml-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }} {{- if .Values.analytics }}
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-install-job - name: post-install-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }} {{- if .Values.analytics }}
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-upgrade-job - name: post-upgrade-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{- end }}
+4 -4
View File
@@ -11,9 +11,9 @@ spec:
ports: ports:
- port: 80 - port: 80
targetPort: 8888 targetPort: 8888
{{ if eq .Values.routerServiceType "NodePort" }} {{- if eq .Values.routerServiceType "NodePort" }}
nodePort: {{ .Values.routerPort }} nodePort: {{ .Values.routerPort }}
{{ end }} {{- end }}
selector: selector:
svc: router svc: router
@@ -31,9 +31,9 @@ spec:
ports: ports:
- port: 80 - port: 80
targetPort: 8888 targetPort: 8888
{{ if eq .Values.serviceType "NodePort" }} {{- if eq .Values.serviceType "NodePort" }}
nodePort: {{ .Values.controllerPort }} nodePort: {{ .Values.controllerPort }}
{{ end }} {{- end }}
selector: selector:
svc: controller svc: controller