Skip to content

Commit

Permalink
Merge pull request #75 from ravikondamuru/b_v0.9.0
Browse files Browse the repository at this point in the history
Initialize registryClient using RegistryConfig
  • Loading branch information
elenz97 authored May 16, 2022
2 parents fb127b9 + 66fbd53 commit 4584090
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"helm.sh/helm/v3/pkg/cli"
"helm.sh/helm/v3/pkg/downloader"
"helm.sh/helm/v3/pkg/getter"
"helm.sh/helm/v3/pkg/registry"
"helm.sh/helm/v3/pkg/release"
"helm.sh/helm/v3/pkg/repo"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down Expand Up @@ -103,6 +104,15 @@ func newClient(options *Options, clientGetter genericclioptions.RESTClientGetter
return nil, err
}

registryClient, err := registry.NewClient(
registry.ClientOptDebug(settings.Debug),
registry.ClientOptCredentialsFile(settings.RegistryConfig),
)
if err != nil {
return nil, err
}
actionConfig.RegistryClient = registryClient

return &HelmClient{
Settings: settings,
Providers: getter.All(settings),
Expand Down Expand Up @@ -147,6 +157,10 @@ func setEnvSettings(options *Options, settings *cli.EnvSettings) error {
settings.RepositoryConfig = options.RepositoryConfig
settings.Debug = options.Debug

if options.RegistryConfig != "" {
settings.RegistryConfig = options.RegistryConfig
}

return nil
}

Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type Options struct {
Debug bool
Linting bool
DebugLog action.DebugLog
RegistryConfig string
Output io.Writer
}

Expand Down

0 comments on commit 4584090

Please sign in to comment.