Fix SIGSEGV by adding OCI RegistryClient args

Fixes #10246

WIP: Need to add unit tests, need to add args to newPackage in
cmd/helm/package_test.go

Signed-off-by: Michael Barrientos <mbarrien@cal.berkeley.edu>
pull/10727/head
Michael Barrientos 4 years ago
parent 79cd4dda81
commit b6915b5acb
No known key found for this signature in database
GPG Key ID: 50E36A3B2CBE1B53

@ -122,7 +122,7 @@ func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return compInstall(args, toComplete, client)
},
RunE: func(_ *cobra.Command, args []string) error {
rel, err := runInstall(args, client, valueOpts, out)
rel, err := runInstall(args, client, cfg, valueOpts, out)
if err != nil {
return errors.Wrap(err, "INSTALLATION FAILED")
}
@ -174,7 +174,7 @@ func addInstallFlags(cmd *cobra.Command, f *pflag.FlagSet, client *action.Instal
}
}
func runInstall(args []string, client *action.Install, valueOpts *values.Options, out io.Writer) (*release.Release, error) {
func runInstall(args []string, client *action.Install, cfg *action.Configuration, valueOpts *values.Options, out io.Writer) (*release.Release, error) {
debug("Original chart version: %q", client.Version)
if client.Version == "" && client.Devel {
debug("setting version to >0.0.0-0")
@ -227,6 +227,7 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options
Keyring: client.ChartPathOptions.Keyring,
SkipUpdate: false,
Getters: p,
RegistryClient: cfg.RegistryClient,
RepositoryConfig: settings.RepositoryConfig,
RepositoryCache: settings.RepositoryCache,
Debug: settings.Debug,

@ -79,7 +79,7 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client.ClientOnly = !validate
client.APIVersions = chartutil.VersionSet(extraAPIs)
client.IncludeCRDs = includeCrds
rel, err := runInstall(args, client, valueOpts, out)
rel, err := runInstall(args, client, cfg, valueOpts, out)
if err != nil && !settings.Debug {
if rel != nil {

@ -118,7 +118,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
instClient.Description = client.Description
instClient.DependencyUpdate = client.DependencyUpdate
rel, err := runInstall(args, instClient, valueOpts, out)
rel, err := runInstall(args, instClient, cfg, valueOpts, out)
if err != nil {
return err
}
@ -159,6 +159,7 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
Keyring: client.ChartPathOptions.Keyring,
SkipUpdate: false,
Getters: p,
RegistryClient: cfg.RegistryClient,
RepositoryConfig: settings.RepositoryConfig,
RepositoryCache: settings.RepositoryCache,
Debug: settings.Debug,

Loading…
Cancel
Save