blob: 310d9ae662a774268cb2e6882407f207c8185f46 [file] [log] [blame]
Jack Lucasd41dbdb2021-02-16 11:07:28 -05001{{/*
2#============LICENSE_START========================================================
3# ================================================================================
4# Copyright (c) 2021 J. F. Lucas. All rights reserved.
vv770de8c5c682021-04-15 12:21:36 -04005# Copyright (c) 2021 AT&T Intellectual Property. All rights reserved.
Piotr Marcinkiewicz70625182021-04-29 17:02:37 +02006# Copyright (c) 2021 Nokia. All rights reserved.
Jack Lucasd41dbdb2021-02-16 11:07:28 -05007# ================================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19# ============LICENSE_END=========================================================
20*/}}
21{{/*
Jack Lucascbca57d2021-04-05 09:49:46 -040022For internal use only!
23
24dcaegen2-services-common._ms-specific-env-vars:
25This template generates a list of microservice-specific environment variables
26as specified in .Values.applicationEnv. The
27dcaegen2-services-common.microServiceDeployment uses this template
28to add the microservice-specific environment variables to the microservice's container.
29These environment variables are in addition to a standard set of environment variables
30provided to all microservices.
31
32The template expects a single argument, pointing to the caller's global context.
33
34Microservice-specific environment variables can be specified in two ways:
35 1. As literal string values.
36 2. As values that are sourced from a secret, identified by the secret's
37 uid and the key within the secret that provides the value.
38
39The following example shows an example of each type. The example assumes
40that a secret has been created using the OOM common secret mechanism, with
41a secret uid "example-secret" and a key called "password".
42
43applicationEnv:
44 APPLICATION_PASSWORD:
45 secretUid: example-secret
46 key: password
47 APPLICATION_EXAMPLE: "An example value"
48
49The example would set two environment variables on the microservice's container,
50one called "APPLICATION_PASSWORD" with the value set from the "password" key in
51the secret with uid "example-secret", and one called "APPLICATION_EXAMPLE" set to
52the the literal string "An example value".
53*/}}
54{{- define "dcaegen2-services-common._ms-specific-env-vars" -}}
55 {{- $global := . }}
56 {{- if .Values.applicationEnv }}
57 {{- range $envName, $envValue := .Values.applicationEnv }}
58 {{- if kindIs "string" $envValue }}
59- name: {{ $envName }}
60 value: {{ $envValue | quote }}
61 {{- else }}
62 {{ if or (not $envValue.secretUid) (not $envValue.key) }}
63 {{ fail (printf "Env %s definition is not a string and does not contain secretUid or key fields" $envName) }}
64 {{- end }}
65- name: {{ $envName }}
66 {{- include "common.secret.envFromSecretFast" (dict "global" $global "uid" $envValue.secretUid "key" $envValue.key) | indent 2 }}
67 {{- end -}}
68 {{- end }}
69 {{- end }}
70{{- end -}}
71{{/*
Jack Lucase5f71602021-05-10 12:00:02 -040072For internal use only!
73
74dcaegen2-services-common._externalVolumes:
75This template generates a list of volumes associated with the pod,
76based on information provided in .Values.externalVolumes. This
77template works in conjunction with dcaegen2-services-common._externalVolumeMounts
78to give the microservice access to data in volumes created else.
79This initial implementation supports ConfigMaps only, as this is the only
80external volume mounting required by current microservices.
81
82.Values.externalValues is a list of objects. Each object has 3 required fields and 1 optional field:
83 - name: the name of the resource (in the current implementation, it must be a ConfigMap)
84 that is to be set up as a volume. The value is a case sensitive string. Because the
85 names of resources are sometimes set at deployment time (for instance, to prefix the Helm
86 release to the name), the string can be a Helm template fragment that will be expanded at
87 deployment time.
88 - type: the type of the resource (in the current implementation, only "ConfigMap" is supported).
89 The value is a case-INsensitive string.
90 - mountPoint: the path to the mount point for the volume in the container file system. The
91 value is a case-sensitive string.
92 - readOnly: (Optional) Boolean flag. Set to true to mount the volume as read-only.
93 Defaults to false.
94
95Here is an example fragment from a values.yaml file for a microservice:
96
97externalVolumes:
98 - name: my-example-configmap
99 type: configmap
100 mountPath: /opt/app/config
101 - name: '{{ include "common.release" . }}-another-example'
102 type: configmap
103 mountPath: /opt/app/otherconfig
104*/}}
105{{- define "dcaegen2-services-common._externalVolumes" -}}
106 {{- $global := . -}}
107 {{- if .Values.externalVolumes }}
108 {{- range $vol := .Values.externalVolumes }}
109 {{- if eq (lower $vol.type) "configmap" }}
110 {{- $vname := (tpl $vol.name $global) }}
111- configMap:
112 defaultMode: 420
113 name: {{ $vname }}
114 name: {{ $vname }}
115 {{- end }}
116 {{- end }}
117 {{- end }}
118{{- end }}
119{{/*
120For internal use only!
121
122dcaegen2-services-common._externalVolumeMounts:
123This template generates a list of volume mounts for the microservice container,
124based on information provided in .Values.externalVolumes. This
125template works in conjunction with dcaegen2-services-common._externalVolumes
126to give the microservice access to data in volumes created else.
127This initial implementation supports ConfigMaps only, as this is the only
128external volume mounting required by current microservices.
129
130See the documentation for dcaegen2-services-common._externalVolumes for
131details on how external volumes are specified in the values.yaml file for
132the microservice.
133*/}}
134{{- define "dcaegen2-services-common._externalVolumeMounts" -}}
135 {{- $global := . -}}
136 {{- if .Values.externalVolumes }}
137 {{- range $vol := .Values.externalVolumes }}
138 {{- if eq (lower $vol.type) "configmap" }}
139 {{- $vname := (tpl $vol.name $global) -}}
140 {{- $readOnly := $vol.readOnly | default false }}
141- mountPath: {{ $vol.mountPath }}
142 name: {{ $vname }}
143 readOnly: {{ $readOnly }}
144 {{- end }}
145 {{- end }}
146 {{- end }}
147{{- end }}
148{{/*
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500149dcaegen2-services-common.microserviceDeployment:
150This template produces a Kubernetes Deployment for a DCAE microservice.
151
152All DCAE microservices currently use very similar Deployments. Having a
153common template eliminates a lot of repetition in the individual charts
154for each microservice.
155
156The template expects the full chart context as input. A chart for a
157DCAE microservice references this template using:
158{{ include "dcaegen2-services-common.microserviceDeployment" . }}
159The template directly references data in .Values, and indirectly (through its
160use of templates from the ONAP "common" collection) references data in
161.Release.
162
163The exact content of the Deployment generated from this template
164depends on the content of .Values.
165
166The Deployment always includes a single Pod, with a container that uses
167the DCAE microservice image.
168
169The Deployment Pod may also include a logging sidecar container.
170The sidecar is included if .Values.logDirectory is set. The
171logging sidecar and the DCAE microservice container share a
172volume where the microservice logs are written.
173
174The Deployment includes an initContainer that pushes the
175microservice's initial configuration (from .Values.applicationConfig)
176into Consul. All DCAE microservices retrieve their initial
177configurations by making an API call to a DCAE platform component called
178the config-binding-service. The config-binding-service currently
179retrieves configuration information from Consul.
180
181The Deployment also includes an initContainer that checks for the
182readiness of other components that the microservice relies on.
183This container is generated by the "common.readinessCheck.waitfor"
184template.
185
186If the microservice acts as a TLS client or server, the Deployment will
187include an initContainer that retrieves certificate information from
188the AAF certificate manager. The information is mounted at the
189mount point specified in .Values.certDirectory. If the microservice is
190a TLS server (indicated by setting .Values.tlsServer to true), the
191certificate information will include a server cert and key, in various
192formats. It will also include the AAF CA cert. If the microservice is
193a TLS client only (indicated by setting .Values.tlsServer to false), the
194certificate information includes only the AAF CA cert.
vv770de8c5c682021-04-15 12:21:36 -0400195
196Deployed POD may also include a Policy-sync sidecar container.
197The sidecar is included if .Values.policies is set. The
198Policy-sync sidecar polls PolicyEngine (PDP) periodically based
199on .Values.policies.duration and configuration retrieved is shared with
200DCAE Microservice container by common volume. Policy can be retrieved based on
201list of policyID or filter
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500202*/}}
203
204{{- define "dcaegen2-services-common.microserviceDeployment" -}}
205{{- $logDir := default "" .Values.logDirectory -}}
206{{- $certDir := default "" .Values.certDirectory . -}}
207{{- $tlsServer := default "" .Values.tlsServer -}}
vv770de8c5c682021-04-15 12:21:36 -0400208{{- $policy := default "" .Values.policies -}}
209
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500210apiVersion: apps/v1
211kind: Deployment
212metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
213spec:
214 replicas: 1
215 selector: {{- include "common.selectors" . | nindent 4 }}
216 template:
217 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
218 spec:
219 initContainers:
220 - command:
221 - sh
222 args:
223 - -c
224 - |
225 {{- range $var := .Values.customEnvVars }}
226 export {{ $var.name }}="{{ $var.value }}";
227 {{- end }}
228 cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done
229 env:
230 {{- range $cred := .Values.credentials }}
231 - name: {{ $cred.name }}
232 {{- include "common.secret.envFromSecretFast" (dict "global" $ "uid" $cred.uid "key" $cred.key) | indent 10 }}
233 {{- end }}
234 volumeMounts:
235 - mountPath: /config-input
236 name: app-config-input
237 - mountPath: /config
238 name: app-config
239 image: {{ include "repositoryGenerator.image.envsubst" . }}
240 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
241 name: {{ include "common.name" . }}-update-config
242
243 {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
244 - name: init-consul
245 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.consulLoaderImage }}
246 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
247 args:
248 - --key-yaml
249 - "{{ include "common.name" . }}|/app-config/application_config.yaml"
250 resources: {{ include "common.resources" . | nindent 2 }}
251 volumeMounts:
252 - mountPath: /app-config
253 name: app-config
254 {{- if $certDir }}
255 - name: init-tls
256 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.tlsImage }}
257 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
258 env:
259 - name: TLS_SERVER
260 value: {{ $tlsServer | quote }}
261 - name: POD_IP
262 valueFrom:
263 fieldRef:
264 apiVersion: v1
265 fieldPath: status.podIP
266 resources: {{ include "common.resources" . | nindent 2 }}
267 volumeMounts:
268 - mountPath: /opt/app/osaaf
269 name: tls-info
270 {{- end }}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200271 {{ include "dcaegen2-services-common._certPostProcessor" . | nindent 4 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500272 containers:
273 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
274 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
275 name: {{ include "common.name" . }}
276 env:
Bartosz Gardziejewski041a89a2021-05-19 08:05:00 +0200277 {{- range $cred := .Values.credentials }}
278 - name: {{ $cred.name }}
279 {{- include "common.secret.envFromSecretFast" (dict "global" $ "uid" $cred.uid "key" $cred.key) | indent 10 }}
280 {{- end }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500281 {{- if $certDir }}
282 - name: DCAE_CA_CERTPATH
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200283 value: {{ $certDir }}/cacert.pem
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500284 {{- end }}
285 - name: CONSUL_HOST
286 value: consul-server.onap
287 - name: CONFIG_BINDING_SERVICE
288 value: config-binding-service
289 - name: CBS_CONFIG_URL
290 value: https://config-binding-service:10443/service_component_all/{{ include "common.name" . }}
291 - name: POD_IP
292 valueFrom:
293 fieldRef:
294 apiVersion: v1
295 fieldPath: status.podIP
Jack Lucascbca57d2021-04-05 09:49:46 -0400296 {{- include "dcaegen2-services-common._ms-specific-env-vars" . | nindent 8 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500297 {{- if .Values.service }}
298 ports: {{ include "common.containerPorts" . | nindent 10 }}
299 {{- end }}
300 {{- if .Values.readiness }}
301 readinessProbe:
302 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds | default 5 }}
303 periodSeconds: {{ .Values.readiness.periodSeconds | default 15 }}
304 timeoutSeconds: {{ .Values.readiness.timeoutSeconds | default 1 }}
305 {{- $probeType := .Values.readiness.type | default "httpGet" -}}
306 {{- if eq $probeType "httpGet" }}
307 httpGet:
308 scheme: {{ .Values.readiness.scheme }}
309 path: {{ .Values.readiness.path }}
310 port: {{ .Values.readiness.port }}
311 {{- end }}
312 {{- if eq $probeType "exec" }}
313 exec:
314 command:
315 {{- range $cmd := .Values.readiness.command }}
316 - {{ $cmd }}
317 {{- end }}
318 {{- end }}
319 {{- end }}
320 resources: {{ include "common.resources" . | nindent 2 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500321 volumeMounts:
Bartosz Gardziejewski4bb3da32021-04-21 12:08:50 +0200322 - mountPath: /app-config
323 name: app-config
Bartosz Gardziejewski041a89a2021-05-19 08:05:00 +0200324 - mountPath: /app-config-input
325 name: app-config-input
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500326 {{- if $logDir }}
327 - mountPath: {{ $logDir}}
328 name: component-log
329 {{- end }}
330 {{- if $certDir }}
331 - mountPath: {{ $certDir }}
332 name: tls-info
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200333 {{- if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200334 {{- include "common.certManager.volumeMountsReadOnly" . | nindent 8 -}}
335 {{- end -}}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500336 {{- end }}
vv770de8c5c682021-04-15 12:21:36 -0400337 {{- if $policy }}
338 - name: policy-shared
339 mountPath: /etc/policies
340 {{- end }}
Jack Lucase5f71602021-05-10 12:00:02 -0400341 {{- include "dcaegen2-services-common._externalVolumeMounts" . | nindent 8 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500342 {{- if $logDir }}
343 - image: {{ include "repositoryGenerator.image.logging" . }}
344 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
345 name: filebeat
346 env:
347 - name: POD_IP
348 valueFrom:
349 fieldRef:
350 apiVersion: v1
351 fieldPath: status.podIP
352 resources: {{ include "common.resources" . | nindent 2 }}
353 volumeMounts:
354 - mountPath: /var/log/onap/{{ include "common.name" . }}
355 name: component-log
356 - mountPath: /usr/share/filebeat/data
357 name: filebeat-data
358 - mountPath: /usr/share/filebeat/filebeat.yml
359 name: filebeat-conf
360 subPath: filebeat.yml
361 {{- end }}
vv770de8c5c682021-04-15 12:21:36 -0400362 {{- if $policy }}
363 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dcaePolicySyncImage }}
364 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
365 name: policy-sync
366 env:
367 - name: POD_IP
368 valueFrom:
369 fieldRef:
370 apiVersion: v1
371 fieldPath: status.podIP
372 - name: POLICY_SYNC_PDP_USER
373 valueFrom:
374 secretKeyRef:
375 name: onap-policy-xacml-pdp-api-creds
376 key: login
377 - name: POLICY_SYNC_PDP_PASS
378 valueFrom:
379 secretKeyRef:
380 name: onap-policy-xacml-pdp-api-creds
381 key: password
382 - name: POLICY_SYNC_PDP_URL
Piotr Marcinkiewicz70625182021-04-29 17:02:37 +0200383 value : http{{ if (include "common.needTLS" .) }}s{{ end }}://policy-xacml-pdp:6969
vv770de8c5c682021-04-15 12:21:36 -0400384 - name: POLICY_SYNC_OUTFILE
385 value : "/etc/policies/policies.json"
386 - name: POLICY_SYNC_V1_DECISION_ENDPOINT
387 value : "policy/pdpx/v1/decision"
388 {{- if $policy.filter }}
389 - name: POLICY_SYNC_FILTER
390 value: {{ $policy.filter }}
391 {{- end -}}
392 {{- if $policy.policyID }}
393 - name: POLICY_SYNC_ID
394 value: {{ $policy.policyID }}
395 {{- end -}}
396 {{- if $policy.duration }}
397 - name: POLICY_SYNC_DURATION
398 value: {{ $policy.duration }}
399 {{- end }}
400 resources: {{ include "common.resources" . | nindent 2 }}
401 volumeMounts:
402 - mountPath: /etc/policies
403 name: policy-shared
404 {{- if $certDir }}
405 - mountPath: /opt/ca-certificates/
406 name: tls-info
407 {{- end }}
408 {{- end }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500409 hostname: {{ include "common.name" . }}
410 volumes:
411 - configMap:
412 defaultMode: 420
413 name: {{ include "common.fullname" . }}-application-config-configmap
414 name: app-config-input
415 - emptyDir:
416 medium: Memory
417 name: app-config
418 {{- if $logDir }}
419 - emptyDir: {}
420 name: component-log
421 - emptyDir: {}
422 name: filebeat-data
423 - configMap:
424 defaultMode: 420
425 name: {{ include "common.fullname" . }}-filebeat-configmap
426 name: filebeat-conf
427 {{- end }}
428 {{- if $certDir }}
429 - emptyDir: {}
430 name: tls-info
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200431 {{ if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200432 {{ include "common.certManager.volumesReadOnly" . | nindent 6 }}
433 {{- end }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500434 {{- end }}
vv770de8c5c682021-04-15 12:21:36 -0400435 {{- if $policy }}
436 - name: policy-shared
437 emptyDir: {}
438 {{- end }}
Jack Lucase5f71602021-05-10 12:00:02 -0400439 {{- include "dcaegen2-services-common._externalVolumes" . | nindent 6 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500440 imagePullSecrets:
441 - name: "{{ include "common.namespace" . }}-docker-registry-key"
442{{ end -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200443
444{{/*
445 For internal use
446
447 Template to attach CertPostProcessor which merges CMPv2 truststore with AAF truststore
448 and swaps keystore files.
449*/}}
450{{- define "dcaegen2-services-common._certPostProcessor" -}}
451 {{- $certDir := default "" .Values.certDirectory . -}}
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200452 {{- if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200453 {{- $cmpv2Certificate := (index .Values.certificates 0) -}}
454 {{- $cmpv2CertificateDir := $cmpv2Certificate.mountPath -}}
455 {{- $certType := "pem" -}}
456 {{- if $cmpv2Certificate.keystore -}}
457 {{- $certType = (index $cmpv2Certificate.keystore.outputType 0) -}}
458 {{- end -}}
Piotr Marcinkiewicz70625182021-04-29 17:02:37 +0200459 {{- $truststoresPaths := printf "%s/%s:%s/%s" $certDir "cacert.pem" $cmpv2CertificateDir "cacert.pem" -}}
460 {{- $truststoresPasswordPaths := ":" -}}
461 {{- $keystoreSourcePaths := printf "%s/%s:%s/%s" $cmpv2CertificateDir "cert.pem" $cmpv2CertificateDir "key.pem" -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200462 {{- $keystoreDestinationPaths := printf "%s/%s:%s/%s" $certDir "cert.pem" $certDir "key.pem" -}}
463 {{- if not (eq $certType "pem") -}}
464 {{- $truststoresPaths = printf "%s/%s:%s/%s.%s" $certDir "trust.jks" $cmpv2CertificateDir "truststore" $certType -}}
465 {{- $truststoresPasswordPaths = printf "%s/%s:%s/%s" $certDir "trust.pass" $cmpv2CertificateDir "truststore.pass" -}}
466 {{- $keystoreSourcePaths = printf "%s/%s.%s:%s/%s" $cmpv2CertificateDir "keystore" $certType $cmpv2CertificateDir "keystore.pass" -}}
467 {{- $keystoreDestinationPaths = printf "%s/%s.%s:%s/%s.pass" $certDir "cert" $certType $certDir $certType -}}
468 {{- end }}
469 - name: cert-post-processor
470 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.certPostProcessorImage }}
471 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
472 resources:
473 {{- include "common.resources" . | nindent 4 }}
474 volumeMounts:
475 - mountPath: {{ $certDir }}
476 name: tls-info
477 {{- include "common.certManager.volumeMountsReadOnly" . | nindent 4 }}
478 env:
479 - name: TRUSTSTORES_PATHS
480 value: {{ $truststoresPaths | quote}}
481 - name: TRUSTSTORES_PASSWORDS_PATHS
482 value: {{ $truststoresPasswordPaths | quote }}
483 - name: KEYSTORE_SOURCE_PATHS
484 value: {{ $keystoreSourcePaths | quote }}
485 - name: KEYSTORE_DESTINATION_PATHS
486 value: {{ $keystoreDestinationPaths | quote }}
487 {{- end }}
488{{- end -}}
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200489
490{{/*
491 Template returns string "true" if CMPv2 certificates should be used and nothing (so it can be used in with statements)
492 when they shouldn't. Example use:
493 {{- if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
494
495*/}}
496{{- define "dcaegen2-services-common.shouldUseCmpv2Certificates" -}}
497 {{- $certDir := default "" .Values.certDirectory . -}}
498 {{- if (and $certDir .Values.certificates .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration .Values.useCmpv2Certificates) -}}
499 true
500 {{- end -}}
501{{- end -}}