From: Ricardo Noriega Date: Thu, 7 May 2020 14:10:15 +0000 (+0200) Subject: Make dockerjson and kubeadminhub files optional X-Git-Tag: akraino_r3~1 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F3403%2F4;p=kni%2Finstaller.git Make dockerjson and kubeadminhub files optional Signed-off-by: Ricardo Noriega Change-Id: Ibf37f186778e9be670e5427ea95d1b7a7e5b38fb --- diff --git a/plugins/kustomize/plugin/kni.akraino.org/v1alpha1/siteconfig/SiteConfig b/plugins/kustomize/plugin/kni.akraino.org/v1alpha1/siteconfig/SiteConfig index 20d9d07..96b9cb8 100755 --- a/plugins/kustomize/plugin/kni.akraino.org/v1alpha1/siteconfig/SiteConfig +++ b/plugins/kustomize/plugin/kni.akraino.org/v1alpha1/siteconfig/SiteConfig @@ -9,7 +9,7 @@ # The same mechanism could be used in the future to template in more site # configuration parameters for which a purist "kustomization" is too cumbersome. -# set -x +#set -x set -e # Skip the config file name argument. @@ -17,8 +17,14 @@ shift PULL_SECRET=$(cat ${HOME}/.kni/pull-secret.json) SSH_PUB_KEY=$(cat ${HOME}/.kni/id_rsa.pub) -DOCKERCONFIGJSON=$(cat ${HOME}/.kni/dockerconfig.json) -KUBECONFIGHUB=$(cat ${HOME}/.kni/kubeconfighub.json) + +if [ -f `$HOME/.kni/dockerconfig.json` ]; then + DOCKERCONFIGJSON=$(cat ${HOME}/.kni/dockerconfig.json) +fi + +if [ -f `$HOME/.kni/kubeconfighub.json` ]; then + KUBECONFIGHUB=$(cat ${HOME}/.kni/kubeconfighub.json) +fi cat - | sed \ -e "s|PULL_SECRET|\'${PULL_SECRET}\'|" \