-
Notifications
You must be signed in to change notification settings - Fork 3.8k
add a special handling for readonly overlay mounts from active snapshot #6114
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
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 |
qiutongs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test
| for i, m := range upper { | ||
| if m.Type == "overlay" { | ||
| upper[i].Options = readonlyOverlay(m.Options) | ||
| continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it simpler to just append the upper instead of prepending?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]