Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
retry apt-mark hold and apt-mark unhold (#2625)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored Apr 6, 2018
1 parent b143b6d commit d574b10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions parts/k8s/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ runcmd:
- . /opt/azure/containers/provision_source.sh
- retrycmd_if_failure 120 1 5 nc -zuw1 $(grep nameserver /etc/resolv.conf | cut -d \ -f 2) 53
- retrycmd_if_failure 120 1 5 nc -zw1 aptdocker.azureedge.net 443
- apt-mark hold walinuxagent{{GetKubernetesAgentPreprovisionYaml .}}
- retrycmd_if_failure 20 5 5 apt-mark hold walinuxagent{{GetKubernetesAgentPreprovisionYaml .}}
- echo `date`,`hostname`, preaptupdate>>/opt/m
- apt_get_update
- echo `date`,`hostname`, postaptupdate>>/opt/m
Expand Down Expand Up @@ -213,7 +213,7 @@ runcmd:
- echo `date`,`hostname`, PRE-APT-SYSTEMD-DAILY>>/opt/m
- /usr/lib/apt/apt.systemd.daily
- echo `date`,`hostname`, POST-APT-SYSTEMD-DAILY>>/opt/m
- apt-mark unhold walinuxagent
- retrycmd_if_failure 20 5 5 apt-mark unhold walinuxagent
- mkdir -p /opt/azure/containers && touch /opt/azure/containers/runcmd.complete
- echo `date`,`hostname`, endruncmd>>/opt/m
{{end}}
4 changes: 2 additions & 2 deletions parts/k8s/kubernetescustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ fi

if [[ $OS == $UBUNTU_OS_NAME ]]; then
# make sure walinuxagent doesn't get updated in the middle of running this script
apt-mark hold walinuxagent
retrycmd_if_failure 20 5 5 apt-mark hold walinuxagent
fi

echo `date`,`hostname`, EnsureDockerStart>>/opt/m
Expand Down Expand Up @@ -578,7 +578,7 @@ if [[ $OS == $UBUNTU_OS_NAME ]]; then
echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind
sed -i "13i\echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind\n" /etc/rc.local

apt-mark unhold walinuxagent
retrycmd_if_failure 20 5 5 apt-mark unhold walinuxagent
fi

echo "Install complete successfully"
Expand Down
4 changes: 2 additions & 2 deletions parts/k8s/kubernetesmastercustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ runcmd:
- retrycmd_if_failure 120 1 5 nc -zw1 aptdocker.azureedge.net 443
- ensure_etcd_ready
- /opt/azure/containers/setup-etcd.sh > /opt/azure/containers/setup-etcd.log 2>&1
- apt-mark hold walinuxagent {{GetKubernetesMasterPreprovisionYaml}}
- retrycmd_if_failure 20 5 5 apt-mark hold walinuxagent {{GetKubernetesMasterPreprovisionYaml}}
- /bin/echo DAEMON_ARGS=--name "{{WrapAsVerbatim "variables('masterVMNames')[copyIndex(variables('masterOffset'))]"}}" --peer-client-cert-auth --peer-trusted-ca-file={{WrapAsVariable "etcdCaFilepath"}} --peer-cert-file={{WrapAsVerbatim "variables('etcdPeerCertFilepath')[copyIndex(variables('masterOffset'))]"}} --peer-key-file={{WrapAsVerbatim "variables('etcdPeerKeyFilepath')[copyIndex(variables('masterOffset'))]"}} --initial-advertise-peer-urls "{{WrapAsVerbatim "variables('masterEtcdPeerURLs')[copyIndex(variables('masterOffset'))]"}}" --listen-peer-urls "{{WrapAsVerbatim "variables('masterEtcdPeerURLs')[copyIndex(variables('masterOffset'))]"}}" --client-cert-auth --trusted-ca-file={{WrapAsVariable "etcdCaFilepath"}} --cert-file={{WrapAsVariable "etcdServerCertFilepath"}} --key-file={{WrapAsVariable "etcdServerKeyFilepath"}} --advertise-client-urls "{{WrapAsVerbatim "variables('masterEtcdClientURLs')[copyIndex(variables('masterOffset'))]"}}" --listen-client-urls "{{WrapAsVerbatim "concat(variables('masterEtcdClientURLs')[copyIndex(variables('masterOffset'))], ',https://127.0.0.1:', variables('masterEtcdClientPort'))"}}" --initial-cluster-token "k8s-etcd-cluster" --initial-cluster {{WrapAsVerbatim "variables('masterEtcdClusterStates')[div(variables('masterCount'), 2)]"}} --data-dir "/var/lib/etcddisk" --initial-cluster-state "new" | tee -a /etc/default/etcd
- /opt/azure/containers/mountetcd.sh
- /bin/chown -R etcd:etcd /var/lib/etcddisk
Expand Down Expand Up @@ -404,6 +404,6 @@ runcmd:
{{if EnableAggregatedAPIs}}
- bash /etc/kubernetes/generate-proxy-certs.sh
{{end}}
- apt-mark unhold walinuxagent
- retrycmd_if_failure 20 5 5 apt-mark unhold walinuxagent
- touch /opt/azure/containers/runcmd.complete
{{end}}

0 comments on commit d574b10

Please sign in to comment.