jedcunningham commented on a change in pull request #16517:
URL: https://github.com/apache/airflow/pull/16517#discussion_r655602922
##########
File path: chart/templates/flower/flower-service.yaml
##########
@@ -44,9 +44,12 @@ spec:
component: flower
release: {{ .Release.Name }}
ports:
+ {{- if .Values.flower.service.portsOverride }}
+ {{- toYaml .Values.flower.service.portsOverride | nindent 4 }}
+ {{- else }}
- name: flower-ui
- protocol: TCP
port: {{ .Values.ports.flowerUI }}
Review comment:
Without quotes:
```
Error: cannot load values.yaml: error converting YAML to JSON: yaml: invalid
map key: map[interface {}]interface {}{".Values.ports.flowerUI":interface
{}(nil)}
```
It needs to be a string in `values.yaml` so `tpl` works in the template
itself ([like these
here](https://github.com/apache/airflow/blob/79494a6f9ef491a1accdcc178e7434eb456e74da/chart/values.yaml#L1076).
However, k8s will only accept an int for `port`.
One option I thought of was instead of `toYaml`ing the whole thing, range
over it to `tpl` individual values.
Something like this (definitely untested):
```
{{ range .Values.webserver.service.ports }}
-
{{ range $key, $val . }}
{{ $key }}: {{ tpl $val }}
{{- end }}
{{- end }}
```
Last week I dismissed it since I envisioned needing to `int` only certain
keys, but that might work as-is looking at it again.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]