@@ -26,22 +26,30 @@ function containerd_join() {
26
26
}
27
27
28
28
function containerd_install() {
29
+ if is_amazon_2023; then
30
+ require_amazon2023_containerd
31
+ log " Using containerd version provided by the Operating System."
32
+ if ! systemctl is-active --quiet containerd; then
33
+ systemctl start containerd
34
+ fi
35
+ fi
36
+
29
37
local src=" $DIR /addons/containerd/$CONTAINERD_VERSION "
30
38
31
39
if ! containerd_xfs_ftype_enabled; then
32
40
bail " The filesystem mounted at /var/lib/containerd does not have ftype enabled"
33
41
fi
34
42
35
- containerd_migrate_from_docker
36
-
37
- containerd_install_container_selinux_if_missing
38
- install_host_packages " $src " containerd.io
39
-
40
- chmod +x ${DIR} /addons/containerd/ ${CONTAINERD_VERSION} /assets/ runc
41
- # If the runc binary is executing the cp command will fail with "text file busy" error.
42
- # Containerd uses runc in detached mode so any runc processes should be short-lived and exit
43
- # as soon as the container starts
44
- try_1m_stderr cp ${DIR} /addons/containerd/ ${CONTAINERD_VERSION} /assets/runc $( which runc )
43
+ if ! is_amazon_2023 ; then
44
+ containerd_migrate_from_docker
45
+ containerd_install_container_selinux_if_missing
46
+ install_host_packages " $src " containerd.io
47
+ chmod +x ${DIR} /addons/containerd/ ${CONTAINERD_VERSION} /assets/runc
48
+ # If the runc binary is executing the cp command will fail with "text file busy" error.
49
+ # Containerd uses runc in detached mode so any runc processes should be short-lived and exit
50
+ # as soon as the container starts
51
+ try_1m_stderr cp ${DIR} /addons/containerd/ ${CONTAINERD_VERSION} /assets/runc $( which runc )
52
+ fi
45
53
46
54
logStep " Containerd configuration"
47
55
containerd_configure
@@ -109,6 +117,7 @@ function containerd_install() {
109
117
110
118
function containerd_host_init() {
111
119
require_centos8_containerd
120
+ require_amazon2023_containerd
112
121
containerd_install_libzstd_if_missing
113
122
}
114
123
@@ -121,7 +130,7 @@ function containerd_install_libzstd_if_missing() {
121
130
return
122
131
fi
123
132
124
- if is_rhel_9_variant ; then
133
+ if ! host_packages_shipped ; then
125
134
yum_ensure_host_package libzstd
126
135
else
127
136
yum_install_host_archives " $src " libzstd
@@ -396,6 +405,20 @@ function containerd_kubernetes_pause_image() {
396
405
fi
397
406
}
398
407
408
+ # require_amazon2023_containerd makes sure the OS version of containerd is
409
+ # installed.
410
+ function require_amazon2023_containerd() {
411
+ if ! is_amazon_2023 ; then
412
+ return
413
+ fi
414
+
415
+ if yum_is_host_package_installed containerd ; then
416
+ return
417
+ fi
418
+
419
+ bail " Containerd is not installed, please install it using the following command: dnf install -y containerd"
420
+ }
421
+
399
422
function require_centos8_containerd() {
400
423
if [ " $LSB_DIST " == " centos" ] && [ " $DIST_VERSION_MAJOR " == " 8" ]; then
401
424
# if this is not centos 8 Stream, require preinstallation of containerd on 1.6.31+
0 commit comments