kola/tests/flannel: retry flannel-docker-opts.service the hard way
Network calls in flannel-docker-opts.service sometimes time out in
Jenkins, and since the service has Type=oneshot, it can't have a
Restart= setting.  This rewrites its ExecStart= line to add some
retry logic to dodge bad network connections.
@@ -53,6 +53,13 @@ var (
"contents": "[Service]\nExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ \"Network\": \"10.254.0.0/16\", \"Backend\": {\"Type\": \"$type\"} }'"
}]
},
+ {
+ "name": "flannel-docker-opts.service",
+ "dropins": [{
+ "name": "retry.conf",
+ "contents": "[Service]\nTimeoutStartSec=300\nExecStart=\nExecStart=/bin/sh -exc 'for try in 1 2 3 4 5 6 ; do /usr/lib/coreos/flannel-wrapper -d /run/flannel/flannel_docker_opts.env -i && break || sleep 10 ; try=fail ; done ; [ $try != fail ]'"
+ }]
+ },
{
"name": "docker.service",
"enable": true
