Avoid infinite loop in container scanning job. Refs gitlab-org/gitlab-ee#5706
This commit is contained in:
parent
d8dd75ca77
commit
30aaf6c6ab
1 changed files with 3 additions and 1 deletions
|
@ -315,7 +315,9 @@ production:
|
||||||
mv clair-scanner_linux_amd64 clair-scanner
|
mv clair-scanner_linux_amd64 clair-scanner
|
||||||
chmod +x clair-scanner
|
chmod +x clair-scanner
|
||||||
touch clair-whitelist.yml
|
touch clair-whitelist.yml
|
||||||
while( ! wget -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; done
|
retries=0
|
||||||
|
echo "Waiting for clair daemon to start"
|
||||||
|
while( ! wget -T 10 -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; echo -n "." ; if [ $retries -eq 10 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; retries=$(($retries+1)) ; done
|
||||||
./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
|
./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue