Kubectl fdb plugin panics on analyzing clusters that are not found

The fdb plugin for kubectl panics if the cluster is not found.

$ kubectl fdb analyze -n mynamespave non-existing-cluster

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

goroutine 1 [running]:
github.com/FoundationDB/fdb-kubernetes-operator/kubectl-fdb/cmd.analyzeCluster(0x1c?, {0x101ac6ab0, 0xc0001a0070}, 0x0, 0x0, 0x1, {0x10286f920, 0x0, 0x100013750?}, 0x1)
	/Some/where/go/pkg/mod/github.com/!foundation!d!b/fdb-kubernetes-operator@v1.19.0/kubectl-fdb/cmd/analyze.go:224 +0x83
github.com/FoundationDB/fdb-kubernetes-operator/kubectl-fdb/cmd.newAnalyzeCmd.func1(0xc0002a2300?, {0xc0003dfec0, 0x1, 0x3?})
	/Some/where/go/pkg/mod/github.com/!foundation!d!b/fdb-kubernetes-operator@v1.19.0/kubectl-fdb/cmd/analyze.go:140 +0x830
github.com/spf13/cobra.(*Command).execute(0xc0002a2300, {0xc0003dfe60, 0x3, 0x3})
	/Some/where/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000004c00)
	/Some/where/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(0x101aa9b80?)
	/Some/where/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968 +0x19
main.main()

I have fixed this in a fork of the operator : Fix panic caused by analyzing a cluster that is not found by masih · Pull Request #1 · masih/fdb-kubernetes-operator · GitHub

But I am unable to open a PR against the original repo due to permission restrictions. It seems even bug reporting is restricted. I am curious why limit open source contributions?

Thanks for reporting the issue and fixing the bug, I’ll take a look tomorrow.

I am curious why limit open source contributions?

See: Contributing to FDB Operator - PRs limited to collaborators