dnskr commented on code in PR #7105:
URL: https://github.com/apache/kyuubi/pull/7105#discussion_r2159641578
##########
charts/kyuubi/templates/kyuubi-podmonitor.yaml:
##########
@@ -23,7 +23,7 @@ metadata:
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
{{- if .Values.metrics.podMonitor.labels }}
- {{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
+ {{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
Review Comment:
It is quite a common pattern to use indentation for blocks to improve the
readability of templates and it is mentioned in [Best Practices for
templates](https://helm.sh/docs/chart_best_practices/templates/#formatting-templates:~:text=Blocks%20(such%20as%20control%20structures)%20may%20be%20indented%20to%20indicate%20flow%20of%20the%20template%20code.).
For instance, if we add common labels to all metric resources, the template
without indentation looks as follows:
```yaml
metadata:
name: {{ .Release.Name }}
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
{{- if .Values.metrics.labels }}
{{- toYaml .Values.metrics.labels | nindent 4 }}
{{- end }}
{{- if .Values.metrics.podMonitor.labels }}
{{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
{{- end }}
```
but with indentation, it would be clearer that we have three sources for
labels:
```yaml
metadata:
name: {{ .Release.Name }}
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
{{- if .Values.metrics.labels }}
{{- toYaml .Values.metrics.labels | nindent 4 }}
{{- end }}
{{- if .Values.metrics.podMonitor.labels }}
{{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
{{- end }}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]