Skip to content

Commit

Permalink
Add comments for --ulimit parameter.
Browse files Browse the repository at this point in the history
An example:

$ s2i_args="pull-policy=never --incremental -e DEV_MODE=true -v /var/lib/psql --ulimit nofile=4096:4096"
$ echo "$s2i_args" | grep -q '\--ulimit' && build_args=$(echo "$s2i_args" | grep -o -e '\--ulimit[[:space:]]\S*\w=*')
$ echo $build_args
--ulimit nofile=4096:4096

The second example:

$ s2i_args="pull-policy=never --incremental -e DEV_MODE=true -v /var/lib/psql --ulimit nofile=4096:4096 -v /etc"
$ echo "$s2i_args" | grep -q '\--ulimit' && build_args=$(echo "$s2i_args" | grep -o -e '\--ulimit[[:space:]]\S*\w=*')
$ echo $build_args
--ulimit nofile=4096:4096

Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek committed Mar 28, 2024
1 parent d4856a2 commit cb248e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,8 @@ EOF
# Check if -v parameter is present in s2i_args and add it into docker build command
read -ra mount_options <<< "$(echo "$s2i_args" | grep -o -e '\(-v\)[[:space:]]\.*\S*' || true)"

# Check if s2i_args contains --ulimit
# if so, add it into docker build command. The format is like --ulimit nofile=4096:4096
echo "$s2i_args" | grep -q '\--ulimit' && build_args=$(echo "$s2i_args" | grep -o -e '\--ulimit[[:space:]]\S*\w=*')
# Run the build and tag the result
ct_build_image_and_parse_id "$df_name" "${mount_options[*]+${mount_options[*]}} -t $dst_image . $build_args"
Expand Down

0 comments on commit cb248e0

Please sign in to comment.