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 }}
apiVersion: v1
kind: Namespace
@@ -403,8 +402,8 @@ spec:
name: influxdb
key: password
---
{{- if .Values.heapster }}
---
apiVersion: v1
kind: Service
metadata:
@@ -444,9 +443,8 @@ spec:
- /heapster
- --source=kubernetes:https://kubernetes.default
serviceAccount: {{ .Release.Namespace }}/fission-svc
---
{{- end }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -495,8 +493,8 @@ spec:
# args: ["proxy", "--port", "8001", "--address", "127.0.0.1"]
# serviceAccount: fission-svc
---
{{- if .Values.nats.enabled }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -518,7 +516,6 @@ spec:
"--auth", "{{ .Values.nats.authToken }}",
"--max_channels", "0"
]
ports:
- containerPort: 4222
hostPort: 4222
@@ -551,8 +548,9 @@ spec:
value: nats://{{ .Values.nats.authToken }}@nats-streaming:4222
serviceAccount: fission-svc
{{- end }}
---
{{- if .Values.kafka.enabled }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
@@ -582,8 +580,9 @@ spec:
value: "{{.Values.kafka.version}}"
serviceAccount: fission-svc
{{- end }}
---
{{- if .Values.azureStorageQueue.enabled }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
+2 -2
View File
@@ -7,12 +7,12 @@ kind: ConfigMap
metadata:
name: {{ .Release.Name }}-fission-fluentd
data:
{{ if .Files.Get "config/fluentd.conf" }}
{{- if .Files.Get "config/fluentd.conf" }}
td-agent.conf: |
{{ .Files.Get "config/fluentd.conf" | indent 3 }}
{{ else }}
{{ fail "invalid chart" }}
{{ end }}
{{- end }}
---
apiVersion: extensions/v1beta1
kind: DaemonSet
@@ -1,4 +1,4 @@
{{ if .Values.analyticsNonHelmInstall }}
{{- if .Values.analyticsNonHelmInstall }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -28,4 +28,4 @@ spec:
- name: post-install-job
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"]
{{ end }}
{{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }}
{{- if .Values.analytics }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-install-job
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"]
{{ end }}
{{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }}
{{- if .Values.analytics }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-upgrade-job
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"]
{{ end }}
{{- end }}
+1 -1
View File
@@ -9,8 +9,8 @@ data:
username: {{ .Values.logger.influxdbAdmin | b64enc | quote }}
password: {{ randAlphaNum 20 | b64enc | quote }}
---
{{- if .Values.azureStorageQueue.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
+8 -8
View File
@@ -11,9 +11,9 @@ spec:
ports:
- port: 80
targetPort: 8888
{{ if eq .Values.routerServiceType "NodePort" }}
{{- if eq .Values.routerServiceType "NodePort" }}
nodePort: {{ .Values.routerPort }}
{{ end }}
{{- end }}
selector:
svc: router
@@ -31,14 +31,14 @@ spec:
ports:
- port: 80
targetPort: 8888
{{ if eq .Values.serviceType "NodePort" }}
{{- if eq .Values.serviceType "NodePort" }}
nodePort: {{ .Values.controllerPort }}
{{ end }}
{{- end }}
selector:
svc: controller
---
{{- if .Values.nats.enabled }}
---
apiVersion: v1
kind: Service
metadata:
@@ -51,9 +51,9 @@ spec:
ports:
- port: 4222
targetPort: 4222
{{ if eq .Values.serviceType "NodePort" }}
{{- if eq .Values.serviceType "NodePort" }}
nodePort: {{ .Values.natsStreamingPort }}
{{ end }}
{{- end }}
selector:
svc: nats-streaming
{{- end }}
@@ -72,4 +72,4 @@ spec:
- port: 80
targetPort: 8000
selector:
svc: storagesvc
svc: storagesvc
@@ -1,4 +1,4 @@
{{ if .Values.analyticsNonHelmInstall }}
{{- if .Values.analyticsNonHelmInstall }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -28,4 +28,4 @@ spec:
- name: post-install-job
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"]
{{ end }}
{{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }}
{{- if .Values.analytics }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-install-job
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"]
{{ end }}
{{- end }}
@@ -1,4 +1,4 @@
{{ if .Values.analytics }}
{{- if .Values.analytics }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -32,4 +32,4 @@ spec:
- name: post-upgrade-job
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"]
{{ end }}
{{- end }}
+4 -4
View File
@@ -11,9 +11,9 @@ spec:
ports:
- port: 80
targetPort: 8888
{{ if eq .Values.routerServiceType "NodePort" }}
{{- if eq .Values.routerServiceType "NodePort" }}
nodePort: {{ .Values.routerPort }}
{{ end }}
{{- end }}
selector:
svc: router
@@ -31,9 +31,9 @@ spec:
ports:
- port: 80
targetPort: 8888
{{ if eq .Values.serviceType "NodePort" }}
{{- if eq .Values.serviceType "NodePort" }}
nodePort: {{ .Values.controllerPort }}
{{ end }}
{{- end }}
selector:
svc: controller