Repository navigation
feat(oci): directly load from cache if possible - #14466
Conversation
|
Draft because of the base PR. |
|
Rebased on main. Ready for review. |
|
we released v5.7.1 with some significant changes in the oci cache layout, please rebase (again) - sorry for the mess |
|
Heh, I was about to do this. Rebased now. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
The riscv64 build seems to also fail on main because of a missing image? |
|
Rebased. |
Fixes docker#14460. If an oci artifact is sha-pinned and we have it in the cache, don't even talk to the registry. The primary use case is operational safety in case of registry failure: This allows to still work with a compose config that `includes: oci://` if it has been pulled before. This aligns the behavior with docker itself: images are kept locally, so it is not necessary for the registry to be up to, say, recreate an existing container with a modified environment. Signed-off-by: Tobias Schlatter <schlatter.tobias@gmail.com>
|
Rebased. @ndeloof I'm permitting myself to mention you explicitly here (since it seems you've been somewhat actively working on the oci subsystem). Is there anything I can do to move this forward? Having a solution for oci includes to work when our main registry is down is important to us. Any chance you could give me a gut feeling of whether the overall idea seems reasonable and mergeable?(Independent of the specific code / implementation, I'm just trying to figure out if I need to look for other solutions). TY!! |
|
|
||
| // if the ref has a digest eagerly look in the local cache. | ||
| // (still works if the registry is down) | ||
| if ref, ok := ref.(reference.Digested); ok { |
There was a problem hiding this comment.
nit: ref shadows the outer ref here; if digested, ok := ref.(reference.Digested); ok reads better.
|
Thank you! |

What this PR does
If an oci artifact is sha-pinned and we have it in the cache, don't
even talk to the registry.
The primary use case is operational safety in case of registry failure:
This allows to still work with a compose config that
includes: oci://if it has been pulled before.This aligns the behavior with docker itself: images are kept locally,
so it is not necessary for the registry to be up to, say, recreate an
existing container with a modified environment.
Related issue
Fixes #14460.
Changes made
Testing done
make testmake e2e-composeormake e2e-compose-standalone(fail locally, looks like infrastructure failure, similar failures on main)make lintmake fmtAdditional context
Depends / based on #14462