add a special handling for readonly overlay mounts from active snapshot#6114
add a special handling for readonly overlay mounts from active snapshot#6114zouyee wants to merge 1 commit intocontainerd:mainfrom
Conversation
|
Hi @zouyee. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
e5fb63b to
8936eef
Compare
|
Build succeeded.
|
|
@tonistiigi @dmcgowan ptal |
Signed-off-by: Zou Nengren <[email protected]>
|
Build succeeded.
|
|
For the #6077 , it can be fixed that the running container should be paused and use REF: https://github.com/containerd/containerd/blob/main/snapshots/overlay/overlay.go#L77 |
| for i, m := range upper { | ||
| if m.Type == "overlay" { | ||
| upper[i].Options = readonlyOverlay(m.Options) | ||
| continue |
There was a problem hiding this comment.
This "continue" seems unnecessary?
| for _, o := range opt { | ||
| if strings.HasPrefix(o, "upperdir=") { | ||
| upper = strings.TrimPrefix(o, "upperdir=") | ||
| } else if !strings.HasPrefix(o, "workdir=") { |
There was a problem hiding this comment.
This is basically "index" and "lowerdir"?
| if upper != "" { | ||
| for i, o := range out { | ||
| if strings.HasPrefix(o, "lowerdir=") { | ||
| out[i] = "lowerdir=" + upper + ":" + strings.TrimPrefix(o, "lowerdir=") |
There was a problem hiding this comment.
Is it simpler to just append the upper instead of prepending?
There was a problem hiding this comment.
Order of the dirs in lowerdir= option does matter. Leftmost dir represents the top layer of the mount. See multiple-lower-layers.
| } | ||
| } | ||
|
|
||
| func readonlyOverlay(opt []string) []string { |
There was a problem hiding this comment.
Suggest to add comments or rename this function to something like removeUpperdirForReadonlyOverlay, to be more descriptive.
|
Any news here? I'd be happy to take over it and make the requested changes. |
Add a special handling for readonly overlay mounts from active snapshots that removes the upper directory.
xref:moby/buildkit#1100
fix: #6077
Signed-off-by: Zou Nengren [email protected]