Skip to content

Commit

Permalink
helm: add ChartBuilder, optimize DM and index
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Nov 5, 2021
1 parent eefae20 commit 4f5d87b
Show file tree
Hide file tree
Showing 10 changed files with 1,796 additions and 222 deletions.
12 changes: 6 additions & 6 deletions internal/helm/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ func OverwriteChartDefaultValues(chart *helmchart.Chart, data []byte) (bool, err
// LoadChartMetadata attempts to load the chart.Metadata from the "Chart.yaml" file in the directory or archive at the
// given chartPath. It takes "requirements.yaml" files into account, and is therefore compatible with the
// chart.APIVersionV1 format.
func LoadChartMetadata(chartPath string) (*helmchart.Metadata, error) {
func LoadChartMetadata(chartPath string) (meta *helmchart.Metadata, err error) {
i, err := os.Stat(chartPath)
if err != nil {
return nil, err
}
switch {
case i.IsDir():
return LoadChartMetadataFromDir(chartPath)
default:
return LoadChartMetadataFromArchive(chartPath)
if i.IsDir() {
meta, err = LoadChartMetadataFromDir(chartPath)
return
}
meta, err = LoadChartMetadataFromArchive(chartPath)
return
}

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

0 comments on commit 4f5d87b

Please sign in to comment.