mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-08 06:02:35 +02:00
fix(state): enhance error message for missing .gotmpl extension in helmfile v1 (#1989)
* fix(state): enhance error message for missing .gotmpl extension in helmfile Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -109,6 +110,9 @@ func (c *StateCreator) Parse(content []byte, baseDir, file string) (*HelmState,
|
||||
if err == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
if filepath.Ext(file) != ".gotmpl" {
|
||||
return nil, &StateLoadError{fmt.Sprintf("failed to read %s: reading document at index %d. Started seeing this since Helmfile v1? Add the .gotmpl file extension", file, i), err}
|
||||
}
|
||||
return nil, &StateLoadError{fmt.Sprintf("failed to read %s: reading document at index %d", file, i), err}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user