Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crictl allow setting grace period for stop containers upon reset #10651

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roles/reset/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ reset_restart_network_service_name: >-
{%- elif ansible_os_family == "Debian" -%}
networking
{%- endif %}

# crictl stop container grace period
cri_stop_containers_grace_period: 0
2 changes: 1 addition & 1 deletion roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
register: crictl

- name: Reset | stop all cri containers
shell: "set -o pipefail && {{ bin_dir }}/crictl ps -q | xargs -r {{ bin_dir }}/crictl -t 60s stop"
shell: "set -o pipefail && {{ bin_dir }}/crictl ps -q | xargs -r {{ bin_dir }}/crictl -t 60s stop -t {{ cri_stop_containers_grace_period }}"
args:
executable: /bin/bash
register: remove_all_cri_containers
Expand Down