From 9086edb0253987a1db7e4cf25629a51f1952939b Mon Sep 17 00:00:00 2001 From: Sam <3917978+panzhc@users.noreply.github.com> Date: Thu, 30 Apr 2020 21:48:04 +0800 Subject: [PATCH] Fix the problem of container restart failure 1. When restart docker, the kind container restart failed. Docker logs: ``` INFO: Detected IPv4 address: 172.18.0.2 INFO: Detected old IPv4 address: 172.18.0.2 ERROR: Have an old IPv4 address but no current IPv4 address (!) ``` 2. After modifying the file and replacing it, the container starts normally: ``` docker cp entrypoint cluster-control-plane:/usr/local/bin/entrypoint docker start cluster-control-plane ``` --- images/base/files/usr/local/bin/entrypoint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/base/files/usr/local/bin/entrypoint b/images/base/files/usr/local/bin/entrypoint index 020b546c4d..98dc77022a 100755 --- a/images/base/files/usr/local/bin/entrypoint +++ b/images/base/files/usr/local/bin/entrypoint @@ -207,7 +207,7 @@ enable_network_magic(){ old_ipv6=$(cat /kind/old-ipv6) echo "INFO: Detected old IPv6 address: ${old_ipv6}" >&2 # sanity check that we have a current address - if [[ -n $curr_ipv6 ]]; then + if [[ -z $curr_ipv6 ]]; then echo "ERROR: Have an old IPv6 address but no current IPv6 address (!)" >&2 fi # kubernetes manifests are only present on control-plane nodes