diff options
Diffstat (limited to 'operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_utils.tpl')
-rw-r--r-- | operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_utils.tpl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_utils.tpl b/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_utils.tpl new file mode 100644 index 0000000..c59770a --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_utils.tpl @@ -0,0 +1,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 -}} |