Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #4279 Fix case sensitive WSL2 validation check #1

Closed

Conversation

alegacy
Copy link
Owner

@alegacy alegacy commented Jul 23, 2024

Fixes: Issue crc-org#4279

Relates to: Issue crc-org#2131, PR crc-org#2323

Solution/Idea

Enhancing WSL validation check to be case-insensitive to prevent users from attempting to run on an unsupported platform.

Proposed changes

Updated validation check to force toLower(...) on the output of /proc/version prior to searching for the target substring of microsoft.

Testing

Validation check now prevents running on systems running WSL regardless of the capitalization of the word Microsoft.

alegacy@localhost:~/src/go/github.com/crc$ ./out/crc setup
INFO Using bundle path /home/alegacy/.crc/cache/crc_libvirt_0.0.0-unset_amd64.crcbundle 
INFO Checking if running as non-root              
INFO Checking if running inside WSL2              
CRC is unsupported using WSL2

alegacy@localhost:~/src/go/github.com/crc$ cat /proc/version
Linux version 5.15.153.1-microsoft-standard-WSL2 (root@941d701f84f1) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Fri Mar 29 23:14:13 UTC 2024

The WSL validation check assumes that the name "Microsoft" is
capitalized but this is not true in all cases.

Signed-off-by: Allain Legacy <[email protected]>
@alegacy alegacy self-assigned this Jul 23, 2024
@alegacy alegacy marked this pull request as ready for review July 23, 2024 11:28
@alegacy alegacy closed this Jul 23, 2024
@alegacy
Copy link
Owner Author

alegacy commented Jul 23, 2024

IDE created pull request to the fork instead of the main repo ... closing.

@alegacy alegacy deleted the bugfix/4279/fix-case-sensitive-validation-check branch July 24, 2024 11:08
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.

1 participant