Skip to content

Commit

Permalink
Merge branch 'optiz0r-digest_fix_master'
Browse files Browse the repository at this point in the history
  • Loading branch information
southalc committed Dec 7, 2024
2 parents 394a7fe + 9927186 commit 92fcc37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifests/container.pp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
if podman container exists ${container_name}
then
image_name=\$(podman container inspect ${container_name} --format '{{.ImageName}}')
running_digest=\$(podman image inspect \${image_name} --format '{{.Digest}}')
running_digest=\$(podman image inspect $(podman image inspect \${image_name} --format='{{.ID}}') --format '{{.Digest}}')
latest_digest=\$(skopeo inspect docker://${image} | \
${_ruby} -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
[[ $? -ne 0 ]] && latest_digest=\$(skopeo inspect --no-creds docker://${image} | \
Expand Down
8 changes: 4 additions & 4 deletions spec/defines/container_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
|if podman container exists namevar
| then
| image_name=$(podman container inspect namevar --format '{{.ImageName}}')
| running_digest=$(podman image inspect ${image_name} --format '{{.Digest}}')
| running_digest=$(podman image inspect $(podman image inspect ${image_name} --format='{{.ID}}') --format '{{.Digest}}')
| latest_digest=$(skopeo inspect docker://registry:latest | /opt/puppetlabs/puppet/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| [[ $? -ne 0 ]] && latest_digest=$(skopeo inspect --no-creds docker://registry:latest | /opt/puppetlabs/puppet/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| test -z "${latest_digest}" && exit 0 # Do not update if unable to get latest digest
Expand All @@ -62,7 +62,7 @@
|if podman container exists namevar
| then
| image_name=$(podman container inspect namevar --format '{{.ImageName}}')
| running_digest=$(podman image inspect ${image_name} --format '{{.Digest}}')
| running_digest=$(podman image inspect $(podman image inspect ${image_name} --format='{{.ID}}') --format '{{.Digest}}')
| latest_digest=$(skopeo inspect docker://registry:latest | /usr/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| [[ $? -ne 0 ]] && latest_digest=$(skopeo inspect --no-creds docker://registry:latest | /usr/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| test -z "${latest_digest}" && exit 0 # Do not update if unable to get latest digest
Expand Down Expand Up @@ -203,7 +203,7 @@
|if podman container exists namevar
| then
| image_name=$(podman container inspect namevar --format '{{.ImageName}}')
| running_digest=$(podman image inspect ${image_name} --format '{{.Digest}}')
| running_digest=$(podman image inspect $(podman image inspect ${image_name} --format='{{.ID}}') --format '{{.Digest}}')
| latest_digest=$(skopeo inspect docker://testing:latest | /opt/puppetlabs/puppet/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| [[ $? -ne 0 ]] && latest_digest=$(skopeo inspect --no-creds docker://testing:latest | /opt/puppetlabs/puppet/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| test -z "${latest_digest}" && exit 0 # Do not update if unable to get latest digest
Expand Down Expand Up @@ -796,7 +796,7 @@
|if podman container exists namevar
| then
| image_name=$(podman container inspect namevar --format '{{.ImageName}}')
| running_digest=$(podman image inspect ${image_name} --format '{{.Digest}}')
| running_digest=$(podman image inspect $(podman image inspect ${image_name} --format='{{.ID}}') --format '{{.Digest}}')
| latest_digest=$(skopeo inspect docker://mandatory:latest | /test/ing -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| [[ $? -ne 0 ]] && latest_digest=$(skopeo inspect --no-creds docker://mandatory:latest | /test/ing -rjson -e 'puts (JSON.parse(STDIN.read))["Digest"]')
| test -z "${latest_digest}" && exit 0 # Do not update if unable to get latest digest
Expand Down

0 comments on commit 92fcc37

Please sign in to comment.