diff --git a/README.md b/README.md index 649c4ae..470c34e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Ingress fqdn has to be configured by either: *replicas* and *content-git-repo* in *config* folder can be customized by modifying files or applying kustomize patch -Connntent git will be displayed in an iframe with node name on top. +Content git will be displayed in an iframe with node name on top. If it's empty, it will display a blank page with node name. Node name is displayed on the top of the page and also in kube-node.json and on kube-node.txt diff --git a/config/init.sh b/config/init.sh index f7378a0..e656fa5 100644 --- a/config/init.sh +++ b/config/init.sh @@ -1,19 +1,23 @@ #!/bin/sh git_retries=20 try=0 -export GIT_SSH_COMMAND='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' -until timeout 10 git clone --recurse-submodules ${CONTENT_GIT_REPO} /app ; do - echo "Retry git pull after error ($try / $git_retries)" - try=$((try+1)) - if [ $try -eq $git_retries ]; then - exit 1 - fi - sleep 1 -done +if [ -n "${CONTENT_GIT_REPO}" ] ; then + export GIT_SSH_COMMAND='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' + until timeout 10 git clone --recurse-submodules ${CONTENT_GIT_REPO} /app ; do + echo "Retry git pull after error ($try / $git_retries)" + try=$((try+1)) + if [ $try -eq $git_retries ]; then + exit 1 + fi + sleep 1 + done +fi + cd /app if [ -e index.html ] ; then mv index.html index-embedded.html fi + cat <index.html @@ -24,15 +28,26 @@ cat <index.html From node ${KUBE_NODE_NAME}
as json - text

+EOF + +if [ -n "${CONTENT_GIT_REPO}" ] ; then + cat <>index.html