aca / go-kubectx

5x-10x faster alternative to kubectx. Uses client-go.
134 stars 3 forks source link

Error when use auth provider #8

Open stamm opened 4 years ago

stamm commented 4 years ago

I use auth provider to get token. And sometimes I got an error, when I need to refresh token kubens test

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

goroutine 1 [running]:
k8s.io/client-go/plugin/pkg/client/auth/oidc.(*oidcAuthProvider).idToken(0xc000395d40, 0x0, 0x0, 0x0, 0x0)
        /home/rok/pkg/mod/k8s.io/client-go@v0.0.0-20200124032437-bccad466ab89/plugin/pkg/client/auth/oidc/oidc.go:282 +0x6fb
k8s.io/client-go/plugin/pkg/client/auth/oidc.(*roundTripper).RoundTrip(0xc0003c4be0, 0xc000374400, 0x1fab4d7, 0xa, 0xc0003e2620)
        /home/rok/pkg/mod/k8s.io/client-go@v0.0.0-20200124032437-bccad466ab89/plugin/pkg/client/auth/oidc/oidc.go:200 +0x7c
k8s.io/client-go/transport.(*userAgentRoundTripper).RoundTrip(0xc0003c4c00, 0xc000374300, 0xc0003c4c00, 0xbf866caaada48648, 0x12db73060)
        /home/rok/pkg/mod/k8s.io/client-go@v0.0.0-20200124032437-bccad466ab89/transport/round_trippers.go:159 +0x1c0
net/http.send(0xc000374200, 0x2146e60, 0xc0003c4c00, 0xbf866caaada48648, 0x12db73060, 0x2a9ad80, 0xc00013c5b0, 0xbf866caaada48648, 0x1, 0x0)
        /home/rok/.asdf/installs/golang/1.13.2/go/src/net/http/client.go:250 +0x43a
net/http.(*Client).send(0xc0003b2840, 0xc000374200, 0xbf866caaada48648, 0x12db73060, 0x2a9ad80, 0xc00013c5b0, 0x0, 0x1, 0x0)
        /home/rok/.asdf/installs/golang/1.13.2/go/src/net/http/client.go:174 +0xfa
net/http.(*Client).do(0xc0003b2840, 0xc000374200, 0x0, 0x0, 0x0)
        /home/rok/.asdf/installs/golang/1.13.2/go/src/net/http/client.go:641 +0x3ce
net/http.(*Client).Do(...)
        /home/rok/.asdf/installs/golang/1.13.2/go/src/net/http/client.go:509
k8s.io/client-go/rest.(*Request).request(0xc0003765a0, 0xc0001099b0, 0x0, 0x0)
        /home/rok/pkg/mod/k8s.io/client-go@v0.0.0-20200124032437-bccad466ab89/rest/request.go:801 +0x3e9
k8s.io/client-go/rest.(*Request).Do(0xc0003765a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/rok/pkg/mod/k8s.io/client-go@v0.0.0-20200124032437-bccad466ab89/rest/request.go:878 +0xd8
k8s.io/client-go/kubernetes/typed/core/v1.(*namespaces).List(0xc00039bd50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/rok/pkg/mod/k8s.io/client-go@v0.0.0-20200124032437-bccad466ab89/kubernetes/typed/core/v1/namespace.go:86 +0x179
main.kubens(0x7ffeefbff8e7, 0x3, 0x4ca8, 0xc00013e060)
        /home/rok/src/github.com/aca/go-kubectx/cmd/kubens/main.go:96 +0xfc
main.main()
        /home/rok/src/github.com/aca/go-kubectx/cmd/kubens/main.go:77 +0x406