fix: formatting of YAML samples in 1.0 proposal doc (#767)

Signed-off-by: Scott Leggett <scott@sl.id.au>
This commit is contained in:
Scott Leggett 2023-03-27 17:01:26 +08:00 committed by GitHub
parent 10d640b211
commit 734957238d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 42 deletions

View File

@ -18,50 +18,48 @@ Note that every breaking change should have an easy alternative way to achieve t
- By forcing (or print a big warning) the user to do separate helmfile parts for `environments` and `releases`, it's very unlikely Helmfile needs double-rendering at all. - By forcing (or print a big warning) the user to do separate helmfile parts for `environments` and `releases`, it's very unlikely Helmfile needs double-rendering at all.
- After this change, every helmfile.yaml written this way: - After this change, every helmfile.yaml written this way:
``` environments:
environments: default:
default: values:
values: - foo: bar
- foo: bar releases:
releases: - name: myapp
- name: myapp chart: charts/myapp
chart: charts/myapp values:
values: - {{ .Values | toYaml | nindent 4 }}
- {{ .Values | toYaml | nindent 4 }}
```
must be rewritten like: must be rewritten like:
```
environments: environments:
default: default:
values: values:
- foo: bar - foo: bar
--- ---
releases: releases:
- name: myapp - name: myapp
chart: charts/myapp chart: charts/myapp
values: values:
- {{ .Values | toYaml | nindent 4 }} - {{ .Values | toYaml | nindent 4 }}
```
It might not be a deal breaker as you already had to separate helmfile parts when you need to generate `environments` dynamically: It might not be a deal breaker as you already had to separate helmfile parts when you need to generate `environments` dynamically:
```
environments: environments:
default: default:
values: values:
- foo: bar - foo: bar
--- ---
environments: environments:
default: default:
values: values:
- {{ .Values | toYaml | nindent 6}}} - {{ .Values | toYaml | nindent 6}}}
- bar: baz - bar: baz
--- ---
releases: releases:
- name: myapp - name: myapp
chart: charts/myapp chart: charts/myapp
values: values:
- {{ .Values | toYaml | nindent 4 }} - {{ .Values | toYaml | nindent 4 }}
```
If you're already using any helmfile.yaml files that are written in the first style, do start using `---` today! It will probably reveal and fix unintended template evaluations. If you start using `---` today, you won't need to do anything after Helmfile 1.0. If you're already using any helmfile.yaml files that are written in the first style, do start using `---` today! It will probably reveal and fix unintended template evaluations. If you start using `---` today, you won't need to do anything after Helmfile 1.0.
### Force `.gotmpl` file extension for `helmfile.yaml` in case you want helmfile to render it as a go template before yaml parsing. ### Force `.gotmpl` file extension for `helmfile.yaml` in case you want helmfile to render it as a go template before yaml parsing.