diff --git a/manifests/container.pp b/manifests/container.pp index e9223fa..fc613da 100644 --- a/manifests/container.pp +++ b/manifests/container.pp @@ -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} | \ diff --git a/spec/defines/container_spec.rb b/spec/defines/container_spec.rb index d53e3aa..9c72436 100644 --- a/spec/defines/container_spec.rb +++ b/spec/defines/container_spec.rb @@ -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 @@ -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 @@ -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 @@ -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