api: fix OCI hook ownership tracking.#264
Open
klihub wants to merge 2 commits intocontainerd:mainfrom
Open
Conversation
Fix hook ownership tracking and add a proper test case for it. Ownership tracking for OCI hooks is supposed to be accumulative. The implementation tried to accumulate owners, but it was buggy. It tried to delete existing ownership by unclaiming which marks ownershipdeleted by the plugin instead of clearing it. This went unnoticed since we lacked any kind of proper test for hook ownership accumulation. It was only noticed thanks to containerd#263 which switches much of the ownership tracking code to generated from hand-written. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
b360c00 to
95ba09f
Compare
samuelkarp
reviewed
Jan 16, 2026
Verify that a registered plugin name is not empty and only contains characters from the set [a-zA-Z0-9_.+-]. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
6f103f3 to
91a7760
Compare
samuelkarp
approved these changes
Jan 20, 2026
| if req.PluginName == "" { | ||
| p.regC <- fmt.Errorf("plugin %q registered with an empty name", p.qualifiedName()) | ||
| return &RegisterPluginResponse{}, errors.New("invalid (empty) plugin name") | ||
| if err := api.CheckPluginName(req.PluginName); err != nil { |
Member
There was a problem hiding this comment.
This is technically a breaking change now 😢
I think we should still take it in, but we need to make that clear in release notes.
Member
Author
There was a problem hiding this comment.
Yeah, even if we relaxed the new check to only explicitly disallow commas, it still would be a breaking change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix hook ownership tracking and add a proper test case for it.
Ownership tracking for OCI hooks is supposed to be accumulative. The implementation tried to accumulate owners, but it was buggy. It tried to delete existing ownership by unclaiming which marks ownershipdeleted by the plugin instead of clearing it.
This went unnoticed since we lacked any kind of proper test for hook ownership accumulation. It was only noticed thanks to #263 which switches much of the ownership tracking code to generated from hand-written.