little-angry-clouds / kubernetes-binaries-managers

Kubernetes related binaries manager.
GNU General Public License v3.0
101 stars 11 forks source link

helmenv remote list panic #10

Closed dsiebel closed 4 years ago

dsiebel commented 4 years ago

Running freshly installed (via brew) helmenv list remote to get a list of available helm versions it throws a panic with "index out of range":

$ helmenv list remote --all-releases
panic: runtime error: index out of range [2] with length 1

goroutine 1 [running]:
github.com/little-angry-clouds/kubernetes-binaries-managers/internal/helpers.GetLastPage(0x0, 0x0, 0x4, 0x0, 0x0)
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/internal/helpers/helpers.go:59 +0x187
github.com/little-angry-clouds/kubernetes-binaries-managers/internal/versions.GetRemoteVersions(0x158ea8f, 0x42, 0x0, 0x0, 0x0, 0x0, 0x0)
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/internal/versions/versions.go:96 +0x19c
github.com/little-angry-clouds/kubernetes-binaries-managers/internal/cmd.remote(0x1a0dee0, 0xc000067940, 0x0, 0x1)
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/internal/cmd/remote.go:27 +0x4e
github.com/spf13/cobra.(*Command).execute(0x1a0dee0, 0xc000067930, 0x1, 0x1, 0x1a0dee0, 0xc000067930)
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/.brew_home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x1a151c0, 0x1099dea, 0xc00007f860, 0x1)
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/.brew_home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/.brew_home/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
github.com/little-angry-clouds/kubernetes-binaries-managers/internal/cmd.Execute()
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/internal/cmd/root.go:17 +0x31
main.main()
        /private/tmp/helmenv-20200619-24865-a0fyo3/kubernetes-binaries-managers-0.1.0/cmd/helmenv/main.go:21 +0x13d

Helmenv brew info:

$ brew info helmenv
little-angry-clouds/my-brews/helmenv: stable 0.1.0
Helm version manager inspired by tfenv
https://github.com/little-angry-clouds/kubernetes-binaries-managers/
/usr/local/Cellar/helmenv/0.1.0 (7 files, 15.9MB) *
  Built from source on 2020-06-19 at 09:36:57
From: https://github.com/little-angry-clouds/homebrew-my-brews/blob/master/Formula/helmenv.rb
==> Dependencies
Build: go ✔

Golang version:

$ go version
go version go1.14.3 darwin/amd64

Local list, installing versions and switching works fine, though.

alexppg commented 4 years ago

Hey! Thanks for reporting. Pretty weird, the tests are all passed. It might be related to your OS, but that would be odd. Let me see if I can test it.

romancin commented 4 years ago

No problem here in macOS Catalina 10.15.5 with brew:

Captura de pantalla 2020-06-20 a las 22 15 37

Which OS are you using @dsiebel ?

alexppg commented 4 years ago

Could you please execute the next command and paste the output?

curl https://api.github.com/repos/kubernetes/kubernetes/releases?per_page=100
alexppg commented 4 years ago

I'll just close the issue assuming it's all working as expected. I've controlled the error you were probably seeing in https://github.com/little-angry-clouds/kubernetes-binaries-managers/pull/14. Feel free to reopen if you upgrade and still having this issue!

dsiebel commented 4 years ago

@alexppg jep, all good, thanks!