|
|
|
@ -59,14 +59,14 @@ func IsChartDir(dirName string) (bool, error) {
|
|
|
|
|
return false, errors.Errorf("%q is not a directory", dirName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chartYaml := filepath.Join(dirName, "Chart.yaml")
|
|
|
|
|
chartYaml := filepath.Join(dirName, ChartfileName)
|
|
|
|
|
if _, err := os.Stat(chartYaml); os.IsNotExist(err) {
|
|
|
|
|
return false, errors.Errorf("no Chart.yaml exists in directory %q", dirName)
|
|
|
|
|
return false, errors.Errorf("no %s exists in directory %q", ChartfileName, dirName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chartYamlContent, err := ioutil.ReadFile(chartYaml)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, errors.Errorf("cannot read Chart.Yaml in directory %q", dirName)
|
|
|
|
|
return false, errors.Errorf("cannot read %s in directory %q", ChartfileName, dirName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chartContent := new(chart.Metadata)
|
|
|
|
@ -74,10 +74,10 @@ func IsChartDir(dirName string) (bool, error) {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
if chartContent == nil {
|
|
|
|
|
return false, errors.New("chart metadata (Chart.yaml) missing")
|
|
|
|
|
return false, errors.Errorf("chart metadata (%s) missing", ChartfileName)
|
|
|
|
|
}
|
|
|
|
|
if chartContent.Name == "" {
|
|
|
|
|
return false, errors.New("invalid chart (Chart.yaml): name must not be empty")
|
|
|
|
|
return false, errors.Errorf("invalid chart (%s): name must not be empty", ChartfileName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true, nil
|
|
|
|
|