helm / chart-releaser

Hosting Helm Charts via GitHub Pages and Releases
Apache License 2.0
664 stars 107 forks source link

Subcharts referenced via OCI registry fail to package #225

Closed bartlettc22 closed 1 year ago

bartlettc22 commented 1 year ago

This issue occus when a chart has a dependent OCI registry chart, for example

apiVersion: v2
name: my-chart
...
dependencies:
- name: my-subchart
  version: 0.2.0
  repository: oci://my-registry.com/helm

When running cr package on this chart, it results in a seg fault:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1ebd2c2]

goroutine 1 [running]:
helm.sh/helm/v3/pkg/registry.(*Client).Pull(0x0, {0xc00108e786?, 0xc001b6b4a0?}, {0x0, 0x0, 0x3?})
        /github.com/helm/chart-releaser/vendor/helm.sh/helm/v3/pkg/registry/client.go:304 +0x482
helm.sh/helm/v3/pkg/getter.(*OCIGetter).get(0xc001b6b4c0?, {0xc00108e780, 0x44})
        /github.com/helm/chart-releaser/vendor/helm.sh/helm/v3/pkg/getter/ocigetter.go:53 +0x274
helm.sh/helm/v3/pkg/getter.(*OCIGetter).Get(0xc0010d00b0, {0xc00108e780, 0x44}, {0xc001087980, 0x6, 0x4?})
        /github.com/helm/chart-releaser/vendor/helm.sh/helm/v3/pkg/getter/ocigetter.go:36 +0x6f
helm.sh/helm/v3/pkg/downloader.(*ChartDownloader).DownloadTo(0xc001b6b8e8, {0xc00108e460, 0x3e}, {0xc00108e49f?, 0x1?}, {0xc000f07a40, 0x3d})
        /github.com/helm/chart-releaser/vendor/helm.sh/helm/v3/pkg/downloader/chart_downloader.go:100 +0xea
helm.sh/helm/v3/pkg/downloader.(*Manager).downloadAll(0xc000616870, {0xc0003ada00?, 0x2, 0x4})
        /github.com/helm/chart-releaser/vendor/helm.sh/helm/v3/pkg/downloader/manager.go:356 +0xeba
helm.sh/helm/v3/pkg/downloader.(*Manager).Build(0xc000616870)
        /github.com/helm/chart-releaser/vendor/helm.sh/helm/v3/pkg/downloader/manager.go:145 +0x373
github.com/helm/chart-releaser/pkg/packager.(*Packager).CreatePackages(0xc001b6bd38)
        /github.com/helm/chart-releaser/pkg/packager/packager.go:92 +0x5c5
github.com/helm/chart-releaser/cr/cmd.glob..func2(0x346d980?, {0xc00052f1c0?, 0x1?, 0x1?})
        /github.com/helm/chart-releaser/cr/cmd/package.go:45 +0x150
github.com/spf13/cobra.(*Command).execute(0x346d980, {0xc00052f120, 0x1, 0x1})
        /github.com/helm/chart-releaser/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x346dc60)
        /github.com/helm/chart-releaser/vendor/github.com/spf13/cobra/command.go:1040 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /github.com/helm/chart-releaser/vendor/github.com/spf13/cobra/command.go:968
github.com/helm/chart-releaser/cr/cmd.Execute()
        /github.com/helm/chart-releaser/cr/cmd/root.go:35 +0x25
main.main()
        /github.com/helm/chart-releaser/cr/main.go:20 +0x17
kingdonb commented 1 year ago

Are there any other blockers that you know to supporting OCI umbrella charts, or OCI charts as dependencies?

I've been tracking:

I don't think it's a technical issue but a people/programmer-hours issue at this point, but I really think this is the last single stone that needs to move across the board so that OCI support in Helm can begin to become mainstream. 🎉 thanks for taking a look at it from this angle already!

bartlettc22 commented 1 year ago

@kingdonb This is the only issue we ran into regarding OCI charts as dependencies. With that said, in our CI, we simply have a followup step that runs helm push based on the packages built by cr package. It would be fantastic if cr supported parameters to push to OCI registries natively and I agree, I don't think there's any technical blockers. If I get a chance I'll take a look but can't promise anything.