Skip to content

Commit 971a67d

Browse files
committed
fix: scanning filter not working properly due to version sorting
1 parent 75ab8fc commit 971a67d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deploy/vuln-monitor/scan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ check_vulnerability(){
4444
done
4545
tags_filter+="^edge$"
4646
# get the latest patches tags for lts images. gcloud will return extra tags if an image has multiple tags and we only want tags specified in the filter, so use grep to further filter the result.
47-
tags=$(gcloud container images list-tags "$base_image" --filter="tags~$tags_filter" --format='value(tags)' | sort -nr | awk -F'[.]' '$1$2!=p&&p=$1$2' | grep -Po "$tags_filter|edge")
47+
tags=$(gcloud container images list-tags "$base_image" --filter="tags~$tags_filter" --format='value(tags)' | sort -Vr | awk -F'[.]' '$1$2!=p&&p=$1$2' | grep -Po "$tags_filter|edge")
4848
fi
4949

5050
for tagsByComma in $tags; do

0 commit comments

Comments
 (0)