Commit Graph

17 Commits

Author SHA1 Message Date
haoyun
bbe46b8c43 feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08:00
haoyun
c0d07094be feat: Errorf usage
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-13 14:31:53 +08:00
Stephen Day
4615111ba2
content/local: validate digest before calculating path
Signed-off-by: Stephen Day <stephen.day@getcruise.com>
2020-04-09 17:37:47 -07:00
Tonis Tiigi
5b9bd993a8 differ: fix deadlock on commit error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-25 17:50:17 -07:00
Derek McGowan
0f756495a9
Fix writer deadlock in local store
The local store could end up in a state where the writer is
closed but the reference is locked after a commit on an
existing object.
Cleans up Commit logic to always close the writer even after
an error occurs, guaranteeing the reference is unlocked after commit.
Adds a test to the content test suite to verify this behavior.
Updates the content store interface definitions to clarify the behavior.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-10-15 16:33:45 -07:00
Derek McGowan
6875d3df3a
Always check exists on commit error
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-14 01:26:03 -07:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Daniel Nephin
9184908075 Fix image pull after a failure
When resuming from a failed pull writer.Truncate() was not
seeking to the proper position in the file. This caused writes to
happen after the previously written content, instead of at the start
of the file.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-12-13 18:24:12 -05:00
Stephen J Day
3e5e2ecc0a content/local: consistent handling of data and locks
The locks now retry on the backend side to prevent clients from having
to round trip on locks that might be momentarily held. This exposed some
timing errors in the updated_at fields for content ingest, so we've had
to move that to a separate file to export the monotonic go runtime
timestamps.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-16 16:13:19 -05:00
Derek McGowan
7b08bcdb65
Add support for label storage in local content store
Allows running tests which require labels on the content store

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-31 12:59:52 -07:00
Derek McGowan
64a96aab8a
Abort newly created references on error
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:10:19 -07:00
Derek McGowan
9613acb2ed
Add context to content commit
Content commit is updated to take in a context, allowing
content to be committed within the same context the writer
was in. This is useful when commit may be able to use more
context to complete the action rather than creating its own.
An example of this being useful is for the metadata implementation
of content, having a context allows tests to fully create
content in one database transaction by making use of the context.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-09-06 10:19:12 -07:00
Derek McGowan
c71066252b
Ensure content writer only unlocks resource once
Make close a no-op after commit and disallow committing after close.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-21 14:54:51 -07:00
Derek McGowan
dee8dc2cda
Add support for content labels on commit
Add commit options which allow for setting labels on commit.
Prevents potential race between garbage collector reading labels
after commit and labels getting set.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-11 14:15:20 -07:00
Derek McGowan
a437d140f8
Remove oci package
Replace functionality in client with simple tar writer

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-11 11:48:14 -07:00
Akihiro Suda
b518f11dba client: add Import() and Export() for importing/exporting image in OCI format
Export as a tar (Note: "-" can be used for stdout):

    $ ctr images export /tmp/oci-busybox.tar docker.io/library/busybox:latest

Import a tar (Note: "-" can be used for stdin):

    $ ctr images import foo/new:latest /tmp/oci-busybox.tar

Note: media types are not converted at the moment: e.g.
  application/vnd.docker.image.rootfs.diff.tar.gzip
  -> application/vnd.oci.image.layer.v1.tar+gzip

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-07-28 04:47:53 +00:00
Derek McGowan
bb3c9c5927
Rename content/fs to content/local
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 10:11:35 -07:00