aboutsummaryrefslogtreecommitdiffstats
path: root/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_utils.tpl
blob: c59770a65c44a041cf7ecd65bb8780e7f23c8353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{{/* vim: set filetype=mustache: */}}

{{/*
  Functions here define utilities for unique name/labels generation
*/}}


{{/* Generate Deployment labels */}}
{{/* Input: Dict with "dot", "name" and "spec" keys */}}
{{- define "handover-simulator.utils.labels" -}}
{{- $name := .name -}}
{{- $spec := .spec -}}
{{- with .dot -}}
app: {{ $name }}
{{ include "handover-simulator.common.labels" . }}
{{- end -}}
{{- end -}}


{{/* Generate Resource name based unique between different chart instances */}}
{{/* Input: List with strings */}}
{{/* Output: Provided elements joined with dash and trimmed according to DNS requirements */}}
{{- define "handover-simulator.utils.name" -}}
res-{{- join "-" . | trunc 59 | trimSuffix "-" -}}
{{- end -}}