Commit Graph

3159 Commits

Author SHA1 Message Date
Antonio Murdaca
f43a92a78f *: split docker.go for future pkg creation
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-09 21:13:17 +02:00
Antonio Murdaca
9229d72a37 Merge pull request #48 from mtrmac/gpgme-update
Rerun hack/vendor.sh to pick up gpgme changes
2016-05-07 11:35:49 +02:00
Miloslav Trmač
5a2b4005bb Rerun hack/vendor.sh to pick up gpgme changes
In particular, https://github.com/proglottis/gpgme/pull/8 .
2016-05-07 02:33:51 +02:00
Antonio Murdaca
9d24de4c57 Merge pull request #45 from mtrmac/gpgme-update
Rerun hack/vendor.sh to pick up gpgme changes
2016-05-06 22:58:53 +02:00
Miloslav Trmač
fe37c71a4f Rerun hack/vendor.sh to pick up gpgme changes
See https://github.com/proglottis/gpgme/pull/7 for the full discussion.

Resolves #42 .
2016-05-06 22:44:30 +02:00
Antonio Murdaca
28973c0a2d Merge pull request #43 from mtrmac/openshift-copypasta
Add Atomic Registry support for push and pull, and a new “copy” command
2016-05-05 15:39:28 +02:00
Miloslav Trmač
026acb2a57 Add a --sign-by flag to the (skopeo copy) command.
This expects a GPG key fingerprint as a value of the argument (though
other key identification methods, like mitr@volny.cz, happen to work).

Do we need to namespace this (gpg:…)?

Note that this is unusable at the moment because only the dir: backend
implements storing signatures, and this backend does can not determine
the canonical Docker reference to use as a signed image identity.
2016-05-04 17:32:51 +02:00
Miloslav Trmač
da24e319af Add CanonicalDockerReference to ImageDestination
This is necessary to resolve the canonical form of a reference for
signing it.
2016-05-04 17:32:51 +02:00
Miloslav Trmač
2e48975b8b Add a "copy" command for copying images
This copies an image from ImageSource to ImageDestination, e.g.

skopeo copy atomic:mitr/busybox:latest dir:t-down # pull
skopeo copy dir:t-up atomic:mitr/busybox:latest # push
2016-05-04 17:32:51 +02:00
Miloslav Trmač
56f9c987a2 Add utilities for parsing Docker URIs into ImageSource and ImageDestination objects
This finally uses all of the ImageSource and ImageDestination
implementations, though these utilities are in turn not used yet.

Adds unresolved FIXME (FIXME!!) notes for the tlsVerify default value;
for now, the code follows the existing parseImage semantics.

Also note the naming inconsistency: dir:…, atomic:…, but
docker://… .  I think the non-// names are cleaner, but if we are
committed to docker://…, just being consistent might be better.
2016-05-04 17:32:51 +02:00
Miloslav Trmač
36d4353229 Add OpenShift implementations of ImageSource and ImageDestination
Note that this assumes that both (docker login) and (oc login) has
happened, the credentials can be read from the usual config files,
and that the default OpenShift instance should be used.

This includes copy&pasted/modified/simplified code from OpenShift
and Kubernetes, primarily for config file parsing and setting up
TLS and HTTP authentication.

This is much smaller than linking to the upstream OpenShift client
libraries, which via various abstractions and registration drag in much
(dozens of megabytes) more code.

The primary loss from this simplification is automatic conversions
between various versions of the API objects, both for the REST API and
for local configuration storage.

This does not contain downloading/uploading signatures, which depends on
server-side support.
2016-05-04 17:32:51 +02:00
Miloslav Trmač
935eee7592 Add an ImageDestination implementation for the Docker Registry
Note that this does not allow uploading under new tags; Docker Registry
requires the tag to be present within the manifest, i.e. we might need
to modify the (possibly signed) manifest.

For now, uploading manifests only identified by a digest is sufficient
for the Atomic Registry; tagging happens in OpenShift imagestreams.
2016-05-04 17:32:51 +02:00
Miloslav Trmač
0587501ff0 Split dockerClient from dockerImageSource
The dockerClient encapsulates makeRequest and authentication setup, and
will be shared between the pull and push code.

This is only a restructuring, does not change behavior.

The dockerImage->dockerImageSource->dockerClient inclusion chain is
somewhat ugly, hopefully eventually we will move the remaining
dockerImage functionality either to dockerutils or to the top level, and
then eliminate it.
2016-05-04 17:32:51 +02:00
Miloslav Trmač
2790d9a1c3 Make dockerutils.GuessManifestMIMEType public
The Docker Registry manifest upload should supply a Content-Type, and
guessing from the contents is the easiest we can do right now.

Also eliminate dockerutils.manifestMIMEType, it is making it too
difficult to use the returned value to be worth the extra safety.
2016-05-04 17:32:51 +02:00
Antonio Murdaca
696eb74918 Merge pull request #30 from mtrmac/cleanups
Cleanups
2016-05-04 17:29:14 +02:00
Miloslav Trmač
654050b7e8 Fix handling of !tlsVerify when certPath is not set 2016-05-04 17:19:59 +02:00
Miloslav Trmač
7bee2da169 Use the provided method in dockerImageSource.makeRequest instead of hard-coding GET 2016-05-04 17:19:59 +02:00
Miloslav Trmač
60fbdd3988 Do not assume GetManifest is called before other dockerImageSource methods
Call dockerImageSource.ping() in .makeRequest() if needed, instead of
expecting a caller to do it (which only happened in GetManifest).

This required splitting the URLs into the baseURL (dependent on .ping()
result) and the suffix (independent of it), which was a simplification
anyway.

Also rename WWWAuthenticate to wwwAuthenticate, it is a private cache
field.
2016-05-04 17:19:59 +02:00
Miloslav Trmač
14bc664b48 Remove a redundant dockerImageSource.makeRequest parameter
It is always computed in the same, or equivalent, way.

Also remove pingResponse.needsAuth, only used in the above.
2016-05-04 17:19:59 +02:00
Antonio Murdaca
749a8e3b82 Merge pull request #38 from jwhonce/wip/manpage
Add disclaimer to man page for sign-* commands
2016-05-04 17:10:06 +02:00
Jhon Honce
0470e7fb0f Add disclaimer to man page for sign-* commands
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2016-05-04 07:36:38 -07:00
Antonio Murdaca
266f0b8487 Merge pull request #29 from mtrmac/source-dest
Add ImageSource and ImageDestination abstractions
2016-05-04 13:03:23 +02:00
Miloslav Trmač
fd41449410 Use dirImageDestination for writing to local files in docker.go
This will hopefully allow better reuse of the "copy images" code from
docker.go in the future.

No behavior change, the dirImageDestination code was based on the code
this commit is replacing.
2016-05-02 19:43:16 +02:00
Miloslav Trmač
af126bc68c Add an ImageSource and ImageDestination implementation for local directories
This is consistent with the (skopeo layers) storage layout; otherwise it
is expected to be used primarily as an a debugging aid when working on
more complex image transfers (e.g. directly from OpenShift to a running
Docker daemon), allowing them to be split to two simpler problems
between one complex storage mechanism and a simple directory.

Not used yet, users will be added in future commits.
2016-05-02 19:43:16 +02:00
Miloslav Trmač
e169c311d3 Add an ImageSource implementation to docker.go
The ImageSource type does not provide all of the functionality of
docker.go, but we will be able to reuse the ImageSource parts in an
OpenShift client.

This is only a restructuring, does not change behavior.
2016-05-02 19:43:16 +02:00
Miloslav Trmač
a4aedae063 Add types.ImageSource and types.ImageDestination
Right now, only a declaration.

This will allow writing generalized push/pull between various storage
mechanisms, and reuse of the Docker Registry client code for the Docker
Registry embedded in OpenShift.
2016-05-02 19:43:16 +02:00
Antonio Murdaca
aff6aa7c2c Merge pull request #41 from projectatomic/fix-url
docker.go: do not concatenate url in ping
2016-04-29 16:51:38 +02:00
Antonio Murdaca
6d74750bba docker.go: do not concatenate url in ping
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-04-29 15:23:06 +02:00
Antonio Murdaca
2b3a4cfdfe Merge pull request #39 from mtrmac/update-gpgme
Update mtrmac/gpgme vendor to fix build on CentOS 7
2016-04-26 18:30:20 +02:00
Miloslav Trmač
e76eecd533 Update mtrmac/gpgme vendor to fix build on CentOS 7 2016-04-26 17:57:40 +02:00
Antonio Murdaca
dfc6352108 Merge pull request #37 from mtrmac/v2s1-manifest-followup
v2s1 manifest followup
2016-04-25 18:08:54 +02:00
Miloslav Trmač
23899acadd Create a new subpackage "dockerutils", starting with manifest computation
Move the manifest computation (with v2s1 signature stripping) out of
skopeo/signature into a separate package; it is necessary in the
OpenShift client as well, unrelated to signatures.

Other Docker-specific utilities, like getting a list of layer blobsums
from a manifest, may be also moved here in the future.
2016-04-25 17:27:51 +02:00
Miloslav Trmač
7a7dd84818 Fix fixture file name
It is “manifest version 2, schema 1”, not v1.
2016-04-25 17:27:51 +02:00
Antonio Murdaca
8374928f74 Merge pull request #35 from jwhonce/wip/manpage
Update man page
2016-04-22 09:13:31 +02:00
Jhon Honce
b52d3c85c6 * Update Authors 2016-04-21 13:44:12 -07:00
Jhon Honce
eab73f3d51 Update man page
Resolves https://github.com/projectatomic/skopeo/issues/12

* Convert man page from markdown to nroff
* Fill out man page
* Remove TODO's from go code regarding man page
* Additional information on building instructions
* Update Makfile

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2016-04-21 09:46:02 -07:00
Antonio Murdaca
918a4d9110 Merge pull request #36 from projectatomic/fix-creds
fix invalid credentials error
2016-04-21 15:33:14 +02:00
Antonio Murdaca
c7be79e190 fix invalid credentials error
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-04-21 14:32:49 +02:00
Antonio Murdaca
28f2fedab9 Merge pull request #34 from mtrmac/v1s1-manifest-digest
Strip signatures from v1s1 manifests before computing the digest
2016-04-19 18:03:57 +02:00
Miloslav Trmač
4e19770a1b Strip signatures from v1s1 manifests before computing the digest 2016-04-19 17:37:04 +02:00
Antonio Murdaca
68a614d463 Merge pull request #33 from mtrmac/cgo-pthread-ordering-workaround
Add a workaround for a glibc bug when -lphtread precedes -lgpgme
2016-04-13 22:40:58 +02:00
Miloslav Trmač
e782275c2e Add a workaround for a glibc bug when -lphtread precedes -lgpgme 2016-04-13 21:42:19 +02:00
Antonio Murdaca
9d10b0b4ea Merge pull request #32 from mtrmac/integration-diagnostics
Test command output before eror status in signing integration tests
2016-04-12 10:11:39 +02:00
Miloslav Trmač
dd7c2d44fa Log command output on failures in signing integration tests 2016-04-11 17:41:57 +02:00
Antonio Murdaca
c4e48c8f85 Merge pull request #31 from mtrmac/vendor-fixes
Vendor fixes
2016-04-07 09:00:01 +02:00
Miloslav Trmač
f7b81b5627 Fix dependency computation
Set GOPATH to start with ./vendor so that we use the dependencies in our
vendored versions instead of dependencies in whatever other version is
elsewhere in GOPATH.

And then undo it when trying to list the non-vendor subpackages in the
current directory.
2016-04-05 17:46:58 +02:00
Miloslav Trmač
96b96735ed Allow keeping vendor subdirectories in vendored packages
github.com/coreos/etcd as of v2.2.5 uses a Godeps subdirectory, and
imports packages by including the Godeps path fragments directly in the
package name; so we can't just remove the subdirectory and vendor the
included package directly.  So, add a flag to clone() to surpress
removing the vendor subdirectories.
2016-04-05 17:46:53 +02:00
Antonio Murdaca
d7ae061a83 Merge pull request #28 from runcom/fix-gitcommit
remove cmd/ subdir
2016-03-25 12:21:26 +01:00
Antonio Murdaca
1423aab202 remove cmd/ subdir
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-25 12:14:43 +01:00
Antonio Murdaca
9e982f0b1d Merge pull request #25 from mtrmac/signing
Signing
2016-03-24 17:40:30 +01:00