Skip to content

Commit

Permalink
fix: resolve issues found by linter in khelm 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoltzsche committed Oct 17, 2021
1 parent f280425 commit 7d0d639
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
11 changes: 0 additions & 11 deletions pkg/helm/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ func renderChart(chartRequested *chart.Chart, req *config.ChartConfig, getters g
return transformed, nil
}

// checkIfInstallable validates if a chart can be installed
//
// Application chart type is only installable
func checkIfInstallable(ch *chart.Chart) error {
switch ch.Metadata.Type {
case "", "application":
return nil
}
return errors.Errorf("cannot install chart %q since it is of type %q", ch.Name(), ch.Metadata.Type)
}

func parseKubeVersion(version string) (kv chartutil.KubeVersion, err error) {
v, err := semver.NewVersion(version)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/helm/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func newRepositories(settings *cli.EnvSettings, getters getter.Providers) (r *re
cacheDir: settings.RepositoryCache,
indexFiles: map[string]*repo.IndexFile{},
}
if !filepath.IsAbs(string(settings.RepositoryConfig)) {
if !filepath.IsAbs(settings.RepositoryConfig) {
return nil, errors.Errorf("path to repositories.yaml must be absolute but was %q", settings.RepositoryConfig)
}
r.repos, err = repo.LoadFile(settings.RepositoryConfig)
Expand Down Expand Up @@ -353,8 +353,8 @@ func newTempRepositories(r *repositories) (*tempRepositories, error) {
return nil, errors.WithStack(err)
}
_ = tmpFile.Close()
err = r.repos.WriteFile(tmpFile.Name(), 640)
return &tempRepositories{r, tmpFile.Name()}, nil
err = r.repos.WriteFile(tmpFile.Name(), 0640)
return &tempRepositories{r, tmpFile.Name()}, err
}

func (f *tempRepositories) FilePath() string {
Expand Down

0 comments on commit 7d0d639

Please sign in to comment.