Skip to content

Commit 4ed3efe

Browse files
committed
helm: add ChartBuilder, optimize DM and index
Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent 1e89660 commit 4ed3efe

10 files changed

+1796
-222
lines changed

internal/helm/chart.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ func OverwriteChartDefaultValues(chart *helmchart.Chart, data []byte) (bool, err
7070
// LoadChartMetadata attempts to load the chart.Metadata from the "Chart.yaml" file in the directory or archive at the
7171
// given chartPath. It takes "requirements.yaml" files into account, and is therefore compatible with the
7272
// chart.APIVersionV1 format.
73-
func LoadChartMetadata(chartPath string) (*helmchart.Metadata, error) {
73+
func LoadChartMetadata(chartPath string) (meta *helmchart.Metadata, err error) {
7474
i, err := os.Stat(chartPath)
7575
if err != nil {
7676
return nil, err
7777
}
78-
switch {
79-
case i.IsDir():
80-
return LoadChartMetadataFromDir(chartPath)
81-
default:
82-
return LoadChartMetadataFromArchive(chartPath)
78+
if i.IsDir() {
79+
meta, err = LoadChartMetadataFromDir(chartPath)
80+
return
8381
}
82+
meta, err = LoadChartMetadataFromArchive(chartPath)
83+
return
8484
}
8585

8686
// LoadChartMetadataFromDir loads the chart.Metadata from the "Chart.yaml" file in the directory at the given path.

0 commit comments

Comments
 (0)