From 5bc0cc65562970e003e0ef0dcd3a5a3bcfb255f5 Mon Sep 17 00:00:00 2001 From: Ingo Gottwald Date: Wed, 16 Oct 2024 14:47:10 +0200 Subject: [PATCH] doks: fix panic during create If a user creates a DOKS cluster through doctl and deletes it through some other means while doctl is waiting for the creation the command panics. This fixes the panic and returns an appropriate error. --- commands/kubernetes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/kubernetes.go b/commands/kubernetes.go index 975b59ae5..f005e4f86 100644 --- a/commands/kubernetes.go +++ b/commands/kubernetes.go @@ -764,6 +764,9 @@ func (s *KubernetesCommandService) RunKubernetesClusterCreate(defaultNodeSize st if err != nil { warn("Cluster couldn't enter `running` state: %v", err) } + if cluster == nil { + return errors.New("cluster vanished while waiting for creation") + } } if update {