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

Error interface conversion #22

Open
fferraro87 opened this issue Jul 26, 2021 · 4 comments
Open

Error interface conversion #22

fferraro87 opened this issue Jul 26, 2021 · 4 comments

Comments

@fferraro87
Copy link

Hi,
i've installed rback as kubectl plugin so i've launch :

root@061-ildm ~]# kubectl rback -n gateway
panic: interface conversion: interface {} is nil, not []interface {}

goroutine 1 [running]:
main.toRole(0xc000326f90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/hausenbl/go/src/github.com/mhausenblas/rback/parse.go:95 +0x51a
main.(*Rback).parseRBAC(0xc00028fec8, 0x53c180, 0xc00000e010, 0xc000046250, 0x1)
        /Users/hausenbl/go/src/github.com/mhausenblas/rback/parse.go:56 +0x46d
main.main()
        /Users/hausenbl/go/src/github.com/mhausenblas/rback/main.go:45 +0xf6

why i've that error?

@mhausenblas
Copy link
Member

@fferraro87 does the namespace gateway exist? Can you paste the output of the following command please:

kubectl get ns

@fferraro87
Copy link
Author

yes it exists.

root@061-ildm ~]# kubectl get ns
NAME                   STATUS   AGE
anter                  Active   481d
cattle-system          Active   67d
default                Active   481d
fencing                Active   133d
fleet-system           Active   67d
gateway                Active   481d
kube-node-lease        Active   481d
kube-public            Active   481d
kube-system            Active   481d
kubernetes-dashboard   Active   130d
prometheus             Active   203d

@mhausenblas
Copy link
Member

Thanks for confirming! And one more thing: you have sufficient permissions, yes? As in: when you do, for example:

kubectl -n gateway get roles,clusterroles 

… you see some results?

@mimmus
Copy link

mimmus commented Feb 22, 2022

Similar problem for me:

$ kubectl get sa,roles,rolebindings,clusterroles,clusterrolebindings --all-namespaces -o json | rback
panic: interface conversion: interface {} is nil, not []interface {}

goroutine 1 [running]:
main.toRole(0xc0006defc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /Users/hausenbl/go/src/github.com/mhausenblas/rback/parse.go:95 +0x51a
main.(*Rback).parseRBAC(0xc00007dec8, 0x53c180, 0xc00000e010, 0xc000010270, 0x1)
        /Users/hausenbl/go/src/github.com/mhausenblas/rback/parse.go:56 +0x46d
main.main()
        /Users/hausenbl/go/src/github.com/mhausenblas/rback/main.go:45 +0xf6

Command:
kubectl get sa,roles,rolebindings,clusterroles,clusterrolebindings --all-namespaces -o json
works.

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

3 participants