Skip to content
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

fix: try fetch lost layer when unpack image #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Desiki-high
Copy link

If someone removes the content or snapshot by-pass the cri plugin, cir in-memory metadata think the image exists. When we create sandbox or container, we can't find snapshot and unpack from the content layer with the discard_unpacked_layers CRI config. In that case, we can try fetch the lost image layer to complete create container.

example

  1. use discard_unpacked_layers=true CRI config with overlayfs, pulled OCI images.
  2. change snapshotter to nydus gloablly.
  3. try to create container with pulled OCI image before change sanpshotter.

In that case, we can't find snapshot with nydus sanpshotter. We can't unpack from the content store as well, because we use the discard_unpacked_layers=true config, the layer had discarded. We can try fetching the lost layer when unpacking image to fix this issue.

If someone removes the content or snapshot by-pass the cri plugin, cir in-memory metadata think
the image exists. When we create sandbox or container, we can't find snapshot and unpack from the
content layer with the `discard_unpacked_layers` cri config. In that case, we can try fetch the lost
image layer to complete create container.

Signed-off-by: Yadong Ding <[email protected]>
When CRI has config `discardUnpackedLayers`, we should allows GC to clean layers up from the content store after unpacking.
Use ctx to notificate unpack image to gc layer content when retry fetch lost layers.

Signed-off-by: Yadong Ding <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant