Add plugin system for external subcommands#202
Add plugin system for external subcommands#202adrianreber wants to merge 2 commits intocheckpoint-restore:mainfrom
Conversation
Add support for external plugins that extend checkpointctl with additional subcommands. Plugins are discovered by scanning PATH for executables named checkpointctl-<name>, where <name> becomes the subcommand. This plugin architecture allows extending checkpointctl functionality without increasing the binary size of the core tool. Plugins with larger dependencies can be distributed separately, keeping the main checkpointctl binary lightweight. Additionally, plugins can be implemented in any programming language, enabling contributors to use the tools and libraries best suited for their specific use case. Features: - Auto-discovery of plugins in PATH at startup - Plugin description support via --plugin-description flag - Built-in commands take precedence over plugins - First plugin in PATH wins for duplicate names - New "plugin list" subcommand to show available plugins Generated with Claude Code (https://claude.ai/code) Signed-off-by: Adrian Reber <areber@redhat.com>
Add documentation for the new plugin system: - Add checkpointctl-plugin.adoc man page - Update checkpointctl.adoc with missing commands (build, list, plugin) - Add plugin section to README.md with usage examples Generated with Claude Code (https://claude.ai/code) Signed-off-by: Adrian Reber <areber@redhat.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
==========================================
+ Coverage 76.00% 76.51% +0.50%
==========================================
Files 13 14 +1
Lines 1288 1388 +100
==========================================
+ Hits 979 1062 +83
- Misses 232 242 +10
- Partials 77 84 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Binary Size Check FailedThe binary size increase exceeds the allowed threshold. Size Check OutputHow to resolveIf this size increase is expected and acceptable, a maintainer can add Binary size check performed by CI |
|
@adrianreber If I understand correctly, this is somewhat similar to kubectl's plugin mechanism. Is that correct? |
Exactly, that way the size of the binary does not increase automatically. |
This PR introduces a plugin architecture that allows extending checkpointctl with additional subcommands. Plugins are discovered by scanning PATH for executables named
checkpointctl-<name>, where<name>becomes the subcommand. This approach keeps the main binary lightweight by allowing plugins with larger dependencies to be distributed separately, and enables contributors to implement plugins in any programming language.--plugin-descriptionflagplugin listsubcommand to show available plugins