From 94621a09f2b2a2491c7376c8166aee0d12dcfb4a Mon Sep 17 00:00:00 2001 From: zwwhdls Date: Sun, 15 Dec 2019 15:53:00 +0800 Subject: [PATCH] fix #7222 Signed-off-by: zwwhdls --- pkg/action/install.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/action/install.go b/pkg/action/install.go index 8cd270693..aa19c3bbe 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -23,6 +23,7 @@ import ( "os" "path" "path/filepath" + "reflect" "strings" "text/template" "time" @@ -218,6 +219,11 @@ func (i *Install) Run(chrt *chart.Chart, vals map[string]interface{}) (*release. } // Check error from render if err != nil { + if chrt.Values == nil && reflect.DeepEqual(vals, map[string]interface{}{}) { + rel.SetStatus(release.StatusFailed, fmt.Sprint("failed to render resource: lack of values.yaml")) + // Return a release with partial data so that the client can show debugging information. + return rel, errors.New("failed to render resource: lack of values.yaml") + } rel.SetStatus(release.StatusFailed, fmt.Sprintf("failed to render resource: %s", err.Error())) // Return a release with partial data so that the client can show debugging information. return rel, err