From 7a054e0e6b6e2be2220279f5a2c2a5e203e7cfab Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 31 Oct 2016 22:25:38 -0400 Subject: [PATCH] fix(pkg/chartutil): add error if chart yaml not in directory For archived files the Chart.yaml file should be contained in a base directory. This commit adds an error when the Chart.yaml file is found in the root directory. Fixes #1171 --- pkg/chartutil/load.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/chartutil/load.go b/pkg/chartutil/load.go index dba1100e1..9a01bdad4 100644 --- a/pkg/chartutil/load.go +++ b/pkg/chartutil/load.go @@ -87,6 +87,10 @@ func LoadArchive(in io.Reader) (*chart.Chart, error) { parts := strings.Split(hd.Name, "/") n := strings.Join(parts[1:], "/") + if parts[0] == "Chart.yaml" { + return nil, errors.New("chart yaml not in base directory") + } + if _, err := io.Copy(b, tr); err != nil { return &chart.Chart{}, err }