Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nil pointer dereference to Manager.out when performing dependency update #64

Open
KKatev-reasonance opened this issue Mar 9, 2022 · 0 comments

Comments

@KKatev-reasonance
Copy link

Problem

I am trying to deploy a chart with external dependencies defined in its chart.yaml. When setting DependencyUpdate: true in the chart spec, the following nil pointer error occurs:

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

goroutine 111 [running]:
fmt.Fprintln({0x0, 0x0}, {0xc009729ad8, 0x1, 0x1})
        /usr/local/go/src/fmt/print.go:265 +0x54
helm.sh/helm/v3/pkg/downloader.(*Manager).UpdateRepositories(0xc0037166c0)
        /go/pkg/mod/helm.sh/helm/[email protected]/pkg/downloader/manager.go:653 +0x96
helm.sh/helm/v3/pkg/downloader.(*Manager).Update(0xc0037166c0)
        /go/pkg/mod/helm.sh/helm/[email protected]/pkg/downloader/manager.go:188 +0xb4
github.com/mittwald/go-helm-client.(*HelmClient).install(0xc001ab3140, {0x28251f8, 0xc0000580a0}, 0xc002a10140)
        /go/pkg/mod/github.com/mittwald/[email protected]/client.go:293 +0x4ad
github.com/mittwald/go-helm-client.(*HelmClient).InstallOrUpgradeChart(0x259e5e3, {0x28251f8, 0xc0000580a0}, 0xc001a925d0)
        /go/pkg/mod/github.com/mittwald/[email protected]/client.go:206 +0x7a

Context

go.mod requirements:

require (
	github.com/mittwald/go-helm-client v0.9.0
	gopkg.in/yaml.v2 v2.4.0
	helm.sh/helm/v3 v3.8.0
	k8s.io/client-go v0.23.1
)

The deployed chart is the official gitea helm chart, which has several references to the bitnami repository.

Cause and a quick fix

The cause of this error seems to be the initialzation of downloader.Manager in client.go:285, where Out is not set. Manager.Out is used in the standard Helm package for writing simple output when checking for dependencies. I circumvented the issue by declaring a bytes.Buffer variable and setting Manager.Out to it, though I suspect one would want an implementation-specific io.writer in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant