diff --git a/samples/buildstrategy/buildah/buildstrategy_buildah_cr.yaml b/samples/buildstrategy/buildah/buildstrategy_buildah_cr.yaml index 3db81ad85b..6c4dfd262d 100644 --- a/samples/buildstrategy/buildah/buildstrategy_buildah_cr.yaml +++ b/samples/buildstrategy/buildah/buildstrategy_buildah_cr.yaml @@ -145,22 +145,10 @@ spec: # Push the image echo "[INFO] Pushing image ${image}" buildah push \ + --digestfile='$(results.shp-image-digest.path)' \ --tls-verify="${tlsVerify}" \ "${image}" \ "docker://${image}" - - # Store the digest result. This is more complex than expected. BuildAh locally calculates a wrong digest. - # We therefore tag the image to a dummy name so that the layers are still present. Then we remove the local - # tag. Then we pull again. Then the local digest is correct. - # This should be validated again with a newer BuildAh version. - # https://github.com/containers/buildah/issues/3866 - buildah tag "${image}" dummy - buildah rmi "${image}" - buildah pull --tls-verify="${tlsVerify}" "${image}" - buildah inspect \ - --type=image \ - --format='{{.FromImageDigest}}' \ - "${image}" > '$(results.shp-image-digest.path)' # That's the separator between the shell script and its args - -- - --context diff --git a/samples/buildstrategy/source-to-image/buildstrategy_source-to-image-redhat_cr.yaml b/samples/buildstrategy/source-to-image/buildstrategy_source-to-image-redhat_cr.yaml index 4d7d448c9a..04133a4e6f 100644 --- a/samples/buildstrategy/source-to-image/buildstrategy_source-to-image-redhat_cr.yaml +++ b/samples/buildstrategy/source-to-image/buildstrategy_source-to-image-redhat_cr.yaml @@ -109,21 +109,9 @@ spec: # Push the image echo "[INFO] Pushing image ${image}" buildah push \ + --digestfile='$(results.shp-image-digest.path)' \ --tls-verify="${tlsVerify}" \ "docker://${image}" - - # Store the digest result. This is more complex than expected. BuildAh locally calculates a wrong digest. - # We therefore tag the image to a dummy name so that the layers are still present. Then we remove the local - # tag. Then we pull again. Then the local digest is correct. - # This should be validated again with a newer BuildAh version. - # https://github.com/containers/buildah/issues/3866 - buildah tag "${image}" dummy - buildah rmi "${image}" - buildah pull --tls-verify="${tlsVerify}" "${image}" - buildah inspect \ - --type=image \ - --format='{{.FromImageDigest}}' \ - "${image}" > '$(results.shp-image-digest.path)' # That's the separator between the shell script and its args - -- - --image