Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/oci-cas: Add tar and zip support for file URIs
This lets us extract blobs from layout archives. For example: $ cat cas-engines.json [ { "config": { "protocol": "oci-cas-template-v1", "uri": "blobs/{algorithm}/{encoded}" }, "uri": "file:///" } ] $ unzip -l hello-world.zip Archive: hello-world.zip Length Date Time Name --------- ---------- ----- ---- 0 10-14-2017 16:34 blobs/ 0 10-14-2017 16:34 blobs/sha256/ 14 10-14-2017 16:34 blobs/sha256/c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31 --------- ------- 14 3 files $ oci-cas --zip-file hello-world.zip sha256:c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31 <cas-engines.json Hello, World! The tar implementation doesn't quite work: $ tar -tf hello-world.tar ./ ./blobs/ ./blobs/sha256/ ./blobs/sha256/c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31 $ ./oci-cas --tar-file hello-world.tar sha256:c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31 <cas-engines.json FATA[0000] failed to retrieve sha256:c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31 I think omeid/go-tarfs needs some love. Signed-off-by: W. Trevor King <wking@tremily.us>
- Loading branch information