diff --git a/src/repocheck/repocheck.rs b/src/repocheck/repocheck.rs index 1b257cc..d8d7061 100644 --- a/src/repocheck/repocheck.rs +++ b/src/repocheck/repocheck.rs @@ -26,9 +26,10 @@ pub async fn get_tags_for_image(image: &str) -> Result, Box Result Result current_version { // tag_version is greater than current_version // Do something with this tag - println!("Tag {} is newer than current version", tag); - latest_version = tag.clone(); + if latest_version.is_empty() { + log::info!("latest_version is empty - setting to tag {}", tag); + latest_version = tag.clone(); + } else if tag_version > Version::parse(&strip_tag_lettings(&latest_version)).unwrap() { + log::info!("Tag {} is newer than {} current latest_version updating", tag, latest_version); + latest_version = tag.clone(); + } + } } else { // Handle the case where the tag is not a valid SemVer format