<p>We have an application deployed in AKS , the kubernetes version we were using is 1.15 now we want to upgrade the Kubernetes to 1.16, I notice that some of the APIs have been deprecated in 1.16.We have deployment.yaml file in which I had to change the from</p>
<p>apiVersion: extensions/v1beta1 to apiVersion: apps/v1 for Deployment.</p>
<p>after doing this change I see that the deployment YAML is failing lint test for another entry :</p>
<pre><code>    - name  : APP_HOST
    {{- range $host := .Values.ingress.hosts }}
      value: {{ $host }}
    {{- end }}
</code></pre>
<p>Error :</p>
<p>npx yaml-lint yamllint deployment.yaml</p>
<p>npx: installed 45 in 14.04s</p>
<p>× YAML Lint failed for deployment.yaml</p>
<p>× missed comma between flow collection entries at line 88, column 11:
{{- range $host := .Values.ingress ...</p>
<p>Can some one help me with the syntax needed for this. Mind you it was working fine before. Not sure if I have  added and extra space or corrupted the file.</p>
<p>Thanks</p>

ptilloo
<p>The syntax you have looks like a correct Helm template, including correct whitespace controls.  However, it is <em>not</em> valid YAML; the template <code>{{ ... }}</code> syntax looks at least a little bit like an inline mapping <code>{ key: value }</code>, and this confuses the linter.</p>
<p>You can't run the un-rendered Helm template files through <code>yamllint</code> or another plain YAML validator.  You can run <code>helm template</code> to render the template to plain text, and then run <code>yamllint</code> on that.  The current version of Helm will try to parse the produced YAML as it generates it, so just running <code>helm template</code> will give you some protection against whitespace errors.</p>
