Commit Graph

3 Commits

Author SHA1 Message Date
Aditya Rajan 29da01d939 remove-image: Add optional LookupManifest to RemoveImagesOptions.
Following flag allows user to configure RemoveImages in a manner so that
remove func becomes exclusive to removing manifests when needed and not
removing underlying referenced images.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-09-02 14:21:51 +05:30
flouthoc bfb9606066 runtime: Add ReturnManifestIfPresent to LookupImageOptions
If matching images resolves to a manifest list, return manifest list
instead of resolving to image instance, if manifest list is not found
try resolving image.

Signed-off-by: Aditya Rajan <flouthoc.git@gmail.com>
2021-08-30 14:16:32 +05:30
Valentin Rothberg 92095e0dbe libimage: fix manifest list lookup
Commit 724e7c92b5 fixed an issue when pushing images from of a
platform different than the current machine.  That required to disable
the platform matching logic when looking up the image before pushing it.
It also required some restructuring of the code such that manifest lists
are resolved and their instances looked up.

The restructuring in turn introduced a regression when looking up bare
manifest lists.  To fix the regression and keep the code simple,
introduce an internal field in the LookupImageOptions that indicates
whether we're looking up a bare manifest list or not.

Now we have clearer separation of concerns between looking up images or
manfifests and whether the looked up image needs to match the current
platform or not.

Add some unit tests exercising the manifest-list code to make sure we're
not regressing again.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-18 14:53:37 +02:00