Skip to content

Commit

Permalink
Fix crash on reconfiguring repoless release with deps
Browse files Browse the repository at this point in the history
  • Loading branch information
undera committed Jun 27, 2023
1 parent 4e2d318 commit aa79f67
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/dashboard/objects/releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package objects
import (
"bytes"
"gopkg.in/yaml.v3"
"helm.sh/helm/v3/pkg/registry"
"io"
"os"
"path"
Expand Down Expand Up @@ -132,6 +133,16 @@ func locateChart(pathOpts action.ChartPathOptions, chart string, settings *cli.E
return nil, err
}

registryClient, err := registry.NewClient(
registry.ClientOptDebug(false),
registry.ClientOptEnableCache(true),
//registry.ClientOptWriter(out),
registry.ClientOptCredentialsFile(settings.RegistryConfig),
)
if err != nil {
return nil, errorx.Decorate(err, "failed to crete helm config object")
}

if req := chartRequested.Metadata.Dependencies; req != nil {
// If CheckDependencies returns an error, we have unfulfilled dependencies.
// As of Helm 2.4.0, this is treated as a stopping condition:
Expand All @@ -148,6 +159,7 @@ func locateChart(pathOpts action.ChartPathOptions, chart string, settings *cli.E
RepositoryConfig: settings.RepositoryConfig,
RepositoryCache: settings.RepositoryCache,
Debug: settings.Debug,
RegistryClient: registryClient, // added on top of Helm code
}
if err := man.Update(); err != nil {
return nil, err
Expand Down

0 comments on commit aa79f67

Please sign in to comment.