Badhrinath Pa | 3a3088a | 2020-07-28 18:37:16 -0700 | [diff] [blame^] | 1 | {{- /* |
| 2 | |
| 3 | # Copyright 2019-present Open Networking Foundation |
| 4 | # |
| 5 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 6 | |
| 7 | */ -}} |
| 8 | |
| 9 | {{/* |
| 10 | Renders a set of standardised labels. |
| 11 | */}} |
| 12 | {{- define "omec-pfcp-agent.metadata_labels" -}} |
| 13 | {{- $application := index . 0 -}} |
| 14 | {{- $context := index . 1 -}} |
| 15 | release: {{ $context.Release.Name }} |
| 16 | app: {{ $application }} |
| 17 | {{- end -}} |
| 18 | |
| 19 | {{/* |
| 20 | Render the given template. |
| 21 | */}} |
| 22 | {{- define "omec-pfcp-agent.template" -}} |
| 23 | {{- $name := index . 0 -}} |
| 24 | {{- $context := index . 1 -}} |
| 25 | {{- $last := base $context.Template.Name }} |
| 26 | {{- $wtf := $context.Template.Name | replace $last $name -}} |
| 27 | {{ include $wtf $context }} |
| 28 | {{- end -}} |
| 29 | |
| 30 | {{/* |
| 31 | Render init container for coredump. |
| 32 | */}} |
| 33 | {{- define "omec-pfcp-agent.coredump_init" -}} |
| 34 | {{- $pod := index . 0 -}} |
| 35 | {{- $context := index . 1 -}} |
| 36 | - name: {{ $pod }}-coredump-init |
| 37 | image: {{ $context.Values.images.tags.init | quote }} |
| 38 | imagePullPolicy: {{ $context.Values.images.pullPolicy }} |
| 39 | securityContext: |
| 40 | privileged: true |
| 41 | runAsUser: 0 |
| 42 | command: ["bash", "-xc"] |
| 43 | args: |
| 44 | - echo '/tmp/coredump/core.%h.%e.%t' > /mnt/host-rootfs/proc/sys/kernel/core_pattern |
| 45 | volumeMounts: |
| 46 | - name: host-rootfs |
| 47 | mountPath: /mnt/host-rootfs |
| 48 | {{- end -}} |