Skip to content

Commit 759fcb7

Browse files
committed
Also check /run/WSL file does not exist
1 parent d3066b2 commit 759fcb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hooks/_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function common::get_cpu_num {
209209
local -r wslinterop_path="/proc/sys/fs/binfmt_misc/WSLInterop"
210210

211211
if [[ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us &&
212-
(! -f "${wslinterop_path}" && ! -f "${wslinterop_path}-late") ]]; then # WSL has cfs_quota_us, but WSL should be checked as usual Linux host
212+
(! -f "${wslinterop_path}" && ! -f "${wslinterop_path}-late" && ! -f "/run/WSL") ]]; then # WSL has cfs_quota_us, but WSL should be checked as usual Linux host
213213
# Inside K8s pod or DinD in K8s
214214
cpu_quota=$(< /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
215215
cpu_period=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us 2> /dev/null || echo "$cpu_quota")

0 commit comments

Comments
 (0)