From: garciadeblas Date: Thu, 13 Jan 2022 00:24:15 +0000 (+0100) Subject: Fixed installation issue with kube-flannel.yml X-Git-Tag: v12.0.0rc1~59 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fdevops.git;a=commitdiff_plain;h=5a5c63fa67e23854cec3b61ce54e5bcfd15d3290 Fixed installation issue with kube-flannel.yml The installation of the local K8s cluster fails when kube-flannel.yml is not found in the temp folder. The error that we see in the installation is "error reading [/tmp/flannel.*****]: recognized file extensions are [.json .yaml .yml]" This commit updates the function deploy_cni_provider to remove the silent output when getting kube-flannel.yml. In addition, it adds several retries on error. Finally, the error message has been modified to be more explicit about the error. Change-Id: Ica07bc5b3b76ffb84f7247c436b214b531d8e833 Signed-off-by: garciadeblas --- diff --git a/installers/install_kubeadm_cluster.sh b/installers/install_kubeadm_cluster.sh index 1672854a..28a91800 100755 --- a/installers/install_kubeadm_cluster.sh +++ b/installers/install_kubeadm_cluster.sh @@ -58,7 +58,8 @@ function deploy_cni_provider() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function CNI_DIR="$(mktemp -d -q --tmpdir "flannel.XXXXXX")" trap 'rm -rf "${CNI_DIR}"' EXIT - wget -q https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml -P $CNI_DIR + wget --retry-on-host-error --retry-on-http-error 404,429,503 --tries=5 https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml -P $CNI_DIR + [ ! -f $CNI_DIR/kube-flannel.yml && FATAL "Cannot Install Flannel because $CNI_DIR/kube-flannel.yml was not found. Maybe the file https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml is temporarily not accessible" kubectl apply -f $CNI_DIR [ $? -ne 0 ] && FATAL "Cannot Install Flannel" [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function