After @jcline and I played around with this stuff a bit, it
seems clear that:
We don't need to create a separate manifest for each 'target'
We can give the local copy of the manifest a disposable name
At present we give the local manifests we create the exact name
that would usually refer to the remote manifest they are
ultimately published as. That is, we were doing something like:
which is really kind of confusing, because usually doing e.g.:
buildah manifest inspect quay.io/fedora/fedora:41
would show you the contents of the manifest from quay.io, but
if you create a local manifest with that exact same name, that
one will take precedence. It's a confusing mechanism and we don't need to name the manifests we're creating in this confusing
way, so let's not, let's just give them names that are clearly
local (inspired by podman), clearly temporary, and clearly tied
to this tool (fiu).
We were also creating a separate manifest per "target" - the
various names on the various registries that we ultimately
publish the manifest as - because this is what the bash script
this code replaces did. But some testing indicates this really
is not necessary. The manifests just refer to the images by
their sha256sums, which of course are always the same. For e.g.
if you do:
...where /path/to/source/image is the image that we published to
those two registries under the name fedora:41-x86_64 via skopeo copy, those three manifests will all be exactly
identical. So we can just create the manifest once per repo, and
publish that same manifest to the different tags on the different
repositories.
After @jcline and I played around with this stuff a bit, it
seems clear that:
At present we give the local manifests we create the exact name
that would usually refer to the remote manifest they are
ultimately published as. That is, we were doing something like:
buildah manifest create quay.io/fedora/fedora:41 ...
which is really kind of confusing, because usually doing e.g.:
buildah manifest inspect quay.io/fedora/fedora:41
would show you the contents of the manifest from quay.io, but
if you create a local manifest with that exact same name, that
one will take precedence. It's a confusing mechanism and we don't
need to name the manifests we're creating in this confusing
way, so let's not, let's just give them names that are clearly
local (inspired by podman), clearly temporary, and clearly tied
to this tool (fiu).
We were also creating a separate manifest per "target" - the
various names on the various registries that we ultimately
publish the manifest as - because this is what the bash script
this code replaces did. But some testing indicates this really
is not necessary. The manifests just refer to the images by
their sha256sums, which of course are always the same. For e.g.
if you do:
buildah manifest create test1 quay.io/fedora/fedora:41-x86_64
buildah manifest create test2 registry.fedoraproject.org/fedora:41-x86_64
buildah manifest create test3 oci-archive:/path/to/source/image
...where /path/to/source/image is the image that we published to
those two registries under the name
fedora:41-x86_64viaskopeo copy, those three manifests will all be exactlyidentical. So we can just create the manifest once per repo, and
publish that same manifest to the different tags on the different
repositories.
Signed-off-by: Adam Williamson awilliam@redhat.com