From 4abdf6e6e4ee56ae7299e777f032981dee795190 Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Tue, 6 Feb 2018 18:44:49 -0800 Subject: [PATCH] add nc checks to agent (#2221) --- parts/k8s/kubernetesagentcustomdata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parts/k8s/kubernetesagentcustomdata.yml b/parts/k8s/kubernetesagentcustomdata.yml index 25a57ee019..7a3547cc54 100644 --- a/parts/k8s/kubernetesagentcustomdata.yml +++ b/parts/k8s/kubernetesagentcustomdata.yml @@ -168,8 +168,8 @@ runcmd: - echo `date`,`hostname`, startruncmd>>/opt/m # the first arg is the number of retries, the second arg is the wait duration between two retries and the rest of the args are the cmd to run - retrycmd_if_failure() { retries=$1; wait=$2; shift && shift; for i in $(seq 1 $retries); do ${@}; [ $? -eq 0 ] && break || sleep $wait; done; echo Executed \"$@\" $i times; } -- retrycmd_if_failure 120 1 nc -zw1 $(grep nameserver /etc/resolv.conf | cut -d \ -f 2) 53 -- retrycmd_if_failure 120 1 nc -zw1 azure.com 443 +- retrycmd_if_failure 120 1 nc -zuw1 $(grep nameserver /etc/resolv.conf | cut -d \ -f 2) 53 +- retrycmd_if_failure 120 1 nc -zw1 aptdocker.azureedge.net 443 - apt-mark hold walinuxagent{{GetKubernetesAgentPreprovisionYaml .}} - echo `date`,`hostname`, preaptupdate>>/opt/m - retrycmd_if_failure 5 10 apt-get update