diff --git a/pkg/chart/loader/archive.go b/pkg/chart/loader/archive.go index 8b38cb89f..d13146595 100644 --- a/pkg/chart/loader/archive.go +++ b/pkg/chart/loader/archive.go @@ -139,6 +139,11 @@ func LoadArchiveFiles(in io.Reader) ([]*BufferedFile, error) { } parts := strings.Split(hd.Name, delimiter) + + if parts[0] == "Chart.yaml" { + return nil, errors.New("chart yaml not in base directory") + } + n := strings.Join(parts[1:], delimiter) // Normalize the path to the / delimiter @@ -165,10 +170,6 @@ func LoadArchiveFiles(in io.Reader) ([]*BufferedFile, error) { return nil, errors.New("chart contains illegally named files") } - if parts[0] == "Chart.yaml" { - return nil, errors.New("chart yaml not in base directory") - } - if _, err := io.Copy(b, tr); err != nil { return nil, err }