From 5a8e011db9cb7d4c279105d358c7edbba49b4976 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 17 May 2022 20:09:10 +0300 Subject: [PATCH] fix: match for WSL platform in case-insentive way ``` $ cat /proc/sys/kernel/osrelease 4.19.128-microsoft-standard ``` Signed-off-by: Andrey Smirnov --- pkg/provision/providers/docker/docker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/provision/providers/docker/docker.go b/pkg/provision/providers/docker/docker.go index af5a297900..88eb8d3c93 100644 --- a/pkg/provision/providers/docker/docker.go +++ b/pkg/provision/providers/docker/docker.go @@ -108,7 +108,7 @@ func (p *provisioner) GetFirstInterface() string { func detectWSL() bool { // "Official" way of detecting WSL https://github.com/Microsoft/WSL/issues/423#issuecomment-221627364 contents, err := os.ReadFile("/proc/sys/kernel/osrelease") - if err == nil && (bytes.Contains(contents, []byte("Microsoft")) || bytes.Contains(contents, []byte("WSL"))) { + if err == nil && (bytes.Contains(bytes.ToLower(contents), []byte("microsoft")) || bytes.Contains(bytes.ToLower(contents), []byte("wsl"))) { return true }