From 736f4f16a2b6c381bd4e78a882e7e44c7b7ef27b Mon Sep 17 00:00:00 2001 From: Noam Date: Mon, 22 Jan 2024 18:11:08 +0200 Subject: [PATCH] crictl allow setting grace period for stop containers upon reset (#10651) * crictl allow setting different grace period for stop containers and pods * correct grace period location --- roles/reset/defaults/main.yml | 3 +++ roles/reset/tasks/main.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/reset/defaults/main.yml b/roles/reset/defaults/main.yml index 3d58dd91b52..b63f2e2a85d 100644 --- a/roles/reset/defaults/main.yml +++ b/roles/reset/defaults/main.yml @@ -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 diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 84be011a516..a0fa4093c0f 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -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