You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ index .Values "etcd-operator" "cluster" "name" }}
can be writen as {{ etcd-operator.cluster.name }}
But there are cases where the array is returned via a function {{ index a func() }}
Indexing structures in Templates
If the data passed to the template is a map, slice, or array it can be indexed from the template. We use {{index x number}} where index is the keyword, x is the data and number is a integer for the index value. If we had {{index names 2}} it is equivalent to names[2]. We can add more integers to index deeper into data. {{index names 2 3 4}} is equivalent to names[2][3][4].
After exported .Values is not cleared for index. Index is a sprig function not sure how to handle this.
To produce use either use zetcd helm charts or use following template
Template
Expected :
{% if etcd.operatorEnabled %}
- "-endpoints"
- "{{ index "etcd-operator" "cluster" "name" }}-client:2379"
{% else %}
- "-endpoints"
- "{{ etcd.endpoints }}"
{% endif %}
Actual Result:
{% if etcd.operatorEnabled %}
- "-endpoints"
- "{{ index .Values "etcd-operator" "cluster" "name" }}-client:2379"
{% else %}
- "-endpoints"
- "{{ etcd.endpoints }}"
{% endif %}
The text was updated successfully, but these errors were encountered: