Amend examples which broke lock files in README.md (#1225)

Prior to this change, these two examples suggested enclosing a release spec in
an if expression, which breaks the lock file when switching environments.

This change parameterizes `installed` instead of the entire release, thus
preserving the dependency locking functionality.
This commit is contained in:
Eric Bailey 2020-04-22 18:38:01 -05:00 committed by GitHub
parent b89fba1cc2
commit 458385d971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -618,11 +618,9 @@ environments:
production: production:
releases: releases:
{{ if eq .Environment.Name "production" }}
- name: newrelic-agent - name: newrelic-agent
installed: {{ eq .Environment.Name "production" | toYaml }}
# snip # snip
{{ end }}
- name: myapp - name: myapp
# snip # snip
``` ```
@ -688,12 +686,10 @@ releases:
- name: myapp-{{ .Values.releaseName }} # release name will be one of `dev` or `prod` depending on selected environment - name: myapp-{{ .Values.releaseName }} # release name will be one of `dev` or `prod` depending on selected environment
values: values:
- values.yaml.gotmpl - values.yaml.gotmpl
{{ if eq (.Values.releaseName "prod" ) }}
# this release would be installed only if selected environment is `production`
- name: production-specific-release - name: production-specific-release
# this release would be installed only if selected environment is `production`
installed: {{ eq .Values.releaseName "prod" | toYaml }}
... ...
{{ end }}
``` ```
### Note ### Note