From 6aeed20dbf4dfececdf7e28ab2aa4d6cca9032f4 Mon Sep 17 00:00:00 2001 From: trivernis Date: Tue, 20 Jun 2023 16:14:07 +0200 Subject: [PATCH] Fix checksum comparison --- lib/dockerhub.nu | 2 ++ podman-update-check | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/dockerhub.nu b/lib/dockerhub.nu index 2fc1927..3584277 100644 --- a/lib/dockerhub.nu +++ b/lib/dockerhub.nu @@ -10,6 +10,8 @@ export def get_image_digest [image: string] { | from json | get config | get digest + | split row ":" + | get 1 ) } diff --git a/podman-update-check b/podman-update-check index 0359dd8..2aaf973 100755 --- a/podman-update-check +++ b/podman-update-check @@ -30,10 +30,10 @@ export def needs_update [] { let name_parts = ( $data.Name | split row "/" --number 2 ) let host = ( $name_parts | first ) let image = ( $name_parts | last | split row ":" | get 0 ) - let digest = $data.Digest + let digest = $data.Id - if $host == "docker.io/" { - ( dockerhub get_image_digest $image ) == digest + if $host == "docker.io" { + ( dockerhub get_image_digest $image ) != $digest } else { false }