Skip to content

Commit

Permalink
fix: node-init should use docker if /etc/crictl.yaml not found
Browse files Browse the repository at this point in the history
[ upstream commit 552c823 ]

[ Backporter's notes: The original change contains two locations where
                      the check for crictl.yaml needed to be modified.
                      In the v1.6 tree, only one location contains a
                      reference to crictl.yaml, and this commit modifies
                      it. ]

This script has several tests for what the container runtime situation
looks like to determine how best to restart the underlying containers
(going around the kubelet) so that the new networking configuration
can take effect.

The first test looks to see if the crictl config file is configured to use
docker, but if that file doesn't exist then it fails. I believe docker
is the default if this hasn't been configured at all so if that file
doesn't exist then use docker.

Fixes #12850

Signed-off-by: Nathan Bird <njbird@infiniteenergy.com>
Signed-off-by: Chris Tarazi <chris@isovalent.com>
  • Loading branch information
UnwashedMeme authored and joestringer committed Sep 3, 2020
1 parent 7971714 commit 3d4469a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spec:

{{- if .Values.restartPods }}
echo "Restarting kubenet managed pods"
if grep -q 'docker' /etc/crictl.yaml; then
if [ ! -f /etc/crictl.yaml ] || grep -q 'docker' /etc/crictl.yaml; then
# Works for COS, ubuntu
for f in `find /var/lib/cni/networks/ -type f ! -name lock ! -name last_reserved_ip.0`; do docker rm -f $(cat $f) || true; done
else
Expand Down

0 comments on commit 3d4469a

Please sign in to comment.