From ebf6d7e5b2b016cc74da67860f651de9544690a7 Mon Sep 17 00:00:00 2001 From: Zhengyi Lai Date: Sat, 25 Jul 2020 09:54:00 +0800 Subject: [PATCH] Bugfix: panic when chart contains requirements.lock Signed-off-by: Zhengyi Lai --- pkg/chart/loader/load.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/chart/loader/load.go b/pkg/chart/loader/load.go index dd4fd2dff..d2aa82ced 100644 --- a/pkg/chart/loader/load.go +++ b/pkg/chart/loader/load.go @@ -123,6 +123,9 @@ func LoadFiles(files []*BufferedFile) (*chart.Chart, error) { if err := yaml.Unmarshal(f.Data, &c.Lock); err != nil { return c, errors.Wrap(err, "cannot load requirements.lock") } + if c.Metadata == nil { + c.Metadata = new(chart.Metadata) + } if c.Metadata.APIVersion == chart.APIVersionV1 { c.Files = append(c.Files, &chart.File{Name: f.Name, Data: f.Data}) }