k3d
k3d copied to clipboard
[QUESTION/HELP] k3d script k3d-entrypoint-dns.sh might have a problem
Hi,
I use k3d version 5.6.3 with rootless podman, version 4.6.1, and I had no problems creating k3d clusters for the last months but now suddenly during cluster creation the startup of the k3d containers fail.
I found out that startup of software in container is with script k3d-entrypoint.sh
which first searches for additional scripts k3d-entrypoint-*.sh
and executes them.
The problem I have is in script k3d-entrypoint-dns.sh
. First part of the problem is the line
set -o errexit
This will end script execution immediately if a command returns with exit code not equal 0. The second part of my problem are the lines
grep -q "${docker_dns}" /etc/resolv.conf
grepstatus=$?
Here if ${docker_dns}
is not found in /etc/resolv.conf
the grep command terminates with 1. This case is handled in the next lines. But this next line is never executed due to set -o errexit
and so the script terminates and as a result the complete startup terminates.
My question: Is that as expected or should the startup script k3d-entrypoint-dns.sh
be modified to be able to handle the result of the grep
command?
Btw, set -o errexit
is set in nearly every kde-entrypoint-*.sh script. Maybe there are additional code lines with similar behavior?
Best regards Ulrich.