blob: c66a05dfebf2aca4be453a93ea63a28d002df5bd [file] [log] [blame]
{{- /*
# Copyright 2020-present Open Networking Foundation
#
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/ -}}
{{/*
Renders a set of standardised labels.
*/}}
{{- define "omec-upf-pfcp-agent.metadata_labels" -}}
{{- $application := index . 0 -}}
{{- $context := index . 1 -}}
release: {{ $context.Release.Name }}
app: {{ $application }}
{{- end -}}
{{/*
Render the given template.
*/}}
{{- define "omec-upf-pfcp-agent.template" -}}
{{- $name := index . 0 -}}
{{- $context := index . 1 -}}
{{- $last := base $context.Template.Name }}
{{- $wtf := $context.Template.Name | replace $last $name -}}
{{ include $wtf $context }}
{{- end -}}
{{/*
Render init container for coredump.
*/}}
{{- define "omec-upf-pfcp-agent.coredump_init" -}}
{{- $pod := index . 0 -}}
{{- $context := index . 1 -}}
- name: {{ $pod }}-coredump-init
image: {{ $context.Values.images.tags.init | quote }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
securityContext:
privileged: true
runAsUser: 0
command: ["sh", "-xc"]
args:
- echo '/tmp/coredump/core.%h.%e.%t' > /mnt/host-rootfs/proc/sys/kernel/core_pattern
volumeMounts:
- name: host-rootfs
mountPath: /mnt/host-rootfs
{{- end -}}