Skip to content

Commit

Permalink
fix: lets polish the code to be more clear on chart names
Browse files Browse the repository at this point in the history
as we can support full chart names or local chart names; so lets be more specific which name we are using in the code

Signed-off-by: James Strachan <[email protected]>
  • Loading branch information
jstrachan committed Jan 30, 2020
1 parent 3b05d93 commit 7a55985
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/apps/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,20 @@ func (o *InstallOptions) AddApp(details *envctx.ChartDetails, version string, us
return errors.Wrapf(err, "adding helm repo")
}

chartName, err := o.resolvePrefixesAgainstRepos(repository, app)
if err != nil {
return errors.WithStack(err)
if details.Name == details.LocalName {
details.Name, err = o.resolvePrefixesAgainstRepos(repository, details.LocalName)
if err != nil {
return errors.WithStack(err)
}
}

chartName := details.Name
if chartName == "" {
return errors.Errorf("unable to find %s in %s", app, repository)
}

// The chart inspector allows us to operate on the unpacked chart.
// We need to ask questions then as we have access to the schema, and can add secrets.
interrogateChartFn := o.createInterrogateChartFn(version, chartName, repository, username, password, alias, true)
interrogateChartFn := o.createInterrogateChartFn(version, details.LocalName, repository, username, password, alias, true)

// Called whilst the chart is unpacked and modifiable
installAppFunc := func(dir string) error {
Expand Down Expand Up @@ -144,7 +146,7 @@ func (o *InstallOptions) AddApp(details *envctx.ChartDetails, version string, us
}

// Do the actual work
return helm.InspectChart(chartName, version, repository, username, password, o.Helmer, installAppFunc)
return helm.InspectChart(details.LocalName, version, repository, username, password, o.Helmer, installAppFunc)
}

//GetApps gets a list of installed apps
Expand Down

0 comments on commit 7a55985

Please sign in to comment.