diff --git a/cmd/mindthegap/create/bundle/bundle.go b/cmd/mindthegap/create/bundle/bundle.go index f2d69253..56d54730 100644 --- a/cmd/mindthegap/create/bundle/bundle.go +++ b/cmd/mindthegap/create/bundle/bundle.go @@ -400,7 +400,6 @@ func pullCharts( repoConfig.RepoURL, chartName, chartVersion, - []helm.ConfigOpt{helm.RegistryClientConfigOpt()}, opts..., ) if err != nil { diff --git a/helm/client.go b/helm/client.go index 7b112d24..54638b21 100644 --- a/helm/client.go +++ b/helm/client.go @@ -99,38 +99,18 @@ func CAFileOpt(caFile string) action.PullOpt { } } -type ConfigOpt func(*action.Configuration) error - -func RegistryClientConfigOpt(opts ...registry.ClientOption) ConfigOpt { - return func(cfg *action.Configuration) error { - cl, err := registry.NewClient(opts...) - if err != nil { - return fmt.Errorf("failed to create registry client: %w", err) - } - - cfg.RegistryClient = cl - - return nil +func CertFileOpt(certFile string) action.PullOpt { + return func(p *action.Pull) { + p.CertFile = certFile } } func (c *Client) GetChartFromRepo( outputDir, repoURL, chartName, chartVersion string, - configOpts []ConfigOpt, extraPullOpts ...action.PullOpt, ) (string, error) { cfg := &action.Configuration{Log: c.out.V(4).Infof} - if registry.IsOCI(chartName) { - configOpts = append([]ConfigOpt{RegistryClientConfigOpt()}, configOpts...) - } - - for _, f := range configOpts { - if err := f(cfg); err != nil { - return "", fmt.Errorf("failed to configure helm client: %w", err) - } - } - pull := action.NewPullWithOpts( append( extraPullOpts, diff --git a/test/e2e/helmbundle/helpers/helpers.go b/test/e2e/helmbundle/helpers/helpers.go index 8a03847b..e7f1fc0f 100644 --- a/test/e2e/helmbundle/helpers/helpers.go +++ b/test/e2e/helmbundle/helpers/helpers.go @@ -194,7 +194,6 @@ func ValidateChartIsAvailable( "", fmt.Sprintf("%s://%s:%d/charts/%s", helm.OCIScheme, addr, port, chartName), chartVersion, - []helm.ConfigOpt{helm.RegistryClientConfigOpt()}, pullOpts..., ) gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())