Comments (3)
I’m not sure. Once you successfully start reading a blob, there is really nothing else to do, so the API can be as simple as a Reader
. (Perhaps the underlying storage mechanism may require chunking and splitting the stream into several independent requests, but that would be fairly rare, and completely invisible to the caller.)
For writing, there may well be a “commit” step (e.g. rename()
from a temporary name to the final destination for files, a “mark this upload as done” step for the Docker registry API); and perhaps that “commit” should even happen per image, not once per blob. (Compare the cleanup
situation in #102 .)
I don’t know, perhaps that can be very cleanly done by using WriteCloser
and implementing that commit in Close
. It seems to me that using a WriteCloser
would result in both more complex callers and more complex implementations right now, though: for PutBlob(…Reader)
, the caller just calls PutBlob(…GetBlob())
. With a Writer, the caller needs to add an extra io.Copy
call. And looking at the current implementations:
dir:
andoci:
want to do aSync
docker://
andopenshift:
need to check the HTTP status code.
Both are easy to do in a single PutBlob(…Reader)
; with a WriteCloser
we would have to create a separate putBlobProgress
object or something.
Right now, it seems to me that just as a refactoring this would make the code just more complex.
Other aspects to consider:
- Progress reporting might be much easier if the
io.Copy
call, or equivalent, were in thecopy
top-level instead of individual destinations, and there were a Writer. (Right now we would probably have to implement aProgressReportingReader
to fit progress reporting into the API). - For signature verification, the
copy
top-level would really like to have a way to tell “yes this layer data matches the hash, commit / no this is all wrong, throw it away” to theImageDestination
. Right now we can just return an error in theReader.Read
and hope that theImageDestination
will delete the blob instead of keeping it around.
So I guess we will eventually need a more complex blob upload API; whether that would be a simple Writer
I am not sure. At least the verification aspect will need to be resolved soonish.
from skopeo.
@runcom @mtrmac @vrothberg THree year old issue, almost. Should we close this?
from skopeo.
We now do progress reporting, and it did not require an interface change to use io.Writer
.
At least as far as skopeo cares, this is an internal implementation details that users don’t care about, and we can change the API as necessary any time, so tracking this in skopeo makes little sense nowadays.
(As far as c/image cares, changing the API would require a major version bump, and anyway if it happens, it should be feature-driven. Right now destinations are easier to implement if they need a “blob commit“ step if they are given an io.Reader
and they are allowed to manage the process as necessary; other code structures, e.g. some kind of helper, might be possible, but without a clear reason to restructure this, let’s not worry about it.)
from skopeo.
Related Issues (20)
- How to use skopeo container with credential helpers? HOT 3
- Error verifying signature: Invalid GPG signature: (*packet.Signature)( "nil)" HOT 7
- Have issue with upgrading skopeo version to 1.8.1 in ubuntu 22.04 HOT 4
- Does skopeo supports loading local docker tar.gz file into remote registry? HOT 8
- Why does updating skopeo to the latest version remove docker packages? HOT 15
- Skopeo copy job creates .kube/config directory structure failing Azure AKS kubelogin convert-kubeconfig command HOT 3
- Store multiple images in single tar file HOT 4
- Skopeo 1.15.0 is not available in alpinelinux packages HOT 1
- `v1.15.0` Container not available on quay.io HOT 2
- Copy to docker-daemon overlay2 storage HOT 6
- Will using the copy command save image information locally? HOT 2
- Skopeo copy fails HOT 3
- Add support for microsoft bicep module definitions. HOT 2
- The checks in hack/ directory hardcode `cc' HOT 4
- The ubuntu version doesn't support --preserve-digests parameter HOT 1
- authentication required for ECR repo HOT 5
- Error while trying to encrypt container image with skopeo HOT 6
- Can't use skopeo 1.15.0 HOT 3
- Failed to sign image with sigstore private key when using Harbor registry server HOT 3
- Feature Request/Verification - list tags matching latest HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skopeo.