From dbe31255cb99d0c2b4e8a586a48b4a7a1471d775 Mon Sep 17 00:00:00 2001 From: Arunesh Dwivedi Date: Wed, 10 Jun 2026 03:54:35 +0000 Subject: [PATCH] fix(kubectl): prevent panic in IsMinikubeKubernetes on plain string extensions When kubeconfig extensions contain plain string values (e.g. from Teleport), runtime.DefaultUnstructuredConverter.ToUnstructured returns a string instead of map[string]interface{}. The subsequent map index operation panics with 'reflect.Set: value of type string is not assignable to type map[string]interface {}'. Fix: check that the converted value is actually a map before accessing it. Non-map extensions are skipped. Fixes #3218 Signed-off-by: Arunesh Dwivedi --- pkg/devspace/kubectl/util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/devspace/kubectl/util.go b/pkg/devspace/kubectl/util.go index 9b363a696..5fb293ed2 100644 --- a/pkg/devspace/kubectl/util.go +++ b/pkg/devspace/kubectl/util.go @@ -257,7 +257,11 @@ func IsMinikubeKubernetes(kubeClient Client) bool { for _, extension := range clusters.Extensions { ext, err := runtime.DefaultUnstructuredConverter.ToUnstructured(extension) if err == nil { - if provider, ok := ext["provider"].(string); ok { + extMap, ok := ext.(map[string]interface{}) + if !ok { + continue + } + if provider, ok := extMap["provider"].(string); ok { if provider == minikubeProvider { return true }