Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/plugins/helm/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ func (p *createAPISubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdM

$ %[1]s create api \
--helm-chart=/path/to/local/chart-archives/app-1.2.3.tgz

$ %[1]s create api \
--helm-chart=oci://charts.mycompany.com/example-namespace/app:1.2.3
`, cliMeta.CommandName)
}

Expand Down
16 changes: 16 additions & 0 deletions internal/plugins/helm/v1/chartutil/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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/repo"
)

Expand Down Expand Up @@ -126,11 +127,19 @@ func LoadChart(opts Options) (*chart.Chart, error) {
func downloadChart(destDir string, opts Options) (string, error) {
settings := cli.New()
getters := getter.All(settings)

// Create registry client for OCI registry support
registryClient, err := registry.NewClient()
if err != nil {
return "", fmt.Errorf("failed to create registry client: %w", err)
}

c := downloader.ChartDownloader{
Out: os.Stderr,
Getters: getters,
RepositoryConfig: settings.RepositoryConfig,
RepositoryCache: settings.RepositoryCache,
RegistryClient: registryClient,
}

if opts.Repo != "" {
Expand Down Expand Up @@ -182,13 +191,20 @@ func fetchChartDependencies(chartPath string) error {
settings := cli.New()
getters := getter.All(settings)

// Create registry client for OCI registry support
registryClient, err := registry.NewClient()
if err != nil {
return fmt.Errorf("failed to create registry client: %w", err)
}

out := &bytes.Buffer{}
man := &downloader.Manager{
Out: out,
ChartPath: chartPath,
Getters: getters,
RepositoryConfig: settings.RepositoryConfig,
RepositoryCache: settings.RepositoryCache,
RegistryClient: registryClient,
}
if err := man.Build(); err != nil {
fmt.Println(out.String())
Expand Down
Loading