Update plugin config migration to run on load#12608
Merged
dmcgowan merged 1 commit intocontainerd:mainfrom Mar 13, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors configuration migration to occur during config load rather than during server initialization. The change prevents version conflicts when global config migrations happen separately from plugin migrations, and simplifies the configuration loading flow by handling all migrations (global and plugin) in a single pass.
Key Changes:
- Moved plugin configuration migration from server initialization to config loading
- Created
LoadConfigWithPluginsfunction that accepts a plugin iterator for migration - Removed migration logic from
server.New()function
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
cmd/containerd/server/server.go |
Removed migration logic and related imports from server initialization |
cmd/containerd/server/config/config.go |
Added LoadConfigWithPlugins function with integrated plugin migration support |
cmd/containerd/command/main.go |
Updated to use LoadConfigWithPlugins with plugin graph for migrations |
cmd/containerd/command/config.go |
Updated config dump command to use LoadConfigWithPlugins with plugin graph |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f8896ba to
e4f8043
Compare
e4f8043 to
a8fcb22
Compare
fuweid
approved these changes
Jan 7, 2026
djdongjin
approved these changes
Jan 17, 2026
Perform the plugin migrations on load to allow stepping through plugin migration versions to happen alongside migration of the global configuration object. When the configuration migrations happen separately, the version in the config can get increasd on load and cause plugin migration not to occur. This does not cause issues today because global config migrations only occur for version 0 and 1, which was before plugin config migration was introduced. Any new version which does migrations either cannot get called on load or will break plugin migration later. This change simplifies configuration load and migration, preventing the need to migrate the configurations on load and again later when plugins are loaded. This also allows includes to work at different versions, which may currently break or cause inconsistent results. Signed-off-by: Derek McGowan <[email protected]>
a8fcb22 to
0d7fee0
Compare
dmcgowan
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 6, 2026
Signed-off-by: Derek McGowan <[email protected]>
dmcgowan
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 7, 2026
Signed-off-by: Derek McGowan <[email protected]>
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 7, 2026
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 7, 2026
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 7, 2026
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 7, 2026
github-actions bot
added a commit
to akerouanton/containerd
that referenced
this pull request
Mar 8, 2026
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 9, 2026
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 10, 2026
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 10, 2026
austinvazquez
approved these changes
Mar 13, 2026
Member
austinvazquez
left a comment
There was a problem hiding this comment.
LGTM, we can bump containerd/plugin separately
github-actions bot
added a commit
to dmcgowan/containerd
that referenced
this pull request
Mar 19, 2026
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.
Perform the plugin migrations on load to allow stepping through plugin migration versions to happen alongside migration of the global configuration object. When the configuration migrations happen separately, the version in the config can get increasd on load and cause plugin migration not to occur. This does not cause issues today because global config migrations only occur for version 0 and 1, which was before plugin config migration was introduced. Any new version which does migrations either cannot get called on load or will break plugin migration later.
This change simplifies configuration load and migration, preventing the need to migrate the configurations on load and again later when plugins are loaded. This also allows includes to work at different versions, which may currently break or cause inconsistent results.
Note this will now call the plugin graph twice, once without any filter to perform all migrations, and later with the disabled filter. Since the disabled filter is part of the global configuration, it does not make sense to utilize it during configuration load.
Currently the plugin load has an inefficiency which is solved by containerd/plugin#8 and containerd/plugin#13 which together is a 300x improvement in
Graphcall time and 99% reduction in memory allocation, making the extra call toGraphnegligible.