Skip to content

Commit 9bd7a26

Browse files
fix: suppress unnecessary error
Co-authored-by: George L. Yermulnik <[email protected]>
1 parent b426613 commit 9bd7a26

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
@@ -204,7 +204,7 @@ function common::get_cpu_num {
204204
! -f /proc/sys/fs/binfmt_misc/WSLInterop ]]; then # WSL have cfs_quota_us, but WSL should be checked as usual Linux host
205205
# Inside K8s pod or DinD in K8s
206206
cpu_quota=$(< /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
207-
cpu_period=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us || echo "$cpu_quota")
207+
cpu_period=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us 2> /dev/null || echo "$cpu_quota")
208208

209209
if [[ $cpu_quota -eq -1 || $cpu_period -lt 1 ]]; then
210210
# K8s no limits or in DinD

0 commit comments

Comments
 (0)