-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oci/cas/cas/dir: Drop supported-algorithm check in blobPath #197
Conversation
The Travis failure looks like a network hiccup. I expect this PR will pass if you kick the tests again. |
I'm not really sure about using
Yeah, this is because |
On Wed, Oct 18, 2017 at 04:24:12PM -0700, Aleksa Sarai wrote:
I'm not sure, because I might want to change it in the future
irrespective of what Steven thinks the best algorithm is).
In that case you may want to have a distinct-from-go-digest opinion.
But you vendor go-digest. Maybe you want this change, and you can
always drag BlobAlgorithm back out if go-digest does something crazy.
Yeah, this is because `umoci` doesn't have support for different
types of blob hashes. The main reason for this is because I wasn't
sure how exactly the UI should look for choosing a hash…
Get and delete don't seem like they'd need algo-choosing UIs. Put
might support that; see wking/casengine@b1ec59028 for one potential
API (although you'd have to decide how to expose that downstream).
|
Without having support in |
0c33ca1
to
c1fab82
Compare
Because: * PutBlob is calling Digester before it calls blobPath, and Digester will have already panicked on an unavailable algorithm. * GetBlob will no longer error on usupported algorithms, but it should be up to the GetBlob consumer performing the validation to decide if the algorithm is supported or not. I don't see why dir needs to have an opinion on this. * DeleteBlob will no longer error on unsupported algorithms. But if the caller asked us to delete a blob, I think we should delete it regardless of whether we can hash the blob contents. Signed-off-by: W. Trevor King <wking@tremily.us>
On Tue, Oct 31, 2017 at 01:13:40AM +0000, Aleksa Sarai wrote:
> Get and delete don't seem like they'd need algo-choosing UIs. Put
> might support that; see ***@***.*** for one potential
> API (although you'd have to decide how to expose that downstream).
Without having support in `Put` for choosing hashes (and code in
`mutate` that makes a decision on whether to use the previous hash,
our default, or something a user picked) then the current way
`umoci` will handle mixed hashes doesn't feel quite right…
|
@wking I'm not sure you understood what I was saying. What I was saying is that currently we error out if we have an image that has a "mixed hashes" setup (more than one hash in use, or using a hash that we don't use by default). I agree with you that this is not correct, and needs to be fixed. However, the fix cannot just be removing the error condition -- now |
Good point. But I think "the new blobs we push use our preferred algo, even though you may have preferred a different one" is still friendlier than erroring out with "sorry, we don't deal with that algorithm". Adding configurable put algos can happen in follow-up work. |
This is still something we should do, but this PR is quite stale and as I mentioned sigh three years ago this would require some more work to make sense. |
I don't see a point to having a local preference distinct from the go-digest maintainer's suggestion.I've dropped the supported check in dir's
blobPath
, because:PutBlob
is callingDigester
before it callsblobPath
, andDigester
will have already panicked on an unavailable algorithm.GetBlob
will no longer error on usupported algorithms, but it should be up to theGetBlob
consumer performing the validation to decide if the algorithm is supported or not. I don't see why dir needs to have an opinion on this.DeleteBlob
will no longer error on unsupported algorithms. But if the caller asked us to delete a blob, I think we should delete it regardless of whether we can hash the blob contents.Spun off from here.