Add xApp pod annotation suport
[it/dev.git] / xapp_onboarder / xapp_onboarder / resources / xapp-std / templates / deployment.yaml
index defb6b4..2bdacb2 100644 (file)
@@ -30,6 +30,17 @@ spec:
       release: {{ .Release.Name }}
   template:
     metadata:
+      {{- if .Values.annotations }}
+      annotations:
+        {{- range $key, $value := .Values.annotations }}
+          {{- if kindIs "string" $value }}
+        {{ $key }}: {{ $value | toPrettyJson }}
+          {{- else }}
+        {{ $key }}: |
+{{- $value | toPrettyJson | nindent 10 }}
+          {{- end }}
+        {{- end -}}
+      {{ end }}
       labels:
         app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
         release: {{ .Release.Name }}
@@ -56,7 +67,24 @@ spec:
         - name: {{ $container.name }}
           image: "{{ $container.image.registry }}/{{ $container.image.name }}:{{ $container.image.tag }}"
           {{- if $container.command }}
-          command: [{{ $container.command }}]
+          command: [
+          {{- range $command := $container.command -}}
+          {{- $command | quote -}}
+          {{- if ne $command (last $container.command) }}
+          {{- print ", " -}}
+          {{- end -}}
+          {{- end -}}
+          {{- print "]" -}}
+          {{- end}}
+          {{- if $container.args }}
+          args: [
+          {{- range $arg := $container.args -}}
+          {{- $arg | quote -}}
+          {{- if ne $arg (last $container.args) }}
+          {{- print ", " -}}
+          {{- end -}}
+          {{- end -}}
+          {{- print "]" -}}
           {{- end}}
           imagePullPolicy: {{ $.Values.image_pull_policy }}
   {{- if $portlist }}