We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
common::get_cpu_num
1 parent 89f4561 commit 040b977Copy full SHA for 040b977
1 file changed
hooks/_common.sh
@@ -199,8 +199,9 @@ function common::get_cpu_num {
199
200
local millicpu
201
202
- if [[ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us ]]; then
203
- # Inside K8s pod or DinD in K8s
+ if [[ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us &&
+ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ]]; then
204
+ # Inside K8s pod or DinD in K8s (but not inside WSL)
205
millicpu=$(< /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
206
207
if [[ $millicpu -eq -1 ]]; then
0 commit comments