fix: Use leniency for semver parsing (#184)

This commit is contained in:
Gerald Pinder 2024-05-16 20:15:14 -04:00 committed by GitHub
parent e6905b4fcc
commit abedf4fc6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 46 additions and 3 deletions

View file

@ -1,5 +1,4 @@
use blue_build_utils::constants::IMAGE_VERSION_LABEL;
use semver::Version;
use serde::Deserialize;
use serde_json::Value;
use std::collections::HashMap;
@ -20,7 +19,7 @@ impl ImageMetadata {
self.labels
.get(IMAGE_VERSION_LABEL)?
.as_str()
.and_then(|v| Version::parse(v).ok())?
.and_then(|v| lenient_semver::parse(v).ok())?
.major,
)
}