fix: absolute paths to helmfiles should work (#498)

Fixes #488
This commit is contained in:
KUOKA Yusuke 2019-03-20 17:45:48 +09:00 committed by GitHub
parent c4eb95f3ec
commit acbb416028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -308,8 +308,13 @@ func (a *App) loadDesiredStateFromYaml(yaml []byte, file string, namespace strin
helmfiles := []string{}
for _, globPattern := range st.Helmfiles {
helmfileRelativePattern := st.JoinBase(globPattern)
matches, err := a.glob(helmfileRelativePattern)
var absPathPattern string
if filepath.IsAbs(globPattern) {
absPathPattern = globPattern
} else {
absPathPattern = st.JoinBase(globPattern)
}
matches, err := a.glob(absPathPattern)
if err != nil {
return nil, fmt.Errorf("failed processing %s: %v", globPattern, err)
}