-
Notifications
You must be signed in to change notification settings - Fork 69
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 nri removeMount does not work bug #87
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -322,6 +322,11 @@ func (r *result) adjustMounts(mounts []*Mount, plugin string) error { | |
r.reply.adjust.Mounts = append(r.reply.adjust.Mounts, m) | ||
} | ||
|
||
// need add del mount, containerd needs to process this del mounts | ||
for _, m := range del { | ||
r.reply.adjust.Mounts = append(r.reply.adjust.Mounts, m) | ||
} | ||
Comment on lines
+326
to
+328
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @liangjingtao11 I think doing it this way breaks cases where a single plugin does a RemoveMount() followed by an AddMount(), both using the same destination. This is the idiomatic way for a plugin to change a mount in the case where that mount might have been injected (or updated) by another plugin earlier in the chain. But I think with your changes in place, that will end up with a final adjustment which causes the runtime to remove such a mount (by destination) from the container. |
||
|
||
// finally, apply additions/modifications to plugin container creation request | ||
create.Container.Mounts = append(create.Container.Mounts, add...) | ||
|
||
|
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.
nitpick: I would change 'containerd' in the above comment to 'runtime'. Maybe rephrase to something like ' add deleted mounts, the runtime needs them to properly remove deleted mounts'.