Skip to content

Commit

Permalink
Add support for containers/storage
Browse files Browse the repository at this point in the history
Add containers/storage as a backend type called 'oci-storage'.

The image's blobs are stored either as oci-storage layers (if they look
like archived layers) or (alongside the manifest and signatures) as
named big data items associated with the image.

Inspection data and record-keeping (so that we can remember which blobs
were layers and which weren't) are encoded as a JSON object which is
stored as the oci-storage image's metadata.

The type of compression which we detected around a layer blob when it
was imported is encoded as a field in a JSON object which is stored as
the oci-storage layer's metadata, and is applied if we need to export
the layer later.

If we find ourselves importing an image with the same ID as an image
that we already have, we return an error.  If we find ourselves
importing an image which contains layers which we already have, we flag
an error if its contents differ from the one we already have, otherwise
we accept it.

If we find ourselves importing an image that wants to be tagged with a
name that is already in use, the name is assigned to the new image and
the old image remains otherwise unmodified.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
  • Loading branch information
nalind committed Sep 8, 2016
1 parent 58dedd8 commit c111f3e
Show file tree
Hide file tree
Showing 7 changed files with 665 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
addons:
apt:
packages:
- btrfs-tools
- libdevmapper-dev
- libgpgme11-dev
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ SKOPEO_REPO = projectatomic/skopeo
SKOPEO_BRANCH = master
# Set SUDO=sudo to run container integration tests using sudo.
SUDO =
BUILDFLAGS = -tags "btrfs_noversion libdm_no_deferred_remove"

all: deps .gitvalidation test validate

deps:
go get -t ./...
go get -u github.com/golang/lint/golint
go get github.com/vbatts/git-validation
go get -t $(BUILDFLAGS) ./...
go get -u $(BUILDFLAGS) github.com/golang/lint/golint
go get $(BUILDFLAGS) github.com/vbatts/git-validation

test:
@go test -cover ./...
@go test $(BUILDFLAGS) -cover ./...

# This is not run as part of (make all), but Travis CI does run this.
# Demonstarting a working version of skopeo (possibly with modified SKOPEO_REPO/SKOPEO_BRANCH, e.g.
Expand Down
Loading

0 comments on commit c111f3e

Please sign in to comment.