Add compatibility wrappers for manifests, pkg/manifests, and
pkg/supplemented, which were moved to containers/common.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Move all code related handling container image over to the new
`libimage` package in containers/common. The new package is an
attempt to consolidate the code across the containers tools under the
github.com/containers umbrella.
The new `libimage` packages provides functionality to perform all kinds
of operations for managing images such as local lookups, pushing,
pulling, listing, removing, etc.
The following packages have been moved over the containers/common:
`manifests` -> `common/image/manifests`
`pkg/manifests` -> `common/pkg/manifests`
`pkg/supplemented` -> `common/pkg/supplemented`
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
The image library's image copying API expects the type of a single image
in the options structure's ForceManifestMIMEType field, and it infers
the corresponding list type when it's copying multiple images.
Previously, though, we were passing in a list type, which was also being
used as the target type for converting single images, which would fail.
Switch to passing in the single-image type instead, and infer the single
type in our internal API if a consumer passes us a list type.
This makes it easier to notice that we force v2s1 images to be converted
to v2s2 images when we push them as part of a list, even if the registry
doesn't reject v2s1 images.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Always read the manifest of the individual image that we're adding to a
list, so that we also read its MIME type. When we weren't doing this
before, when we added an individual image from another list, we'd record
the type of that other list as the image's type.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #2140
Approved by: TomSweeneyRedHat
Add a --format option, which takes the same values as the --format
option for `buildah push`, to `buildah manifest push`, for cases where
we need to override the default.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
The unit tests need to use the policy and registries configurations from
the source tree, so point the SystemContext that we use in our tests to
those files.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #2103
Approved by: rhatdan
Add the --sign-by option to `buildah build-using-dockerfile`,
`buildah commit`, `buildah push`, and `buildah manifest push`. Add the
`--remove-signatures` option to `buildah pull`, `buildah push`, and
`buildah manifest push`. We just pass them to the image library, which
does all of the heavy lifting.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #2085
Approved by: rhatdan
Wrap the pkg/manifests API in a version which knows how to load and save
manifest lists and information about where the various instances are
found in local storage.
Add an ImageSource implementation that can use a manifest list and
instance information to create a grab bag of all of the blobs known to
all of the instances.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #1902
Approved by: rhatdan