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