mirror of
https://github.com/helmfile/helmfile.git
synced 2026-09-30 17:59:54 +02:00
ensure helmfiles are searched relative to base helmfile (#307)
This commit is contained in:
committed by
KUOKA Yusuke
parent
d0a4008965
commit
2e44da1b54
@@ -586,7 +586,8 @@ func findAndIterateOverDesiredStates(fileOrDir string, converge func(*state.Helm
|
||||
}
|
||||
} else if len(st.Helmfiles) > 0 {
|
||||
for _, globPattern := range st.Helmfiles {
|
||||
matches, err := filepath.Glob(globPattern)
|
||||
helmfileRelativePattern := st.JoinBase(globPattern)
|
||||
matches, err := filepath.Glob(helmfileRelativePattern)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed processing %s: %v", globPattern, err)
|
||||
}
|
||||
|
||||
@@ -761,6 +761,11 @@ func (state *HelmState) UpdateDeps(helm helmexec.Interface) []error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// JoinBase returns an absolute path in the form basePath/relative
|
||||
func (state *HelmState) JoinBase(relPath string) string {
|
||||
return filepath.Join(state.basePath, relPath)
|
||||
}
|
||||
|
||||
// normalizeChart allows for the distinction between a file path reference and repository references.
|
||||
// - Any single (or double character) followed by a `/` will be considered a local file reference and
|
||||
// be constructed relative to the `base path`.
|
||||
|
||||
Reference in New Issue
Block a user