feat: add external plugin backend via go-plugin#628
Open
maelanjais wants to merge 1 commit into
Open
Conversation
Add a `plugin` backend that loads any custom backend at runtime as a standalone binary, using HashiCorp go-plugin. Operators can extend confd with new sources without recompiling it. - pkg/backends/plugin/api: shared RPC DTOs, the BackendProvider interface, BackendRPCClient/BackendRPCServer, and the ConfdBackendPlugin boilerplate. - pkg/backends/plugin: a StoreClient that launches the external binary and proxies GetValues/WatchPrefix/HealthCheck/Close over RPC. - New `confd plugin --plugin-path` subcommand plus a `plugin_path` field in confd.toml. Registered in pkg/backends/client.go and pkg/backends/config.go. A self-contained reference plugin ships as cmd/confd-plugin-postgres: it implements the SDK against PostgreSQL (with LISTEN/NOTIFY) without depending on any confd internals, so it doubles as a copy-paste starting point for plugin authors. Includes RPC server/client unit tests (in-process mock), the SDK specification in PLUGIN_ARCHITECTURE.md, and an end-to-end walkthrough in PLUGIN_DEMO.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Splits the PostgreSQL half out of #621 as requested, so it can be assessed independently.
Add a
pluginbackend that loads any custom backend at runtime as a standalone binary, using HashiCorp go-plugin. Operators can extend confd with new sources without recompiling it.confd plugin --plugin-pathsubcommand plus aplugin_pathfield in confd.toml. Registered in pkg/backends/client.go and pkg/backends/config.go.A self-contained reference plugin ships as cmd/confd-plugin-postgres: it implements the SDK against PostgreSQL (with LISTEN/NOTIFY) without depending on any confd internals, so it doubles as a copy-paste starting point for plugin authors.
Includes RPC server/client unit tests (in-process mock), the SDK specification in PLUGIN_ARCHITECTURE.md, and an end-to-end walkthrough in PLUGIN_DEMO.md.