From b8017e183ac575f5a61878ede742780bf05abc34 Mon Sep 17 00:00:00 2001 From: Ward Loos Date: Fri, 23 Jun 2023 23:07:06 +0200 Subject: [PATCH] Helm - Loki: Fix empty starting line in runtimeConfig (#8657) **What this PR does / why we need it**: The `runtime` ConfigMap in the Loki Helm chart (introduced in https://github.com/grafana/loki/commit/7aa596752d33e8a0445aec59c23642b83baf4328) starts with an empty line because it improperly removes the current line. ```yaml --- # Source: loki/templates/runtime-configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: loki-runtime data: runtime-config.yaml: | {} ``` While this generates technically valid YAML, it looks weird and interacts badly with some tools. E.g.: - Python ruamel.yaml library: https://stackoverflow.com/questions/75584262/ruamel-yaml-adds-incorrect-indentation-indicator - VS Code which is set to trim whitespace on save (yellow highlighting is for objects, not strings): Screenshot 2023-02-28 at 21 13 10 This PR removes this empty start line: ```yaml --- # Source: loki/templates/runtime-configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: loki-runtime data: runtime-config.yaml: | {} ``` **Which issue(s) this PR fixes**: Fixes # **Special notes for your reviewer**: **Checklist** - [X] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [ ] Documentation added - [ ] Tests updated - [ ] `CHANGELOG.md` updated - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md` --- production/helm/loki/templates/runtime-configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/runtime-configmap.yaml b/production/helm/loki/templates/runtime-configmap.yaml index 4463aee17f70c..2f38193da615d 100644 --- a/production/helm/loki/templates/runtime-configmap.yaml +++ b/production/helm/loki/templates/runtime-configmap.yaml @@ -7,4 +7,4 @@ metadata: {{- include "loki.labels" . | nindent 4 }} data: runtime-config.yaml: | - {{ tpl (toYaml .Values.loki.runtimeConfig) . | nindent 4 }} + {{- tpl (toYaml .Values.loki.runtimeConfig) . | nindent 4 }}