From 265d0aea64f184d450b7aca9f6b2826d2692d8de Mon Sep 17 00:00:00 2001 From: Salvador Fuentes Date: Mon, 4 May 2020 18:08:23 -0500 Subject: [PATCH] ci: update the way we get crio version We need to update how we get the value of the crio version as the output of `crio --version` has changed since crio 1.18.0. This change now works with new and old versions of crio. Fixes: #2506. Signed-off-by: Salvador Fuentes --- .ci/configure_crio_for_kata.sh | 2 +- .ci/install_crio.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/configure_crio_for_kata.sh b/.ci/configure_crio_for_kata.sh index ce7606701..eba8eb386 100755 --- a/.ci/configure_crio_for_kata.sh +++ b/.ci/configure_crio_for_kata.sh @@ -16,7 +16,7 @@ crio_config_dir="/etc/crio/crio.conf.d" runc_flag="\/usr\/local\/bin\/crio-runc" kata_flag="\/usr\/local\/bin\/containerd-shim-kata-v2" -minor_crio_version=$(crio --version | head -1 | cut -d '.' -f2) +minor_crio_version=$(crio --version | egrep -o "[0-9]+\.[0-9]+\.[0-9]+" | head -1 | cut -d '.' -f2) if [ "$minor_crio_version" -ge "18" ]; then echo "Configure runtimes map for RuntimeClass feature with drop-in configs" diff --git a/.ci/install_crio.sh b/.ci/install_crio.sh index 5d5af64b1..8b2f69f17 100755 --- a/.ci/install_crio.sh +++ b/.ci/install_crio.sh @@ -143,7 +143,7 @@ popd echo "Set manage_ns_lifecycle to true" network_ns_flag="manage_ns_lifecycle" # Set ns_network_flag for CRI-O versions less than 1.17 -crio_version_current=$(crio --version | head -1 | cut -d ' ' -f3) +crio_version_current=$(crio --version | egrep -o "[0-9]+\.[0-9]+\.[0-9]+" | head -1) if [ "$(compare_versions "$crio_version_current" "1.17.0")" -eq "1" ]; then network_ns_flag="manage_network_ns_lifecycle" fi