From 85982dc8e90b5738bb653bd842a35a67528ce05e Mon Sep 17 00:00:00 2001 From: Sergey Date: Wed, 9 Dec 2020 12:22:50 +0300 Subject: [PATCH] add support crio version for varios k8s vers (#7003) * add support crio version for various k8s vers * regexp in pkg versions --- roles/container-engine/cri-o/vars/centos-7.yml | 11 +++++++++-- roles/container-engine/cri-o/vars/centos-8.yml | 11 +++++++++-- roles/container-engine/cri-o/vars/debian.yml | 16 +++++++++++++--- roles/container-engine/cri-o/vars/ubuntu.yml | 15 ++++++++++++--- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/roles/container-engine/cri-o/vars/centos-7.yml b/roles/container-engine/cri-o/vars/centos-7.yml index 60deaac4b..f2548560d 100644 --- a/roles/container-engine/cri-o/vars/centos-7.yml +++ b/roles/container-engine/cri-o/vars/centos-7.yml @@ -1,5 +1,12 @@ --- -default_crio_packages: - - cri-o-1.19.0 +crio_versioned_pkg: + "1.19": + - "cri-o-1.19.*" + "1.18": + - "cri-o-1.18.*" + "1.17": + - "cri-o-1.17.*" + +default_crio_packages: "{{ crio_versioned_pkg[crio_version] }}" crio_packages: "{{ centos_crio_packages | default(default_crio_packages) }}" diff --git a/roles/container-engine/cri-o/vars/centos-8.yml b/roles/container-engine/cri-o/vars/centos-8.yml index 60deaac4b..f2548560d 100644 --- a/roles/container-engine/cri-o/vars/centos-8.yml +++ b/roles/container-engine/cri-o/vars/centos-8.yml @@ -1,5 +1,12 @@ --- -default_crio_packages: - - cri-o-1.19.0 +crio_versioned_pkg: + "1.19": + - "cri-o-1.19.*" + "1.18": + - "cri-o-1.18.*" + "1.17": + - "cri-o-1.17.*" + +default_crio_packages: "{{ crio_versioned_pkg[crio_version] }}" crio_packages: "{{ centos_crio_packages | default(default_crio_packages) }}" diff --git a/roles/container-engine/cri-o/vars/debian.yml b/roles/container-engine/cri-o/vars/debian.yml index cc9ca8442..1e478aa82 100644 --- a/roles/container-engine/cri-o/vars/debian.yml +++ b/roles/container-engine/cri-o/vars/debian.yml @@ -1,8 +1,18 @@ --- +# Debian-10 has pkg only for cri-o 1.19 +crio_kubernetes_version_matrix: + "1.19": "1.19" + "1.18": "1.19" + "1.17": "1.19" -crio_packages: - - "cri-o" - - "cri-o-runc" +crio_versioned_pkg: + "1.19": + - "cri-o=1.19*" + - cri-o-runc + +default_crio_packages: "{{ crio_versioned_pkg[crio_version] }}" + +crio_packages: "{{ debian_crio_packages | default(default_crio_packages) }}" # The crio_runtimes variable defines a list of OCI compatible runtimes. crio_runtimes: diff --git a/roles/container-engine/cri-o/vars/ubuntu.yml b/roles/container-engine/cri-o/vars/ubuntu.yml index 06343113e..8ce90eb40 100644 --- a/roles/container-engine/cri-o/vars/ubuntu.yml +++ b/roles/container-engine/cri-o/vars/ubuntu.yml @@ -1,7 +1,16 @@ --- -default_crio_packages: - - "cri-o=1.19.0~0" - - "cri-o-runc=1.0.0-6" +crio_versioned_pkg: + "1.19": + - "cri-o=1.19*" + - cri-o-runc + "1.18": + - "cri-o=1.18*" + - cri-o-runc + "1.17": + - "cri-o=1.17*" + - cri-o-runc + +default_crio_packages: "{{ crio_versioned_pkg[crio_version] }}" crio_packages: "{{ ubuntu_crio_packages | default(default_crio_packages) }}"