Skip to content

Commit

Permalink
crictl allow setting grace period for stop containers upon reset (#10651
Browse files Browse the repository at this point in the history
)

* crictl allow setting different grace period for stop containers and pods

* correct grace period location
  • Loading branch information
noama-nv authored Jan 22, 2024
1 parent a45a40a commit 3e7b568
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit 3e7b568

Please sign in to comment.