fix(pkg/action): add namespace to release options

ref: https://github.com/helm/helm/issues/5732

Signed-off-by: Adam Reese <adam@reese.io>
pull/5737/head
Adam Reese 6 years ago
parent 9401295d2a
commit 590bf10ab5
No known key found for this signature in database
GPG Key ID: 06F35E60A7A18DD6

@ -122,6 +122,7 @@ func (i *Install) Run(chrt *chart.Chart) (*release.Release, error) {
options := chartutil.ReleaseOptions{ options := chartutil.ReleaseOptions{
Name: i.ReleaseName, Name: i.ReleaseName,
Namespace: i.Namespace,
IsInstall: true, IsInstall: true,
} }
valuesToRender, err := chartutil.ToRenderValues(chrt, i.rawValues, options, caps) valuesToRender, err := chartutil.ToRenderValues(chrt, i.rawValues, options, caps)

@ -146,6 +146,7 @@ func (u *Upgrade) prepareUpgrade(name string, chart *chart.Chart) (*release.Rele
options := chartutil.ReleaseOptions{ options := chartutil.ReleaseOptions{
Name: name, Name: name,
Namespace: currentRelease.Namespace,
IsUpgrade: true, IsUpgrade: true,
} }

@ -367,6 +367,7 @@ func CoalesceTables(dst, src map[string]interface{}) map[string]interface{} {
// for the composition of the final values struct // for the composition of the final values struct
type ReleaseOptions struct { type ReleaseOptions struct {
Name string Name string
Namespace string
IsUpgrade bool IsUpgrade bool
IsInstall bool IsInstall bool
} }
@ -383,6 +384,7 @@ func ToRenderValues(chrt *chart.Chart, chrtVals map[string]interface{}, options
"Capabilities": caps, "Capabilities": caps,
"Release": map[string]interface{}{ "Release": map[string]interface{}{
"Name": options.Name, "Name": options.Name,
"Namespace": options.Namespace,
"IsUpgrade": options.IsUpgrade, "IsUpgrade": options.IsUpgrade,
"IsInstall": options.IsInstall, "IsInstall": options.IsInstall,
"Service": "Helm", "Service": "Helm",

@ -50,7 +50,10 @@ func Templates(linter *support.Linter, values map[string]interface{}, namespace
return return
} }
options := chartutil.ReleaseOptions{Name: "testRelease"} options := chartutil.ReleaseOptions{
Name: "testRelease",
Namespace: namespace,
}
cvals, err := chartutil.CoalesceValues(chart, values) cvals, err := chartutil.CoalesceValues(chart, values)
if err != nil { if err != nil {

Loading…
Cancel
Save