Merge pull request #37593 from yujuhong/gci_rm_docker_network

Automatic merge from submit-queue

GCI: Remove /var/lib/docker/network
pull/6/head
Kubernetes Submit Queue 2016-12-01 13:24:22 -08:00 committed by GitHub
commit 2cdb97d413
1 changed files with 15 additions and 2 deletions

View File

@ -409,9 +409,22 @@ function assemble-docker-flags {
fi fi
echo "DOCKER_OPTS=\"${docker_opts} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker echo "DOCKER_OPTS=\"${docker_opts} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker
# If using a network plugin, we need to explicitly restart docker daemon, because
# kubelet will not do it.
if [[ "${use_net_plugin}" == "true" ]]; then if [[ "${use_net_plugin}" == "true" ]]; then
# If using a network plugin, extend the docker configuration to always remove
# the network checkpoint to avoid corrupt checkpoints.
# (https://github.com/docker/docker/issues/18283).
echo "Extend the default docker.service configuration"
mkdir -p /etc/systemd/system/docker.service.d
cat <<EOF >/etc/systemd/system/docker.service.d/01network.conf
[Service]
ExecStartPre=/bin/sh -x -c "rm -rf /var/lib/docker/network"
EOF
systemctl daemon-reload
# If using a network plugin, we need to explicitly restart docker daemon, because
# kubelet will not do it.
echo "Docker command line is updated. Restart docker to pick it up" echo "Docker command line is updated. Restart docker to pick it up"
systemctl restart docker systemctl restart docker
fi fi