Record and show that an image is already on its newest tag
An image that had been checked and is current looked exactly like one that was never checked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@ -59,6 +59,7 @@ pub struct ImageUpdate {
|
||||
/// The image reference as it runs on the cluster.
|
||||
pub image: String,
|
||||
/// The newer tag that was checked, e.g. `docker.gitea.com/gitea:1.25.1-rootless`.
|
||||
/// Empty when the check found no newer tag.
|
||||
pub candidate: String,
|
||||
pub checked_at: chrono::DateTime<chrono::Utc>,
|
||||
/// CVE ids that are open on the running image and gone in the candidate.
|
||||
@ -68,6 +69,13 @@ pub struct ImageUpdate {
|
||||
pub candidate_total: usize,
|
||||
}
|
||||
|
||||
impl ImageUpdate {
|
||||
/// True when the check found no newer tag for this image.
|
||||
pub fn up_to_date(&self) -> bool {
|
||||
self.candidate.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
/// Numeric parts of a tag plus its suffix, e.g. `1.24.2-rootless` → ([1, 24, 2], "rootless").
|
||||
fn version_parts(tag: &str) -> Option<(Vec<u64>, String)> {
|
||||
let core = tag.strip_prefix('v').unwrap_or(tag);
|
||||
|
||||
Reference in New Issue
Block a user