Skip to content

fix(kubectl): prevent panic in IsMinikubeKubernetes on plain string extensions#3269

Open
AruneshDwivedi wants to merge 1 commit into
devspace-sh:mainfrom
AruneshDwivedi:fix/minikube-extensions-panic
Open

fix(kubectl): prevent panic in IsMinikubeKubernetes on plain string extensions#3269
AruneshDwivedi wants to merge 1 commit into
devspace-sh:mainfrom
AruneshDwivedi:fix/minikube-extensions-panic

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Problem

devspace build panics with reflect.Set: value of type string is not assignable to type map[string]interface {} when the kubeconfig contains extensions with plain string values (e.g. from Teleport).

Root Cause

In IsMinikubeKubernetes, runtime.DefaultUnstructuredConverter.ToUnstructured(extension) is called on each cluster extension. When an extension contains a plain string value (not a map), ToUnstructured returns a string instead of map[string]interface{}. The subsequent ext["provider"].(string) map index operation panics.

Fix

Add a type assertion check: if the converted value is not a map[string]interface{}, skip it with continue. Non-map extensions cannot contain a provider field anyway, so skipping is safe.

Testing

Manually verified with a kubeconfig containing:

clusters:
- cluster:
    extensions:
    - name: teleport
      extension: "some-string-value"

Previously panicked. Now correctly returns false.

Fixes #3218

…xtensions

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 devspace-sh#3218

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for devspace-docs canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit dbe3125
🔍 Latest deploy log https://app.netlify.com/projects/devspace-docs/deploys/6a28e1a2fef87f0008bc1374

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

Successfully merging this pull request may close these issues.

Panic in IsMinikubeKubernetes when kubeconfig extensions contain plain string values

1 participant