Skip to content

Conversation

@spowelljr
Copy link
Member

@spowelljr spowelljr commented Mar 4, 2021

Closes #10689

Removed WSLENV empty check from IsMicrosoftWSL due to Windows Terminal setting the variable outside of WSL.

#10711 (comment)

We have code that tries to detect if we're trying to run a Windows executable within a WSL shell, which should be running a Linux binary. The most reliable way to do that is to check environment variables that WSL sets. Unfortunately, one of the 3 variables we picked (WSLENV) is set by Windows Terminal, outside of WSL, as a way of carrying data across connections. This is causing some Windows users to not be able to use minikube in a valid config.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 4, 2021
@k8s-ci-robot k8s-ci-robot requested review from RA489 and prezha March 4, 2021 00:48
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 4, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@tstromberg
Copy link
Contributor

tstromberg commented Mar 4, 2021

Closes #10689

Removed WSLENV empty check from IsMicrosoftWSL due to Windows Terminal setting the variable outside of WSL.

Could you add more detail to the PR description?

I don't quite understand the problem that is being solved, and why this is the best approach to fix it.

@sharifelgamal
Copy link
Contributor

We have code that tries to detect if we're trying to run a Windows executable within a WSL shell, which should be running a Linux binary. The most reliable way to do that is to check environment variables that WSL sets. Unfortunately, one of the 3 variables we picked (WSLENV) can be set in Powershell, outside of WSL, as a way of carrying data across connections. This is causing some Windows users to not be able to use minikube in a valid config.

@medyagh
Copy link
Member

medyagh commented Mar 4, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 4, 2021
@minikube-pr-bot
Copy link

kvm2 Driver
error collecting results for kvm2 driver: timing run 0 with Minikube (PR 10711): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/10711/minikube start --driver=kvm2]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/10711/minikube: exec format error
docker Driver
error collecting results for docker driver: timing run 0 with Minikube (PR 10711): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/10711/minikube start --driver=docker]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/10711/minikube: exec format error

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just built this for Windows and can confirm this fixes the issue.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: NatsumiHB, spowelljr
To complete the pull request process, please assign medyagh after the PR has been reviewed.
You can assign the PR to them by writing /assign @medyagh in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@medyagh medyagh merged commit 9aee24b into kubernetes:master Mar 4, 2021
@spowelljr spowelljr deleted the fixWSLDetection branch June 28, 2021 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows MK_WRONG_BINARY_WSL even when not in powershell

7 participants