cluster-api: clusterctl describe cluster throws nil pointer exception is cluster is still provisioning
What steps did you take and what happened:
- create a cluster
- quickly run
clusterctl describe cluster
$ clusterctl describe cluster sample
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1436dd9]
goroutine 1 [running]:
sigs.k8s.io/cluster-api/util.UnstructuredUnmarshalField(0x0, {0x1992d20, 0xc0008720d8}, {0xc0009174e8, 0x2, 0x2})
sigs.k8s.io/cluster-api/util/util.go:407 +0x59
sigs.k8s.io/cluster-api/util/conditions.(*unstructuredWrapper).GetConditions(0xc000114a88)
sigs.k8s.io/cluster-api/util/conditions/unstructured.go:55 +0x99
sigs.k8s.io/cluster-api/util/conditions.Get({0x1ef77b8, 0xc000114a88}, {0x1bcf97e, 0x5})
sigs.k8s.io/cluster-api/util/conditions/getter.go:39 +0x35
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree.GetReadyCondition({0x1ef6720, 0x0})
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree/util.go:36 +0xb6
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree.ObjectTree.Add({{0x1ef6848, 0xc0001d48c0}, {{0x0, 0x0}, 0x0, 0x0, 0x1}, 0xc000711230, 0xc000711380}, {0x1ef6720, ...}, ...)
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree/tree.go:85 +0xfa
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree.Discovery.func1({0x1ef6720, 0x0}, 0xc0007d1b00)
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree/discovery.go:91 +0x191
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree.Discovery({0x1e95af0, 0xc00005a218}, {0x1ecec78, 0xc000438850}, {0x1bd308b, 0x7}, {0x7ffef0d2f68e, 0x6}, {{0x0, 0x0}, ...})
sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree/discovery.go:108 +0x639
sigs.k8s.io/cluster-api/cmd/clusterctl/client.(*clusterctlClient).DescribeCluster(0xc0000ce9c0, {{{0x0, 0x0}, {0x0, 0x0}}, {0x1bd308b, 0x7}, {0x7ffef0d2f68e, 0x6}, {0x0, ...}, ...})
sigs.k8s.io/cluster-api/cmd/clusterctl/client/describe.go:82 +0x1c5
sigs.k8s.io/cluster-api/cmd/clusterctl/cmd.runDescribeCluster({0x7ffef0d2f68e, 0x6})
sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/describe_cluster.go:144 +0x198
sigs.k8s.io/cluster-api/cmd/clusterctl/cmd.glob..func5(0x2e82220, {0xc00048a610, 0x1, 0x1})
sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/describe_cluster.go:96 +0x2a
github.com/spf13/cobra.(*Command).execute(0x2e82220, {0xc00048a5f0, 0x1, 0x1})
github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0x2e847a0)
github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.2.1/command.go:902
sigs.k8s.io/cluster-api/cmd/clusterctl/cmd.Execute()
sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go:94 +0x25
main.main()
sigs.k8s.io/cluster-api/cmd/clusterctl/main.go:26 +0x17
What did you expect to happen:
No nil pointer exception
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]
Environment:
- Cluster-api version: v1.1.3
- Minikube/KIND version:
- Kubernetes version: (use
kubectl version):Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.4", GitCommit:"e6c093d87ea4cbb530a7b2ae91e54c0842d8308a", GitTreeState:"archive", BuildDate:"1980-01-01T00:00:00Z", GoVersion:"go1.17.7", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:52:18Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"} - OS (e.g. from
/etc/os-release):
/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (12 by maintainers)
I think we can close this given a lack of updates and assuming that it was fixed, as expected, by #6334
/close