Minor fix to ensure exclude only works against container name

Signed-off-by: Mike Ritter <mike.ritter@target.com>
This commit is contained in:
Mike Ritter 2018-02-27 18:24:25 -06:00
parent dd61f061fc
commit b37dfb95e3

View file

@ -92,7 +92,7 @@ main () {
containers=$(docker ps | sed '1d' | awk '{print $NF}') containers=$(docker ps | sed '1d' | awk '{print $NF}')
else else
pattern=$(echo "$exclude" | sed 's/,/|/g') pattern=$(echo "$exclude" | sed 's/,/|/g')
containers=$(docker ps | sed '1d' | grep -Ev "$pattern" | awk '{print $NF}') containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -Ev "$pattern" )
fi fi
# If there is a container with label docker_bench_security, memorize it: # If there is a container with label docker_bench_security, memorize it:
benchcont="nil" benchcont="nil"