chartmuseum / helm-push

Helm plugin to push chart package to ChartMuseum
Apache License 2.0
670 stars 170 forks source link

runtime error in run with some missing values for params or help #187

Closed czhujer closed 1 year ago

czhujer commented 1 year ago

Hi,

I tried compile latest version on this plugin (because v0.10.3 has several critical CVEs) and I see some strange behavior. Also I tested previous MR (175)

Behavior is same on our Gitlab CI runner (VM with ubuntu) or on my Macbook M2 (tested localy or over docker desktop).

first example:

$ ./bin/linux/amd64/helm-cm-push --help
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x270 pc=0x14ca666]

goroutine 1 [running]:
github.com/spf13/cobra.(*Command).ExecuteC(0xc000136010?)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:982 +0x26
github.com/spf13/cobra.(*Command).Execute(...)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
main.main()
    /home/devopsuser/helm-push/cmd/helm-cm-push/main.go:460 +0x53

second example:

bash-5.1$ ./bin/linux/amd64/helm-cm-push -v
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x270 pc=0x14ca666]

goroutine 1 [running]:
github.com/spf13/cobra.(*Command).ExecuteC(0xc000136010?)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:982 +0x26
github.com/spf13/cobra.(*Command).Execute(...)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
main.main()
    /home/devopsuser/helm-push/cmd/helm-cm-push/main.go:460 +0x53

I tried compile it with golang 1.20 and latest cobra version, but behavior is same.

Do you have any idea where can be issue?

Thanks Patrik

czhujer commented 1 year ago

looks like it's solved. thanks :)