fix: image ref parse consistency in storage - #247
Conversation
| ); | ||
| return CacheDecision::UseCache(info); | ||
| } | ||
| Err(e) => CacheDecision::Fail(format!("cache query failed: {e}")), |
There was a problem hiding this comment.
This is a tidbit I'm uncertain about; is there a reason to fail when manifest parsing errors out? This can easily be swapped out for just pulling instead
There was a problem hiding this comment.
Are there cases that lead to manifest failures where it is still wise to continue to pull?
My thinking is that there isn't a good reason to fail to parse the manifest ever unless something unrecoverable has happened.
There was a problem hiding this comment.
Yeah, it does seem like in most cases we'd just end up pulling instead of panicking. If we have an io/parse error, we can always just remove the manifest and pull, similar to how we do when there's missing layers.
If we panicked and didn't remove the manifest when it's corrupted or otherwise blocking the pull, then subsequent pulls for that image would always fail which seems undesirable.
There was a problem hiding this comment.
At call site, we now handle the Err branch by performing cleanup
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you: Chapters generated by Stage for commit e9fe1cf on May 28, 2026 7:25pm UTC. |
#246
I ran into this ^ while working on a project that has
smolvmupstream and ended up down the rabbit hole. This is one of my first "real" chunks of work in Rust, so don't be shy about rejecting/tearing down the PR.Thanks for reading!
Changes:
query_imageand call sitesTODO:
Reference['digest']over toOption<String>