ceph-csi/internal/util
Artur Troian 82fd1e5248 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>
(cherry picked from commit 16ec97d8f7)
2021-08-04 07:11:26 +00:00
..
aws_metadata_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
aws_metadata.go cleanup: resolve godot linter 2021-07-13 06:50:03 +00:00
cephcmds.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
cephconf.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
conn_pool_test.go cleanup: modifies the error caused due to merged PRs 2021-07-22 18:15:48 +00:00
conn_pool.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
connection.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
credentials.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
crypto_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
crypto.go util: add helper functions for resize of encrypted volume 2021-07-23 10:00:23 +00:00
cryptsetup.go rbd: add support to expand encrypted volume 2021-07-23 10:00:23 +00:00
csiconfig_test.go cleanup: resolves gofumpt issues of internal codes 2021-07-14 19:50:56 +00:00
csiconfig.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
errors_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
errors.go cleanup: fix mispell words 2020-11-29 12:47:46 +05:30
httpserver.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
idlocker_test.go util: remove deleteLock test as it is enforced by the controller 2021-07-22 15:07:49 +00:00
idlocker.go util: remove the deleteLock acquistion check for clone and snapshot 2021-07-22 15:07:49 +00:00
k8s.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
kms_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
kms.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
log.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
pidlimit_test.go cleanup: resolves gofumpt issues of internal codes 2021-07-14 19:50:56 +00:00
pidlimit.go util: getCgroupPidsFile produces striped path when extra : present 2021-08-04 07:11:26 +00:00
secretskms_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
secretskms.go cleanup: modifies the error caused due to merged PRs 2021-07-22 18:15:48 +00:00
stripsecrets.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
topology_test.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
topology.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
util_test.go cleanup: resolves gofumpt issues of internal codes 2021-07-14 19:50:56 +00:00
util.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
validate.go cleanup: resolve nlreturn linter issues 2021-07-22 06:05:01 +00:00
vault_sa_test.go cleanup: modifies the error caused due to merged PRs 2021-07-22 18:15:48 +00:00
vault_sa.go util: make parseTenantConfig() usable for modular KMSs 2021-07-13 17:16:35 +00:00
vault_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
vault_tokens_test.go util: allow configuring VAULT_BACKEND for Vault connection 2021-07-22 13:02:47 +00:00
vault_tokens.go cleanup: resolves cyclop linter issue 2021-07-22 18:15:48 +00:00
vault.go cleanup: resolves cyclop linter issue 2021-07-22 18:15:48 +00:00
volid_test.go cleanup: addresses paralleltest linter 2021-06-25 11:55:12 +00:00
volid.go cleanup: resolves gofumpt issues of internal codes 2021-07-14 19:50:56 +00:00