Skip to content

Commit fbc1951

Browse files
committed
allow using helmChart without repo URL.
1 parent 311dbbf commit fbc1951

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

api/internal/builtins/HelmChartInflationGenerator.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (p *plugin) absChartHome() string {
160160
chartHome = filepath.Join(p.h.Loader().Root(), p.ChartHome)
161161
}
162162

163-
if p.Version != "" && p.Repo != "" {
163+
if p.Version != "" {
164164
return filepath.Join(chartHome, fmt.Sprintf("%s-%s", p.Name, p.Version))
165165
}
166166
return chartHome
@@ -361,7 +361,7 @@ func (p *plugin) chartExistsLocally() (string, bool) {
361361
path := filepath.Join(p.absChartHome(), p.Name)
362362
s, err := os.Stat(path)
363363
if err != nil {
364-
return "", false
364+
return path, false
365365
}
366366
return path, s.IsDir()
367367
}

plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ releaseName: %s
847847
assert.True(t, len(rm.Resources()) > 0)
848848

849849
var chartDir string
850-
if tt.version != "" && tt.repo != "" {
850+
if tt.version != "" {
851851
chartDir = fmt.Sprintf("charts/%s-%s/%s", tt.chartName, tt.version, tt.chartName)
852852
} else {
853853
chartDir = fmt.Sprintf("charts/%s", tt.chartName)
@@ -949,7 +949,7 @@ chartHome: ./charts
949949
require.NoError(t, err)
950950
assert.Equal(t, "bar", cm)
951951

952-
chartDir := filepath.Join(th.GetRoot(), "charts/test-chart")
952+
chartDir := filepath.Join(th.GetRoot(), "charts/test-chart-1.0.0/test-chart")
953953
assert.True(t, th.GetFSys().Exists(chartDir))
954954

955955
chartYamlContent, err := th.GetFSys().ReadFile(filepath.Join(chartDir, "Chart.yaml"))
@@ -983,7 +983,7 @@ debug: true
983983
require.NoError(t, err)
984984
assert.Equal(t, "bar", cm)
985985

986-
chartDir := filepath.Join(th.GetRoot(), "charts/test-chart")
986+
chartDir := filepath.Join(th.GetRoot(), "charts/test-chart-1.0.0/test-chart")
987987
assert.True(t, th.GetFSys().Exists(chartDir))
988988

989989
chartYamlContent, err := th.GetFSys().ReadFile(filepath.Join(chartDir, "Chart.yaml"))

0 commit comments

Comments
 (0)