title: helm filter over range
body: <p>Is it possible to filter the results of a range in helm?
  For example the values file contains a list of maps like:</p>
  <pre><code>clients:
    - name: clientA
      id: id001
      user: usernameA
      pass: passwordA
    - name: clientB
      id: id002
      user: usernameB
      pass: passwordB
    - name: clientA
      id: id003
      user: usernameA
      pass: passwordA
  </code></pre>
  <p>In my template I need to extract only the unique values of user and pass.
  I have something like this:</p>
  <pre><code>{{- range .Values.clients }}
  - name: {{ .name | printf &quot;user_%s&quot; }}
    valueFrom:
      secretKeyRef:
        name: somesecret
        key: {{ .user | quote }}
  - name: {{ .name | printf &quot;pass_%s&quot; }}
    valueFrom:
      secretKeyRef:
        name: somesecret
        key: {{ .pass | quote }}
  {{- end }}  
  </code></pre>
  <p>The end result should be something like:</p>
  <pre><code>- name: user_clientA
    valueFrom:
      secretKeyRef:
        name: somesecret
        key: usernameA
  - name: pass_clientA
    valueFrom:
      secretKeyRef:
        name: somesecret
        key: passwordA
  - name: user_clientB
    valueFrom:
      secretKeyRef:
        name: somesecret
        key: usernameB
  - name: pass_clientB
    valueFrom:
      secretKeyRef:
        name: somesecret
        key: passwordB
  </code></pre>
  <p>I tried {{- range .Values.clients | pick &quot;user&quot; &quot;pass&quot; | uniq }} but doesn't seem to work. I don't know how to write this so i can filter just &quot;user&quot; and &quot;pass&quot; keys and discard the duplicates.</p>