Commit 7a054e0e authored by Jim's avatar Jim

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
parent 534f0df9
...@@ -87,6 +87,10 @@ func LoadArchive(in io.Reader) (*chart.Chart, error) { ...@@ -87,6 +87,10 @@ func LoadArchive(in io.Reader) (*chart.Chart, error) {
parts := strings.Split(hd.Name, "/") parts := strings.Split(hd.Name, "/")
n := strings.Join(parts[1:], "/") 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 { if _, err := io.Copy(b, tr); err != nil {
return &chart.Chart{}, err return &chart.Chart{}, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment