|
|
@ -99,6 +99,9 @@ func Templates(linter *support.Linter, values map[string]interface{}, namespace
|
|
|
|
for _, template := range chart.Templates {
|
|
|
|
for _, template := range chart.Templates {
|
|
|
|
fileName, data := template.Name, template.Data
|
|
|
|
fileName, data := template.Name, template.Data
|
|
|
|
fpath = fileName
|
|
|
|
fpath = fileName
|
|
|
|
|
|
|
|
if chart.Metadata.Type == "library" {
|
|
|
|
|
|
|
|
linter.RunLinterRule(support.WarningSev, fpath, validateLibraryTemplate(fileName))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
linter.RunLinterRule(support.ErrorSev, fpath, validateAllowedExtension(fileName))
|
|
|
|
linter.RunLinterRule(support.ErrorSev, fpath, validateAllowedExtension(fileName))
|
|
|
|
// These are v3 specific checks to make sure and warn people if their
|
|
|
|
// These are v3 specific checks to make sure and warn people if their
|
|
|
@ -179,6 +182,13 @@ func validateTopIndentLevel(content string) error {
|
|
|
|
return scanner.Err()
|
|
|
|
return scanner.Err()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func validateLibraryTemplate(fileName string) error {
|
|
|
|
|
|
|
|
if fileName[0] != '_' {
|
|
|
|
|
|
|
|
return fmt.Errorf("template file name %s does not start with '_' character", fileName)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Validation functions
|
|
|
|
// Validation functions
|
|
|
|
func validateTemplatesDir(templatesPath string) error {
|
|
|
|
func validateTemplatesDir(templatesPath string) error {
|
|
|
|
if fi, err := os.Stat(templatesPath); err != nil {
|
|
|
|
if fi, err := os.Stat(templatesPath); err != nil {
|
|
|
|