fix: Support for kustomization as chart

A kustomization has not been properly chartified when a kustomization is specified on `releases[].chart` but there were no `releases[].strategicMergePatches` and `jsonPatches` specified.
This fixes that.
This commit is contained in:
Yusuke Kuoka
2020-05-27 22:07:52 +09:00
parent 68432b1848
commit 29fdb57add
6 changed files with 76 additions and 0 deletions
+9
View File
@@ -3,6 +3,8 @@ package state
import (
"github.com/roboll/helmfile/pkg/helmexec"
"github.com/variantdev/chartify"
"os"
"path/filepath"
"strings"
)
@@ -29,6 +31,13 @@ func (st *HelmState) PrepareChartify(helm helmexec.Interface, release *ReleaseSp
opts.ChartVersion = release.Version
dir := filepath.Join(st.basePath, release.Chart)
if stat, _ := os.Stat(dir); stat != nil && stat.IsDir() {
if exists, err := st.fileExists(filepath.Join(dir, "Chart.yaml")); err == nil && !exists {
shouldRun = true
}
}
for _, d := range release.Dependencies {
var dep string