Allow secrets to be excluded from release template inheritance (#1189)

* Allow secrets to be excluded from inheritance, small docs update

Signed-off-by: Alex Vorona <alex@vorona.com.ua>

* Fix typo in docs

Signed-off-by: Alex Vorona <alex@vorona.com.ua>

---------

Signed-off-by: Alex Vorona <alex@vorona.com.ua>
This commit is contained in:
Oleksandr Vorona 2023-12-05 10:17:48 +00:00 committed by GitHub
parent b10692dc9b
commit 29caac793e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -104,6 +104,8 @@ releases:
version: 0.3.2 version: 0.3.2
inherit: inherit:
- template: default - template: default
except:
- secrets
- name: kubernetes-dashboard - name: kubernetes-dashboard
version: 0.10.0 version: 0.10.0
inherit: inherit:
@ -153,7 +155,7 @@ Thus we added a new way for inheritance, which uses the `inherit` field we intro
See [issue helmfile/helmfile#435](https://github.com/helmfile/helmfile/issues/435#issuecomment-1362177510) for more context. See [issue helmfile/helmfile#435](https://github.com/helmfile/helmfile/issues/435#issuecomment-1362177510) for more context.
You might also find [issue roboll/helmfile#428](https://github.com/roboll/helmfile/issues/428) useful for more context on how we originally designed the relase template and what it's supposed to solve. You might also find [issue roboll/helmfile#428](https://github.com/roboll/helmfile/issues/428) useful for more context on how we originally designed the release template and what it's supposed to solve.
## Layering Release Values ## Layering Release Values

View File

@ -199,8 +199,10 @@ func (st *HelmState) releaseWithInheritedTemplate(r *ReleaseSpec, inheritancePat
src.SetValuesTemplate = nil src.SetValuesTemplate = nil
case "set": case "set":
src.SetValues = nil src.SetValues = nil
case "secrets":
src.Secrets = nil
default: default:
return nil, fmt.Errorf("%q is not allowed under `inherit`. Allowed values are \"set\", \"setTemplate\", \"values\", \"valuesTemplate\", and \"labels\"", k) return nil, fmt.Errorf("%q is not allowed under `inherit`. Allowed values are \"set\", \"setTemplate\", \"values\", \"valuesTemplate\", \"secrets\", and \"labels\"", k)
} }
st.logger.Debugf("excluded field %q when inheriting template %q to release %q", k, templateName, r.Name) st.logger.Debugf("excluded field %q when inheriting template %q to release %q", k, templateName, r.Name)