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:
parent
1f896cf794
commit
d5fb9e3789
10
dockcheck.sh
10
dockcheck.sh
@ -62,14 +62,14 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}')
|
||||
do
|
||||
printf ". "
|
||||
RepoUrl=$(docker inspect "$i" --format='{{.Config.Image}}')
|
||||
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}' | sed -e 's/.*sha256/sha256/' -e 's/\]$//')
|
||||
RegHash=$($regbin image digest --list "$RepoUrl" 2>/dev/null)
|
||||
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}')
|
||||
RegHash=$(./regctl image digest --list "$RepoUrl" 2>/dev/null)
|
||||
# Check if regtcl produces errors - add to GotErrors if so.
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [[ "$LocalHash" != "$RegHash" ]] ; then
|
||||
GotUpdates+=("$i")
|
||||
else
|
||||
if [[ "$LocalHash" = *"$RegHash"* ]] ; then
|
||||
NoUpdates+=("$i")
|
||||
else
|
||||
GotUpdates+=("$i")
|
||||
fi
|
||||
else
|
||||
GotErrors+=("$i")
|
||||
|
Loading…
Reference in New Issue
Block a user