style: trim whitespaces before {{include}}

This commit is contained in:
Chi-En Wu
2020-04-22 12:23:57 +08:00
parent cf0679333c
commit de752b0fb1
11 changed files with 16 additions and 16 deletions

View File

@ -5,7 +5,7 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
data: {} data: {}
{{- end -}} {{- end -}}

View File

@ -12,7 +12,7 @@ spec:
apiVersion: batch/v1beta1 apiVersion: batch/v1beta1
kind: CronJob kind: CronJob
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
spec: spec:
schedule: "{{ $cronJob.schedule }}" schedule: "{{ $cronJob.schedule }}"
{{- with $cronJob.concurrencyPolicy }} {{- with $cronJob.concurrencyPolicy }}
@ -27,10 +27,10 @@ spec:
jobTemplate: jobTemplate:
metadata: metadata:
labels: labels:
{{ include "common.selectorLabels" $top | nindent 8 }} {{- include "common.selectorLabels" $top | nindent 8 }}
spec: spec:
template: template:
{{ include "common.pod.template" (list $top $pod "common.cronJob.pod") | nindent 8 }} {{- include "common.pod.template" (list $top $pod "common.cronJob.pod") | nindent 8 }}
{{- end -}} {{- end -}}
{{- define "common.cronJob" -}} {{- define "common.cronJob" -}}

View File

@ -7,16 +7,16 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
spec: spec:
{{- if not $autoscaling.enabled }} {{- if not $autoscaling.enabled }}
replicas: {{ $deployment.replicaCount | default 1 }} replicas: {{ $deployment.replicaCount | default 1 }}
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
{{ include "common.selectorLabels" $top | nindent 6 }} {{- include "common.selectorLabels" $top | nindent 6 }}
template: template:
{{ include "common.pod.template" . | nindent 4 }} {{- include "common.pod.template" . | nindent 4 }}
{{- end -}} {{- end -}}
{{- define "common.deployment" -}} {{- define "common.deployment" -}}

View File

@ -6,7 +6,7 @@
apiVersion: autoscaling/v2beta2 apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1

View File

@ -21,7 +21,7 @@ apiVersion: extensions/v1beta1
{{- end }} {{- end }}
kind: Ingress kind: Ingress
metadata: metadata:
{{ include "common.metadata" (append . "common.ingress.metadata") | nindent 2 }} {{- include "common.metadata" (append . "common.ingress.metadata") | nindent 2 }}
spec: spec:
{{- if $ingress.tls }} {{- if $ingress.tls }}
tls: tls:

View File

@ -20,7 +20,7 @@ app.kubernetes.io/name: {{ include "common.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}} {{- end -}}
{{ define "common.metadata.tpl" -}} {{- define "common.metadata.tpl" -}}
{{- $top := first . -}} {{- $top := first . -}}
name: {{ include "common.fullname" $top }} name: {{ include "common.fullname" $top }}
labels: labels:
@ -30,6 +30,6 @@ labels:
{{- /* {{- /*
Create a standard metadata header Create a standard metadata header
*/ -}} */ -}}
{{ define "common.metadata" -}} {{- define "common.metadata" -}}
{{- include "common.utils.merge" (append . "common.metadata.tpl") -}} {{- include "common.utils.merge" (append . "common.metadata.tpl") -}}
{{- end -}} {{- end -}}

View File

@ -6,7 +6,7 @@
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
spec: spec:
selector: selector:
matchLabels: matchLabels:

View File

@ -5,7 +5,7 @@
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
type: Opaque type: Opaque
data: {} data: {}
{{- end -}} {{- end -}}

View File

@ -6,7 +6,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
{{ include "common.metadata" (list $top) | nindent 2 }} {{- include "common.metadata" (list $top) | nindent 2 }}
spec: spec:
type: {{ $service.type }} type: {{ $service.type }}
ports: ports:

View File

@ -14,7 +14,7 @@ annotations:
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
{{ include "common.metadata" (append . "common.serviceAccount.metadata") | nindent 2 }} {{- include "common.metadata" (append . "common.serviceAccount.metadata") | nindent 2 }}
{{- end -}} {{- end -}}
{{- define "common.serviceAccount" -}} {{- define "common.serviceAccount" -}}

View File

@ -13,7 +13,7 @@ namespace: {{ . }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
{{ include "common.metadata" (append . "common.serviceMonitor.metadata") | nindent 2 }} {{- include "common.metadata" (append . "common.serviceMonitor.metadata") | nindent 2 }}
spec: spec:
selector: selector:
matchLabels: matchLabels: