Skip to content

Commit 6320909

Browse files
committed
drop controller_version switch case
1 parent 42c2b6a commit 6320909

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

bin/util/cgroups.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,7 @@ cgroup_util_read_cgroup_memory_limit() {
169169
[[ -n ${CGROUP_UTIL_VERBOSE-} ]] && echo "Reading cgroup v${controller_version} limit from '${location}'" >&2
170170

171171
local limit
172-
case "$controller_version" in
173-
1)
174-
limit=$(cgroup_util_read_cgroupv1_memory_limit "$location") || return
175-
;;
176-
2)
177-
limit=$(cgroup_util_read_cgroupv2_memory_limit "$location") || return
178-
;;
179-
*)
180-
echo "Internal error: invalid cgroup controller version '${controller_version}'" >&2
181-
return 1
182-
;;
183-
esac
172+
limit=$(cgroup_util_read_cgroupv"$controller_version"_memory_limit "$location") || return
184173

185174
if (( maximum > 0 && limit <= maximum )); then
186175
echo "$limit"

0 commit comments

Comments
 (0)