Skip to content

Update plugin config migration to run on load#12608

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:migration-logic-update
Mar 13, 2026
Merged

Update plugin config migration to run on load#12608
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:migration-logic-update

Conversation

@dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Dec 2, 2025

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 Graph call time and 99% reduction in memory allocation, making the extra call to Graph negligible.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LoadConfigWithPlugins function 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.

@dmcgowan dmcgowan force-pushed the migration-logic-update branch 2 times, most recently from f8896ba to e4f8043 Compare December 2, 2025 07:46
@dmcgowan dmcgowan added this to the 2.3 milestone Dec 3, 2025
@dmcgowan dmcgowan force-pushed the migration-logic-update branch from e4f8043 to a8fcb22 Compare January 7, 2026 19:52
@github-project-automation github-project-automation bot moved this from Needs Reviewers to Review In Progress in Pull Request Review 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]>
@dmcgowan dmcgowan force-pushed the migration-logic-update branch from a8fcb22 to 0d7fee0 Compare February 19, 2026 17:18
dmcgowan added a commit to dmcgowan/containerd that referenced this pull request Mar 6, 2026
dmcgowan 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 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
Copy link
Member

@austinvazquez austinvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we can bump containerd/plugin separately

@dmcgowan dmcgowan added this pull request to the merge queue Mar 13, 2026
Merged via the queue into containerd:main with commit efc4825 Mar 13, 2026
92 of 94 checks passed
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Pull Request Review Mar 13, 2026
github-actions bot added a commit to dmcgowan/containerd that referenced this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

6 participants