Skip to content

pkg.skaffold.docker.newAPIClient ignores DetectMinikube flag #9883

@d-enk

Description

@d-enk
skaffold dev -v debug --detect-minikube=false 2>&1 | grep minikube
msg="Running command: [minikube version --output=json]" subtask=-1 task=DevLoop
msg="Command output: [{\"commit\":\"65318f4cfff9c12cc87ec9eb8f4cdd57b25047f3\",\"minikubeVersion\":\"v1.37.0\"}\n]" subtask=-1 task=DevLoop
msg="Minikube cluster detected: cluster certificate for context \"test\" found inside the minikube directory" subtask=-1 task=DevLoop
msg="Running command: [/home/linuxbrew/.linuxbrew/bin/minikube docker-env --shell none -p test --user=skaffold]" subtask=-1 task=DevLoop
msg="Command output: [SSH_AUTH_SOCK=/tmp/ssh-Zj6AhgVo2905/agent.2216632\nSSH_AGENT_PID=2216633\nDOCKER_HOST=ssh://[email protected]:32773\nMINIKUBE_ACTIVE_DOCKERD=test\n], stderr: ! Using the docker-env command with the containerd runtime is a highly experimental feature, please provide feedback or contribute to make it better\nIdentity added: /home/denk/.minikube/machines/test/id_rsa (/home/denk/.minikube/machines/test/id_rsa)\n" subtask=-1 task=DevLoop
msg="Using minikube docker daemon at ssh://[email protected]:32773" subtask=-1 task=DevLoop

It's just that the detect-minikube flag is not checked here

func newAPIClient(ctx context.Context, kubeContext string, minikubeProfile string) ([]string, client.CommonAPIClient, error) {
if minikubeProfile != "" { // skip validation if explicitly specifying minikubeProfile.
return newMinikubeAPIClient(ctx, minikubeProfile)
}
if cluster.GetClient().IsMinikube(ctx, kubeContext) {
return newMinikubeAPIClient(ctx, kubeContext)
}
return newEnvAPIClient()
}

How does this happen here

case opts.DetectMinikube:
local = cluster.GetClient().IsMinikube(ctx, kubeContext)

Based on common sense,
The current behavior is obviously wrong

I don't understand why it hasn't been fixed yet.

someone just started using kind

overrides minikube in $PATH

other try using rename hack
which should not work for 5 years as
because it is successfully detecting by the certificate.

related issues #5320 #5494 #5143

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions