dstandish commented on a change in pull request #18542:
URL: https://github.com/apache/airflow/pull/18542#discussion_r754802128



##########
File path: chart/tests/test_ingress_web.py
##########
@@ -86,7 +112,7 @@ def test_should_ingress_host_still_work(self):
         assert (
             ["old-host"]
             == jmespath.search("spec.rules[*].host", docs[0])
-            == jmespath.search("spec.tls[0].hosts", docs[0])
+            == 
list(itertools.chain.from_iterable(jmespath.search("spec.tls[*].hosts", 
docs[0])))

Review comment:
       can you clarify the need for this change? if the old behavior should 
work, shouldn't the old test be good enough?

##########
File path: chart/templates/webserver/webserver-ingress.yaml
##########
@@ -39,12 +39,27 @@ metadata:
     {{- toYaml . | nindent 4 }}
   {{- end }}
 spec:
-  {{- if .Values.ingress.web.tls.enabled }}
+  {{- if and .Values.ingress.web.hosts (.Values.ingress.web.hosts | first | 
kindIs "string" | not) }}
+  {{- $anyTlsHosts := false -}}
+  {{- range .Values.ingress.web.hosts }}
+  {{- if .tls.enabled }}

Review comment:
       i think there is something wrong here.  i tried rendering this config 
(the 1.20 list[str] behavior)
   
   ```
   ingress:
     enabled: true
     web:
       # host: "hi.com"
       hosts:
       - name: "yo.com"
       #   # configs for web Ingress TLS
       #   tls:
       #     # Enable TLS termination for the web Ingress
       #     enabled: false
       #     # the name of a pre-created Secret containing a TLS private key 
and certificate
       #     secretName: ""
   ```
   
   and i get this error
   
   ```
   ❯ helm template ~/code/airflow/chart -f ingress-config.yaml -s 
templates/webserver/webserver-ingress.yaml
   Error: template: airflow/templates/webserver/webserver-ingress.yaml:45:13: 
executing "airflow/templates/webserver/webserver-ingress.yaml" at 
<.tls.enabled>: nil pointer evaluating interface {}.enable
   ```
   
   and if i'm actually catching something then there are probably similar 
issues where this logic is repeated




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to