diff --git a/tinkerbell/stack/templates/nginx.yaml b/tinkerbell/stack/templates/nginx.yaml index cb25f957..e9b2316c 100644 --- a/tinkerbell/stack/templates/nginx.yaml +++ b/tinkerbell/stack/templates/nginx.yaml @@ -48,8 +48,9 @@ spec: command: ["/bin/bash", "-xeuc"] args: - | - POD_NAMESERVER=$(awk '/nameserver/ {print $2}' /etc/resolv.conf) \ - envsubst '$POD_NAMESERVER' \ + export POD_NAMESERVER=$(awk '/nameserver/ {print $2}' /etc/resolv.conf); + [[ $POD_NAMESERVER == *.* ]] || POD_NAMESERVER="[$POD_NAMESERVER]"; + envsubst '$POD_NAMESERVER' \ /etc/nginx/nginx.conf exec nginx -g 'daemon off;'