Don't prefix base path to absolute path

If an entry in the `values` section of a helmfile is an absolute
path, then it would be erroneously prefixed with the base path.

This would cause `helmfile sync` to fail because the value.yaml file
would not exist at the incorrectly prefixed path.
This commit is contained in:
David Bliss 2018-05-15 11:22:38 +01:00
parent 09f19047bd
commit 4fe8d988d5
1 changed files with 6 additions and 1 deletions

View File

@ -481,7 +481,12 @@ func flagsForRelease(helm helmexec.Interface, basePath string, release *ReleaseS
for _, value := range release.Values {
switch typedValue := value.(type) {
case string:
path := filepath.Join(basePath, typedValue)
var path string
if filepath.IsAbs(typedValue) {
path = typedValue
} else {
path = filepath.Join(basePath, typedValue)
}
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil, err
}