Commit Graph

9 Commits

Author SHA1 Message Date
Nalin Dahyabhai 8ae99121c1 CI: enable the gofumpt linter
Turn on the gofumpt linter.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-15 13:17:44 -04:00
Nalin Dahyabhai 646de34999 Add compabitility wrappers for removed packages
Add compatibility wrappers for manifests, pkg/manifests, and
pkg/supplemented, which were moved to containers/common.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-04-23 16:43:16 -04:00
Valentin Rothberg dcd2a92e56 use new containers/common/libimage package
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>
2021-04-22 17:39:00 +02:00
Nalin Dahyabhai d981536c3d manifest push --format: force an image type, not a list type
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>
2020-02-17 17:49:10 -05:00
Nalin Dahyabhai fd7ae759b9 manifest add: always read the individual image manifest
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
2020-02-06 18:31:07 +00:00
Nalin Dahyabhai 20820d7184 manifest push: add --format option
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>
2020-02-04 15:37:09 -05:00
Nalin Dahyabhai b7f737d169 manifests: unit test fix
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
2020-01-26 18:11:22 +00:00
Nalin Dahyabhai a925f79cc3 add --sign-by to bud/commit/push, --remove-signatures for pull/push
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
2020-01-17 18:22:34 +00:00
Nalin Dahyabhai b3a5a5ff15 manifests: add the module
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
2019-10-28 15:15:35 +00:00