From cf13f6a24612d70395698f2ff1788c5a632d4be2 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Sun, 9 Jul 2017 21:11:24 +0200 Subject: [PATCH] Use consistent whitespace in template placeholders (#1437) Use consistent whitespace in template placeholders --- charts/jenkins/templates/NOTES.txt | 2 +- charts/jenkins/templates/config.yaml | 16 ++++----- .../jenkins/templates/jenkins-agent-svc.yaml | 12 +++---- .../templates/jenkins-master-deployment.yaml | 36 +++++++++---------- .../jenkins-master-networkpolicy.yaml | 14 ++++---- .../jenkins/templates/jenkins-master-svc.yaml | 2 +- charts/jenkins/templates/jenkins-test.yaml | 6 ++-- charts/jenkins/templates/test-config.yaml | 4 +-- 8 files changed, 46 insertions(+), 46 deletions(-) diff --git a/charts/jenkins/templates/NOTES.txt b/charts/jenkins/templates/NOTES.txt index f17c01254455..cc59ba14d8bd 100644 --- a/charts/jenkins/templates/NOTES.txt +++ b/charts/jenkins/templates/NOTES.txt @@ -14,7 +14,7 @@ {{- else if contains "LoadBalancer" .Values.Master.ServiceType }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' - export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} --namespace {{ .Release.Namespace }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") echo http://$SERVICE_IP:{{ .Values.Master.ServicePort }}/login {{- else if contains "ClusterIP" .Values.Master.ServiceType }} diff --git a/charts/jenkins/templates/config.yaml b/charts/jenkins/templates/config.yaml index 730cdf09f41a..dde70bd7b64b 100644 --- a/charts/jenkins/templates/config.yaml +++ b/charts/jenkins/templates/config.yaml @@ -9,7 +9,7 @@ data: - {{.Values.Master.ImageTag}} + {{ .Values.Master.ImageTag }} 0 NORMAL {{ .Values.Master.UseSecurity }} @@ -35,7 +35,7 @@ data: default 2147483647 0 - + {{- range $index, $volume := .Values.Agent.volumes }} @@ -60,10 +60,10 @@ data: ${computer.jnlpmac} ${computer.name} false - {{.Values.Agent.Cpu}} - {{.Values.Agent.Memory}} - {{.Values.Agent.Cpu}} - {{.Values.Agent.Memory}} + {{ .Values.Agent.Cpu }} + {{ .Values.Agent.Memory }} + {{ .Values.Agent.Cpu }} + {{ .Values.Agent.Memory }} @@ -77,7 +77,7 @@ data: https://kubernetes.default false {{ .Release.Namespace }} - http://{{ template "fullname" . }}:{{.Values.Master.ServicePort}} + http://{{ template "fullname" . }}:{{ .Values.Master.ServicePort }} {{ template "fullname" . }}-agent:50000 10 5 @@ -137,7 +137,7 @@ data: {{- end }} {{- range $key, $val := .Values.Master.InitScripts }} init{{ $key }}.groovy: |- -{{ $val | indent 4}} +{{ $val | indent 4 }} {{- end }} plugins.txt: |- {{- if .Values.Master.InstallPlugins }} diff --git a/charts/jenkins/templates/jenkins-agent-svc.yaml b/charts/jenkins/templates/jenkins-agent-svc.yaml index 8af289ecfa12..193bf8d5fca5 100644 --- a/charts/jenkins/templates/jenkins-agent-svc.yaml +++ b/charts/jenkins/templates/jenkins-agent-svc.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: Service metadata: - name: {{template "fullname" . }}-agent + name: {{ template "fullname" . }}-agent labels: app: {{ template "fullname" . }} - chart: "{{.Chart.Name}}-{{.Chart.Version}}" - component: "{{.Release.Name}}-{{.Values.Master.Component}}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "{{ .Release.Name }}-{{ .Values.Master.Component }}" spec: ports: - - port: {{.Values.Master.SlaveListenerPort}} - targetPort: {{.Values.Master.SlaveListenerPort}} + - port: {{ .Values.Master.SlaveListenerPort }} + targetPort: {{ .Values.Master.SlaveListenerPort }} name: slavelistener selector: - component: "{{.Release.Name}}-{{.Values.Master.Component}}" + component: "{{ .Release.Name }}-{{ .Values.Master.Component }}" type: ClusterIP diff --git a/charts/jenkins/templates/jenkins-master-deployment.yaml b/charts/jenkins/templates/jenkins-master-deployment.yaml index 311c1388cb5c..59b26e60854f 100644 --- a/charts/jenkins/templates/jenkins-master-deployment.yaml +++ b/charts/jenkins/templates/jenkins-master-deployment.yaml @@ -3,32 +3,32 @@ kind: Deployment metadata: name: {{ template "fullname" . }} labels: - heritage: {{.Release.Service | quote }} - release: {{.Release.Name | quote }} - chart: "{{.Chart.Name}}-{{.Chart.Version}}" - component: "{{.Release.Name}}-{{.Values.Master.Name}}" + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "{{ .Release.Name }}-{{ .Values.Master.Name }}" spec: replicas: 1 strategy: type: RollingUpdate selector: matchLabels: - component: "{{.Release.Name}}-{{.Values.Master.Component}}" + component: "{{ .Release.Name }}-{{ .Values.Master.Component }}" template: metadata: labels: app: {{ template "fullname" . }} - heritage: {{.Release.Service | quote }} - release: {{.Release.Name | quote }} - chart: "{{.Chart.Name}}-{{.Chart.Version}}" - component: "{{.Release.Name}}-{{.Values.Master.Component}}" + heritage: {{ .Release.Service | quote }} + release: {{ .Release.Name | quote }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "{{ .Release.Name }}-{{ .Values.Master.Component }}" annotations: checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }} pod.alpha.kubernetes.io/init-containers: '[ { "name": "copy-default-config", - "image": "{{.Values.Master.Image}}:{{.Values.Master.ImageTag}}", - "imagePullPolicy": "{{.Values.Master.ImagePullPolicy}}", + "image": "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}", + "imagePullPolicy": "{{ .Values.Master.ImagePullPolicy }}", "command": [ "sh", "/var/jenkins_config/apply_config.sh" ], "volumeMounts": [ { @@ -63,14 +63,14 @@ spec: runAsUser: 0 containers: - name: {{ template "fullname" . }} - image: "{{.Values.Master.Image}}:{{.Values.Master.ImageTag}}" - imagePullPolicy: "{{.Values.Master.ImagePullPolicy}}" + image: "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}" + imagePullPolicy: "{{ .Values.Master.ImagePullPolicy }}" {{- if .Values.Master.UseSecurity }} args: [ "--argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)", "--argumentsRealm.roles.$(ADMIN_USER)=admin"] {{- end }} env: - name: JAVA_OPTS - value: "{{ default "" .Values.Master.JavaOpts}}" + value: "{{ default "" .Values.Master.JavaOpts }}" {{- if .Values.Master.UseSecurity }} - name: ADMIN_PASSWORD valueFrom: @@ -84,9 +84,9 @@ spec: key: jenkins-admin-user {{- end }} ports: - - containerPort: {{.Values.Master.ContainerPort}} + - containerPort: {{ .Values.Master.ContainerPort }} name: http - - containerPort: {{.Values.Master.SlaveListenerPort}} + - containerPort: {{ .Values.Master.SlaveListenerPort }} name: slavelistener {{- if .Values.Master.JMXPort }} - containerPort: {{ .Values.Master.JMXPort }} @@ -94,8 +94,8 @@ spec: {{- end }} resources: requests: - cpu: "{{.Values.Master.Cpu}}" - memory: "{{.Values.Master.Memory}}" + cpu: "{{ .Values.Master.Cpu }}" + memory: "{{ .Values.Master.Memory }}" volumeMounts: {{- if .Values.Persistence.mounts }} {{ toYaml .Values.Persistence.mounts | indent 12 }} diff --git a/charts/jenkins/templates/jenkins-master-networkpolicy.yaml b/charts/jenkins/templates/jenkins-master-networkpolicy.yaml index 21b9fc5026ce..6034c919f6a3 100644 --- a/charts/jenkins/templates/jenkins-master-networkpolicy.yaml +++ b/charts/jenkins/templates/jenkins-master-networkpolicy.yaml @@ -2,32 +2,32 @@ kind: NetworkPolicy apiVersion: {{ .Values.NetworkPolicy.ApiVersion }} metadata: - name: "{{.Release.Name}}-{{.Values.Master.Component}}" + name: "{{ .Release.Name }}-{{ .Values.Master.Component }}" spec: podSelector: matchLabels: - component: "{{.Release.Name}}-{{.Values.Master.Component}}" + component: "{{ .Release.Name }}-{{ .Values.Master.Component }}" ingress: # Allow web access to the UI - ports: - - port: {{.Values.Master.ContainerPort}} + - port: {{ .Values.Master.ContainerPort }} # Allow inbound connections from slave - from: - podSelector: matchLabels: - "jenkins/{{.Release.Name}}-{{.Values.Agent.Component}}": "true" + "jenkins/{{ .Release.Name }}-{{ .Values.Agent.Component }}": "true" ports: - - port: {{.Values.Master.SlaveListenerPort}} + - port: {{ .Values.Master.SlaveListenerPort }} {{- if .Values.Agent.Enabled }} --- kind: NetworkPolicy apiVersion: {{ .Values.NetworkPolicy.ApiVersion }} metadata: - name: "{{.Release.Name}}-{{.Values.Agent.Component}}" + name: "{{ .Release.Name }}-{{ .Values.Agent.Component }}" spec: podSelector: matchLabels: # DefaultDeny - "jenkins/{{.Release.Name}}-{{.Values.Agent.Component}}": "true" + "jenkins/{{ .Release.Name }}-{{ .Values.Agent.Component }}": "true" {{- end }} {{- end }} diff --git a/charts/jenkins/templates/jenkins-master-svc.yaml b/charts/jenkins/templates/jenkins-master-svc.yaml index 05b7df248e6f..e30b42552c4b 100644 --- a/charts/jenkins/templates/jenkins-master-svc.yaml +++ b/charts/jenkins/templates/jenkins-master-svc.yaml @@ -10,7 +10,7 @@ metadata: component: "{{.Release.Name}}-{{.Values.Master.Component}}" {{- if .Values.Master.ServiceAnnotations }} annotations: -{{ toYaml .Values.Master.ServiceAnnotations | indent 4}} +{{ toYaml .Values.Master.ServiceAnnotations | indent 4 }} {{- end }} spec: ports: diff --git a/charts/jenkins/templates/jenkins-test.yaml b/charts/jenkins/templates/jenkins-test.yaml index 3ea15ec44e5e..34e9aadff67e 100644 --- a/charts/jenkins/templates/jenkins-test.yaml +++ b/charts/jenkins/templates/jenkins-test.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{.Release.Name}}-ui-test-{{ randAlphaNum 5 | lower }}" + name: "{{ .Release.Name }}-ui-test-{{ randAlphaNum 5 | lower }}" annotations: "helm.sh/hook": test-success "pod.beta.kubernetes.io/init-containers": '[ @@ -28,8 +28,8 @@ spec: {{ toYaml .Values.Master.Tolerations | indent 4 }} {{- end }} containers: - - name: {{.Release.Name}}-ui-test - image: {{.Values.Master.Image}}:{{.Values.Master.ImageTag}} + - name: {{ .Release.Name }}-ui-test + image: {{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }} command: ["/tools/bats/bats", "-t", "/tests/run.sh"] volumeMounts: - mountPath: /tests diff --git a/charts/jenkins/templates/test-config.yaml b/charts/jenkins/templates/test-config.yaml index 4723003e0f90..db4f35a5caaa 100644 --- a/charts/jenkins/templates/test-config.yaml +++ b/charts/jenkins/templates/test-config.yaml @@ -5,5 +5,5 @@ metadata: data: run.sh: |- @test "Testing Jenkins UI is accessible" { - curl --retry 12 --retry-delay 10 {{.Release.Name}}-jenkins:8080/login - } \ No newline at end of file + curl --retry 12 --retry-delay 10 {{ .Release.Name }}-jenkins:8080/login + }