mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-16 17:13:46 -05:00
Tiny improvement to version handling, add a new debug log
This commit is contained in:
@@ -182,7 +182,10 @@ pub async fn get_latest_tag(
|
||||
Some(t) => {
|
||||
if t == base && image.digest_info.is_some() {
|
||||
// Tags are equal so we'll compare digests
|
||||
debug!(config.debug, "Tags for {} are equal, comparing digests.", image.reference);
|
||||
debug!(
|
||||
config.debug,
|
||||
"Tags for {} are equal, comparing digests.", image.reference
|
||||
);
|
||||
get_latest_digest(
|
||||
&Image {
|
||||
version_info: Some(VersionInfo {
|
||||
|
||||
@@ -47,17 +47,20 @@ impl Version {
|
||||
let major: u32 = match c.name("major") {
|
||||
Some(major) => {
|
||||
positions.push((major.start(), major.end()));
|
||||
major.as_str().parse().unwrap()
|
||||
match major.as_str().parse() {
|
||||
Ok(m) => m,
|
||||
Err(_) => return None
|
||||
}
|
||||
}
|
||||
None => return None,
|
||||
};
|
||||
let minor: Option<u32> = c.name("minor").map(|minor| {
|
||||
positions.push((minor.start(), minor.end()));
|
||||
minor.as_str().parse().unwrap()
|
||||
minor.as_str().parse().expect(&format!("Minor version invalid in tag {}", tag))
|
||||
});
|
||||
let patch: Option<u32> = c.name("patch").map(|patch| {
|
||||
positions.push((patch.start(), patch.end()));
|
||||
patch.as_str().parse().unwrap()
|
||||
patch.as_str().parse().expect(&format!("Patch version invalid in tag {}", tag))
|
||||
});
|
||||
let mut format_str = tag.to_string();
|
||||
positions.reverse();
|
||||
|
||||
Reference in New Issue
Block a user