bugquash-multidigest
Changed the logic in comparing the digests - if the local check had multiple digests for an image, the old logic would be inaccurate. New logic just check if the newest digest is among the list of local digests, should avoid some false positives.
This commit is contained in:
10
dockcheck.sh
10
dockcheck.sh
@ -62,14 +62,14 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}')
|
|||||||
do
|
do
|
||||||
printf ". "
|
printf ". "
|
||||||
RepoUrl=$(docker inspect "$i" --format='{{.Config.Image}}')
|
RepoUrl=$(docker inspect "$i" --format='{{.Config.Image}}')
|
||||||
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}' | sed -e 's/.*sha256/sha256/' -e 's/\]$//')
|
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}')
|
||||||
RegHash=$($regbin image digest --list "$RepoUrl" 2>/dev/null)
|
RegHash=$(./regctl image digest --list "$RepoUrl" 2>/dev/null)
|
||||||
# Check if regtcl produces errors - add to GotErrors if so.
|
# Check if regtcl produces errors - add to GotErrors if so.
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
if [[ "$LocalHash" != "$RegHash" ]] ; then
|
if [[ "$LocalHash" = *"$RegHash"* ]] ; then
|
||||||
GotUpdates+=("$i")
|
|
||||||
else
|
|
||||||
NoUpdates+=("$i")
|
NoUpdates+=("$i")
|
||||||
|
else
|
||||||
|
GotUpdates+=("$i")
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
GotErrors+=("$i")
|
GotErrors+=("$i")
|
||||||
|
Reference in New Issue
Block a user