Skip to content

Commit 32b9355

Browse files
authored
Fix environment sourcing when containerd is chosen (#928)
Signed-off-by: Artiom Diomin <[email protected]>
1 parent c5f0403 commit 32b9355

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pkg/containerruntime/containerd.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce
8383
More info at: https://bugzilla.redhat.com/show_bug.cgi?id=1756473
8484
*/}}
8585
yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true
86-
yum install -y containerd.io-{{ .ContainerdVersion }} yum-plugin-versionlock
87-
yum versionlock add containerd.io
8886
8987
cat <<EOF | tee /etc/crictl.yaml
9088
runtime-endpoint: unix:///run/containerd/containerd.sock
@@ -97,6 +95,9 @@ Restart=always
9795
EnvironmentFile=-/etc/environment
9896
EOF
9997
98+
yum install -y containerd.io-{{ .ContainerdVersion }} yum-plugin-versionlock
99+
yum versionlock add containerd.io
100+
100101
systemctl daemon-reload
101102
systemctl enable --now containerd
102103
`))
@@ -106,7 +107,6 @@ apt-get update
106107
apt-get install -y apt-transport-https ca-certificates curl software-properties-common lsb-release
107108
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
108109
add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
109-
apt-get install -y containerd.io={{ .ContainerdVersion }}*
110110
111111
cat <<EOF | tee /etc/crictl.yaml
112112
runtime-endpoint: unix:///run/containerd/containerd.sock
@@ -119,6 +119,9 @@ Restart=always
119119
EnvironmentFile=-/etc/environment
120120
EOF
121121
122+
apt-get install -y containerd.io={{ .ContainerdVersion }}*
123+
apt-mark hold containerd.io
124+
122125
systemctl daemon-reload
123126
systemctl enable --now containerd
124127
`))

pkg/userdata/ubuntu/testdata/containerd.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ write_files:
9393
apt-get install -y apt-transport-https ca-certificates curl software-properties-common lsb-release
9494
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
9595
add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
96-
apt-get install -y containerd.io=1.4.3*
9796
9897
cat <<EOF | tee /etc/crictl.yaml
9998
runtime-endpoint: unix:///run/containerd/containerd.sock
@@ -106,6 +105,9 @@ write_files:
106105
EnvironmentFile=-/etc/environment
107106
EOF
108107
108+
apt-get install -y containerd.io=1.4.3*
109+
apt-mark hold containerd.io
110+
109111
systemctl daemon-reload
110112
systemctl enable --now containerd
111113

0 commit comments

Comments
 (0)