[fix] chartify process when chart path is absolute

Signed-off-by: Quan TRAN <account@itscaro.me>
This commit is contained in:
Quan TRAN 2022-04-06 01:02:14 +02:00 committed by Quan TRAN
parent f1a250cab3
commit 88127d641b
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,7 @@
helmDefaults:
wait: true
waitForJobs: true
timeout: 300
releases:
- name: argo-cd-crds
chart: git::https://github.com/argoproj/argo-helm.git@charts/argo-cd/crds?ref=master

View File

@ -100,7 +100,10 @@ func (st *HelmState) PrepareChartify(helm helmexec.Interface, release *ReleaseSp
var shouldRun bool
dir := filepath.Join(st.basePath, chart)
dir := chart
if !filepath.IsAbs(chart) {
dir = filepath.Join(st.basePath, 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
@ -180,6 +183,7 @@ func (st *HelmState) PrepareChartify(helm helmexec.Interface, release *ReleaseSp
}
if shouldRun {
st.logger.Debugf("Chartify process for %s", dir)
generatedFiles, err := st.generateValuesFiles(helm, release, workerIndex)
if err != nil {
return nil, clean, err