From de752b0fb11a90014a60b8b025f5df2d9a00fe9a Mon Sep 17 00:00:00 2001 From: Chi-En Wu Date: Wed, 22 Apr 2020 12:23:57 +0800 Subject: [PATCH] style: trim whitespaces before `{{include}}` --- templates/_configmap.yaml | 2 +- templates/_cronjob.yaml | 6 +++--- templates/_deployment.yaml | 6 +++--- templates/_hpa.yaml | 2 +- templates/_ingress.yaml | 2 +- templates/_metadata.tpl | 4 ++-- templates/_pdb.yaml | 2 +- templates/_secret.yaml | 2 +- templates/_service.yaml | 2 +- templates/_serviceaccount.yaml | 2 +- templates/_servicemonitor.yaml | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/templates/_configmap.yaml b/templates/_configmap.yaml index d509ada..c583a83 100644 --- a/templates/_configmap.yaml +++ b/templates/_configmap.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: ConfigMap metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} data: {} {{- end -}} diff --git a/templates/_cronjob.yaml b/templates/_cronjob.yaml index 4dc54a0..6aec3a1 100644 --- a/templates/_cronjob.yaml +++ b/templates/_cronjob.yaml @@ -12,7 +12,7 @@ spec: apiVersion: batch/v1beta1 kind: CronJob metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} spec: schedule: "{{ $cronJob.schedule }}" {{- with $cronJob.concurrencyPolicy }} @@ -27,10 +27,10 @@ spec: jobTemplate: metadata: labels: - {{ include "common.selectorLabels" $top | nindent 8 }} + {{- include "common.selectorLabels" $top | nindent 8 }} spec: 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 -}} {{- define "common.cronJob" -}} diff --git a/templates/_deployment.yaml b/templates/_deployment.yaml index fcec8fc..0f6e9ae 100644 --- a/templates/_deployment.yaml +++ b/templates/_deployment.yaml @@ -7,16 +7,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} spec: {{- if not $autoscaling.enabled }} replicas: {{ $deployment.replicaCount | default 1 }} {{- end }} selector: matchLabels: - {{ include "common.selectorLabels" $top | nindent 6 }} + {{- include "common.selectorLabels" $top | nindent 6 }} template: - {{ include "common.pod.template" . | nindent 4 }} + {{- include "common.pod.template" . | nindent 4 }} {{- end -}} {{- define "common.deployment" -}} diff --git a/templates/_hpa.yaml b/templates/_hpa.yaml index 4253f6b..c135600 100644 --- a/templates/_hpa.yaml +++ b/templates/_hpa.yaml @@ -6,7 +6,7 @@ apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/templates/_ingress.yaml b/templates/_ingress.yaml index 731b60a..8f4f0e6 100644 --- a/templates/_ingress.yaml +++ b/templates/_ingress.yaml @@ -21,7 +21,7 @@ apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: - {{ include "common.metadata" (append . "common.ingress.metadata") | nindent 2 }} + {{- include "common.metadata" (append . "common.ingress.metadata") | nindent 2 }} spec: {{- if $ingress.tls }} tls: diff --git a/templates/_metadata.tpl b/templates/_metadata.tpl index 3efe2e8..23f3506 100644 --- a/templates/_metadata.tpl +++ b/templates/_metadata.tpl @@ -20,7 +20,7 @@ app.kubernetes.io/name: {{ include "common.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} -{{ define "common.metadata.tpl" -}} +{{- define "common.metadata.tpl" -}} {{- $top := first . -}} name: {{ include "common.fullname" $top }} labels: @@ -30,6 +30,6 @@ labels: {{- /* Create a standard metadata header */ -}} -{{ define "common.metadata" -}} +{{- define "common.metadata" -}} {{- include "common.utils.merge" (append . "common.metadata.tpl") -}} {{- end -}} diff --git a/templates/_pdb.yaml b/templates/_pdb.yaml index ee88c8f..7a65732 100644 --- a/templates/_pdb.yaml +++ b/templates/_pdb.yaml @@ -6,7 +6,7 @@ apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} spec: selector: matchLabels: diff --git a/templates/_secret.yaml b/templates/_secret.yaml index 0bcbc66..46fcfdd 100644 --- a/templates/_secret.yaml +++ b/templates/_secret.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: Secret metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} type: Opaque data: {} {{- end -}} diff --git a/templates/_service.yaml b/templates/_service.yaml index 3f151b8..6ac2548 100644 --- a/templates/_service.yaml +++ b/templates/_service.yaml @@ -6,7 +6,7 @@ apiVersion: v1 kind: Service metadata: - {{ include "common.metadata" (list $top) | nindent 2 }} + {{- include "common.metadata" (list $top) | nindent 2 }} spec: type: {{ $service.type }} ports: diff --git a/templates/_serviceaccount.yaml b/templates/_serviceaccount.yaml index bd425f0..82b79ab 100644 --- a/templates/_serviceaccount.yaml +++ b/templates/_serviceaccount.yaml @@ -14,7 +14,7 @@ annotations: apiVersion: v1 kind: ServiceAccount metadata: - {{ include "common.metadata" (append . "common.serviceAccount.metadata") | nindent 2 }} + {{- include "common.metadata" (append . "common.serviceAccount.metadata") | nindent 2 }} {{- end -}} {{- define "common.serviceAccount" -}} diff --git a/templates/_servicemonitor.yaml b/templates/_servicemonitor.yaml index 965a17b..21815a1 100644 --- a/templates/_servicemonitor.yaml +++ b/templates/_servicemonitor.yaml @@ -13,7 +13,7 @@ namespace: {{ . }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - {{ include "common.metadata" (append . "common.serviceMonitor.metadata") | nindent 2 }} + {{- include "common.metadata" (append . "common.serviceMonitor.metadata") | nindent 2 }} spec: selector: matchLabels: