Skip to content

Commit 27003af

Browse files
authored
Merge pull request #86 from consideRatio/pr/update-cri-dockerd-0.3.0
Update cri-dockerd from 0.2.6 to 0.3.0 (only for k3s 1.24+)
2 parents 69fb5fd + 0710e14 commit 27003af

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

action.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,38 @@ runs:
9797
- name: Setup cri-dockerd as a dockershim
9898
if: inputs.docker-enabled == 'true'
9999
env:
100-
CRI_DOCKERD_VERSION: "0.2.6"
100+
# https://github.com/Mirantis/cri-dockerd/tags
101+
CRI_DOCKERD_VERSION: "0.3.0"
101102
run: |
103+
echo "::group::Setup cri-dockerd as a dockershim"
102104
cd /tmp
103105
106+
# Keep using cri-dockerd version 0.2.6 for versions 1.20-1.23 as 0.3.0+
107+
# doesn't support them any more.
108+
v=${{ inputs.k3s-version }}${{ inputs.k3s-channel }}
109+
if [[ "$v" == v1.20* ]] || [[ "$v" == v1.21* ]] || [[ "$v" == v1.22* ]] || [[ "$v" == v1.23* ]]; then
110+
CRI_DOCKERD_VERSION=0.2.6
111+
fi
112+
104113
wget -qO- https://github.com/Mirantis/cri-dockerd/releases/download/v${CRI_DOCKERD_VERSION}/cri-dockerd-${CRI_DOCKERD_VERSION}.amd64.tgz | tar -xvz --strip-components=1
105-
wget -q https://raw.githubusercontent.com/Mirantis/cri-dockerd/v${CRI_DOCKERD_VERSION}/packaging/systemd/cri-docker.service
106-
wget -q https://raw.githubusercontent.com/Mirantis/cri-dockerd/v${CRI_DOCKERD_VERSION}/packaging/systemd/cri-docker.socket
114+
chmod +x cri-dockerd
107115
sudo mv cri-dockerd /usr/bin/
116+
117+
wget -q https://raw.githubusercontent.com/Mirantis/cri-dockerd/v${CRI_DOCKERD_VERSION}/packaging/systemd/cri-docker.socket
108118
sudo mv cri-docker.socket /etc/systemd/system/
109-
sudo mv cri-docker.service /etc/systemd/system/
110119
111-
sudo sed --in-place --expression \
120+
wget -q https://raw.githubusercontent.com/Mirantis/cri-dockerd/v${CRI_DOCKERD_VERSION}/packaging/systemd/cri-docker.service
121+
sed --in-place --expression \
112122
's,--network-plugin=,--network-plugin=cni --cni-bin-dir=/opt/cni/bin --cni-cache-dir=/var/lib/cni/cache --cni-conf-dir=/etc/cni/net.d,' \
113-
/etc/systemd/system/cri-docker.service
123+
cri-docker.service
124+
sudo mv cri-docker.service /etc/systemd/system/
114125
115126
sudo systemctl daemon-reload
116127
sudo systemctl enable cri-docker.service
117128
sudo systemctl enable --now cri-docker.socket
129+
130+
cri-dockerd --buildinfo
131+
echo "::endgroup::"
118132
shell: bash
119133

120134
# NOTE: We apply a workaround as of version 3.0.1 by passing

0 commit comments

Comments
 (0)