Skip to content

refactor: add extension config#100

Merged
jmhbh merged 4 commits into
mainfrom
jmhbh/controller-extension-points
Nov 18, 2025
Merged

refactor: add extension config#100
jmhbh merged 4 commits into
mainfrom
jmhbh/controller-extension-points

Conversation

@jmhbh

@jmhbh jmhbh commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

Add extension config to main.go to allow extension configs to be provided directly to the controller. This allows downstream forks to easily extend the main controller with plugins and additional schemes using the following pattern

app.Start(func() (*app.ExtensionConfig, error) {
    return &app.ExtensionConfig{
        PluginFactories: []app.PluginFactory{
            func(client client.Client, scheme *runtime.Scheme, logger logr.Logger) transportadapter.TranslatorPlugin {
                myPlugin := NewMyPlugin(
                    logger.WithName("my-plugin"),
                    client,
                    scheme,
                )
                return myPlugin.Translate
            },
        },
        RegisterSchemes: func(scheme *runtime.Scheme) error {
            return myapigroup.AddToScheme(scheme)
        },
    }, nil
})

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
…me and client

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
@jmhbh
jmhbh merged commit 6f4b948 into main Nov 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants