title: Jinja match string with first item in list
body: <p>I have a list that looks like the following:</p>
  
  <pre><code>---
  istio:
    name: postgres
    k8s:
      metadata:
        namespace: experimental
      gateways:
      - number: 5432
        protocol: TCP
  ...
  </code></pre>
  
  <p>Specifically just the "protocol" key. I am trying to match that to see if it matches a string in my Jinja template. Everything that I have tried has failed and this is what I had last tested:</p>
  
  <pre><code>---
  % if istio.k8s.gateways.protocol[0] == 'HTTP' %}
    http:
    - route:
  {% for vsSettings in istio.k8s.virtualServers %}
      - destination:
  ...
  </code></pre>
  
  <p>Any advice, judgement, ridicule would be greatly appreciated.</p>