Bugfix: panic when chart contains requirements.lock

Signed-off-by: Zhengyi Lai <zheng1@yunify.com>
pull/8915/head
Zhengyi Lai 5 years ago
parent 0498f0e5a2
commit ebf6d7e5b2
No known key found for this signature in database
GPG Key ID: 98AAE0EBE0B2134F

@ -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})
}

Loading…
Cancel
Save