From 3e7b568d3eb485902dcaa819a7f15ba288dd3abd Mon Sep 17 00:00:00 2001 From: Noam <noama@nvidia.com> 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 3d58dd91b..b63f2e2a8 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 84be011a5..a0fa4093c 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 -- GitLab