title: ingress.yaml template returns error in renderring --> nil pointer evaluating interface {}.service
body: <p>I am installing a helm chart which has a ingress.yaml template.</p>
  <p>I get this error:</p>
  <blockquote>
  <p>Error: render error in &quot;chartmuseum/templates/ingress.yaml&quot;: template: chartmuseum/templates/ingress.yaml:35:22: executing &quot;chartmuseum/templates/ingress.yaml&quot; at &lt;.Values.service.servicename&gt;: nil pointer evaluating interface {}.service</p>
  </blockquote>
  <p>I am not able to find where the problem is. The same set of if else structure works abolutely fine in the service.yaml of the same helm chart.</p>
  <pre><code>- path: {{ default &quot;/&quot; .path | quote }}
          backend:
          {{- if .Values.service.servicename }}
            serviceName: {{ .Values.service.servicename }}
          {{- else }}
            serviceName: {{ include &quot;chartmuseum.fullname&quot; . }}
          {{- end }}
  </code></pre>
  <p>Getting error on this line --&gt; serviceName: {{ .Values.service.servicename }}</p>
  <p>The code that works in service.yaml fine is</p>
  <pre><code>metadata:
  {{- if .Values.service.servicename }}
    name: {{ .Values.service.servicename }}
  {{- else }}
    name: {{ include &quot;chartmuseum.fullname&quot; . }}
  {{- end }}
  </code></pre>
  <p>Expected result: if there is a servcice.servicename in values in values.yaml file , the ingress should pick the value from there for the key serviceName. Else it should include &quot;chartmuseum.fullname&quot;.</p>
  <p>The same structure works fine for service.yaml.</p>
  <p>Below is the url of the original helm chart that i am using.</p>
  <p><a href="https://github.com/helm/charts/tree/master/stable/chartmuseum" rel="noreferrer">https://github.com/helm/charts/tree/master/stable/chartmuseum</a></p>
  <p>I just modified the ingress.yaml to add if else block around line 31.
  Ingress.yaml <a href="https://github.com/helm/charts/blob/master/stable/chartmuseum/templates/ingress.yaml" rel="noreferrer">https://github.com/helm/charts/blob/master/stable/chartmuseum/templates/ingress.yaml</a></p>
  <p>Values.yaml file is insignificant. I have the below values in it</p>
  <pre><code>service:
    servicename: helm-charts-test
  </code></pre>
  <p>but even without this value, the if else block is expected to work.</p>