[ad_1]
i have to check for mandatory values based on some condition.
my values.yaml is as below
id:3
test:
id: 2
test1:
id: 1
In my template, i need to check if id is present at .Values.test.test1.id and assign that value. If not fall back to .Values.test.id and at last .Values.id. But id has to be mandatory and i need to use required function.
my template is as below
{{- if .Values.test.test1.id }}
<assign> {{ .Values.test.test1.id }}
{{- else }}
{{- $id := .Values.test.id }}
{{- $id2 := .Values.id }}
<assign> <need to check required with or of $id $id2> </assign>
{{- end }}
What is the best way to achieve this?
[ad_2]