mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-08 08:27:24 +00:00
utils: kata-manager: Improve version check
Update `github_get_latest_release()` to use `sort -V` rather than sub-sorting on the major, minor and patch level version number elements. The new approach is safer and more accurate. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
parent
21e45bebc8
commit
1625a5ce48
@ -109,7 +109,7 @@ github_get_latest_release()
|
||||
local latest
|
||||
latest=$(curl -sL "$url" |\
|
||||
jq -r '.[].tag_name | select(contains("-") | not)' |\
|
||||
sort -t "." -k1,1n -k2,2n -k3,3n |\
|
||||
sort -t '.' -V |\
|
||||
tail -1 || true)
|
||||
|
||||
[ -z "$latest" ] && die "Cannot determine latest release from $url"
|
||||
|
Loading…
Reference in New Issue
Block a user