1
0
mirror of https://github.com/containers/skopeo.git synced 2025-05-09 08:26:24 +00:00
Commit Graph

40 Commits

Author SHA1 Message Date
Antonio Murdaca
705f393109 move manifests stuff to its own pkg and add OCI mime types
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-23 12:12:48 +02:00
Antonio Murdaca
7769a21cef expose blob size
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-15 19:52:16 +02:00
Antonio Murdaca
d54a10f490 Image[Source|Destination]: generalize [Get|Put]Layer into [Get|Put]Blob
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-14 13:53:53 +02:00
Miloslav Trmač
96d6a58052 Move docker.genericImage to a separate skopeo/image subpackage
... making image.FromSource a public, stable, API.
2016-06-11 10:48:57 +02:00
Miloslav Trmač
e15276232e Make docker.Image unaware of genericImage internals
This will allow us to cleanly move genericImage into a separate package.

This costs an extra pointer, but also allows us to rely on the type
system and drop handling "certainly impossible" errors, worth it just
for this simplification anyway.
2016-06-11 10:48:57 +02:00
Jhon Honce
f3efa063e3 Card container_security_113 - Delete image support
Add support to mark images for deletion from repository

Requires:
  * V2 API and schema
  * registry configured to allow deletes
  * run registry garbage collection to free up disk space

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2016-06-09 15:23:02 -07:00
Miloslav Trmač
fc761ed74f Fix uploading layer blobs to Docker registry
Implement a client to the chunked API, instead of the nonexistent
one-shot API (per
2a4deee441
).

Adds a FIXME to DELETE the pending upload on failure; the uploads are
supposed to time out so this is not immediately critical.

Fixes  .
2016-06-06 23:00:58 +02:00
Miloslav Trmač
938478e702 Add docker.utils.ManifestMatchesDigest
As opposed to callers just calling utils.ManifestDigest(), this is
a forward-compatible interface, allowing other digest algorithms to
be added in the future.

Right now, we only support SHA-256, so the underlying implementation
does not change anything.
2016-06-01 16:38:11 +02:00
Antonio Murdaca
6fc6d809e0 Remove ManifestMIMETypes
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-31 11:19:09 +02:00
Miloslav Trmač
323b56a049 Make types.Image Docker-independent
The remaining uses of the dependencies, in (skopeo inspect), now check
whether their types.Image is a docker.Image and call the docker.Image
functions directly.

This does not change behavior for Docker images.

For non-Docker images (which can't happen yet), the Name field is
removed; RepoTags remain and are reported as empty, because using
json:",omitempty" would also omit an empty list for Docker images.
2016-05-28 02:11:32 +02:00
Miloslav Trmač
ea643e8658 Use types.ImageSource instead of *dockerImageSource in genericImage
This finally makes genericImage Docker-independent.

(dockerImage is still the only implementation of types.Image.)
2016-05-28 02:11:32 +02:00
Miloslav Trmač
cada464c90 Split dockerImage to genericImage and docker.Image
The code not dependent on specifics of DockerImageSource now lives in
docker.genericImage; the rest directly in docker.Image.

docker.Image remains the only implementation of types.Image at this
point, but that will change.
2016-05-28 02:09:22 +02:00
Miloslav Trmač
0da4307aea Split SourceRefFullName from types.Image.Inspect
This is the only Docker-specific aspect of types.Image.Inspect.

This does not change behavior; plausibly we might want to replace the
Name value in (skopeo inspect) by something else which is not dependent
on Docker, but that can be a separate work later.

Adds a FIXME? in docker_image.go for consistency with
dockerImage.GetRepositoryTags, both will be removed later in the
patchset.
2016-05-28 02:08:12 +02:00
Miloslav Trmač
143e3602ae Split Docker-independent parts of dockerImage into docker/image.go
This does not change the code at all, only moving things around now.
2016-05-28 02:04:48 +02:00
Antonio Murdaca
15f478e26b add the possibility to choose image's MIME type
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-24 16:52:39 +02:00
Antonio Murdaca
7d12b66fb8 add mimetypes
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-23 20:40:52 +02:00
Miloslav Trmač
09f33a7c2c Remove a redundant check
reference.WithDefaultTag is already calling reference.IsNameOnly, so we
don't need to guard it on the outside.
2016-05-21 04:48:33 +02:00
Antonio Murdaca
c661fad3eb provide a way to pass multi values-signle key headers
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-18 17:02:53 +02:00
Antonio Murdaca
e775248b96 move dockerutils under docker/utils
also remove fixtures pkg as it would clutter godoc (there's not need
to have a .go files with fixtures)

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-17 17:35:32 +02:00
Miloslav Trmač
7598aab521 Clean up Image.Inspect
This does not change behavior.

Rename types.DockerImageManifest to types.ImageInspectInfo.

This naming more accurately reflects what the function does and how it is
expected to be used.

(The only outstanding non-inspection piece is the Name field, which is
kind of a subset of GetIntendedDockerReference() right now. Not sure
whether that is intentional.)

Also fold makeImageManifest into its only user.
2016-05-16 20:50:46 +02:00
Miloslav Trmač
9766f72760 Move listing of repository tags from Image.Manifest to a separate Image.GetRepositoryTags
This does not change behavior.

Splits listing of repository tags, which is not a property of an image,
from the image.Manifest gathering of information about an image.
2016-05-16 20:50:46 +02:00
Miloslav Trmač
60e8d63712 Compute the digest in (skopeo inspect) instead of trusting the registry
Compute the digest ourselves, the registry is in general untrusted and
computing it ourserlves is easy enough.

The stop passing the unverifiedCanonicalDigest value around, simplifying
ImageSource.GetManifest and related code.  In particular, remove
retrieveRawManifest and have internal users just call Manifest() now that
we don't need the digest.
2016-05-16 20:50:45 +02:00
Miloslav Trmač
e3d257e7b5 Decouple (skopeo inspect) output formatting from types.Image.Manifest
Does not change behavior.

This will allow us to move collecting some of the data to the (skopeo
inspect) code and to have a more focused types.Image API, where
types.Image.Manifest() does not return a grab bag of manifest-unrelated
data, eventually.

For how it actually makes the coupling more explicit by having
types.Image.Manifest() return a types.DockerImageManifest instead of the
too generic types.ImageManifest.  We will need to think about which
parts of DockerImageManifest are truly generic, later.
2016-05-16 20:50:45 +02:00
Miloslav Trmač
c38ed76969 Rename GetIndendedDockerReference to IntendedDockerReference 2016-05-16 20:33:13 +02:00
Miloslav Trmač
119609b871 Drop the Get prefix from types.Image.GetManifest and GetSignatures
Keeps the Get prefix on the equivalent methods on types.ImageSource, to
hint that they may be slow.
2016-05-16 20:29:52 +02:00
Miloslav Trmač
dc7a05ebf9 Rename types.Image.Manifest to types.Image.Inspect
Does not change behavior.

This better expresses the purpose of this method (it is working with
more, currently much more, than the manifest), and frees up the Manifest
method name for a simple getter of the raw blob.
2016-05-16 20:24:39 +02:00
Miloslav Trmač
e4913bd0b0 Add GetIntendedDockerReference to types.Image and types.ImageSource
This will be necessary for signature verification and related policy
evaluation in the future.
2016-05-16 19:25:11 +02:00
Miloslav Trmač
feb9de4845 Add GetManifest and GetSignatures to types.Image
No change in behavior.

These functions are guaranteed-cached versions of the same method in
types.ImageSource.  Both will be needed for signature policy evaluation,
and the symmetry with ImageSource is nice.

Also replaces the equivalent RawManifest method, preferring to keep
the same naming convention as types.ImageSource.
2016-05-16 19:25:11 +02:00
Miloslav Trmač
f526328b30 Move directory, docker and openshift from cmd/skopeo to their own subpackages
Does not change behavior.  This is a straightforward move and update of
package references, except for:

- Adding a duplicate definition of manifestSchema1 to
  cmd/skopeo/copy.go.  This will need to be cleaned up later, for now
  preferring to make no design changes in this commit.
- Renaming parseDockerImage to NewDockerImage, to both make it public
  and consistent with common golang conventions.
2016-05-16 18:32:32 +02:00
Antonio Murdaca
50a2ed1124 fix CI and remove docker/ dir
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-22 15:50:41 +01:00
Antonio Murdaca
7be01242a8 remove duplicate code
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-22 15:50:40 +01:00
Antonio Murdaca
6a00ce47d2 import cifetch code and add layers command
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-17 11:48:04 +01:00
Antonio Murdaca
3fd3adc58e support multi commands
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-16 10:06:31 +01:00
Antonio Murdaca
8094910c9a adapt code for projectatomic github
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-08 09:32:20 +01:00
Antonio Murdaca
82b121caf1 update docker code and adapt code
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-04 16:50:37 +01:00
Antonio Murdaca
3eefe215e0 support insecure registries
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-29 11:44:51 +01:00
Antonio Murdaca
7d7fb3c4b0 remote sudo_user, upstream has it
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-27 11:49:51 +01:00
Antonio Murdaca
b77535feee add todo authconfigs fallthrough
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-22 15:04:55 +01:00
Antonio Murdaca
a09019661e support $SUDO_USER
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-22 14:39:12 +01:00
Antonio Murdaca
1d452edce6 make space for appc img inspect :)
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-07 18:07:01 +01:00