ceph-csi/internal
Artur Troian 16ec97d8f7 util: getCgroupPidsFile produces striped path when extra : present
This commit uses `string.SplitN` instead of `string.Split`.
The path for pids.max has extra `:` symbols in it due to which
getCgroupPidsFile() splits the string into 5 tokens instead of
3 leading to loss of part of the path.
As a result, the below error is reported:
`Failed to get the PID limit, can not reconfigure: open
/sys/fs/cgroup/pids/system.slice/containerd.service/
kubepods-besteffort-pod183b9d14_aed1_4b66_a696_da0c738bc012.slice/pids.max:
no such file or directory`
SplitN takes an argument n and splits the string
accordingly which helps us to get the desired
file path.

Fixes: #2337

Co-authored-by: Yati Padia <ypadia@redhat.com>
Signed-off-by: Yati Padia <ypadia@redhat.com>
2021-08-03 06:03:10 +00:00
..
cephfs cleanup: modifies the error caused due to merged PRs 2021-07-22 18:15:48 +00:00
controller cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
csi-common cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
journal cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
liveness cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
rbd rbd: use rados namespace for manager command 2021-07-28 03:48:33 +00:00
util util: getCgroupPidsFile produces striped path when extra : present 2021-08-03 06:03:10 +00:00