Skip to content

Commit 1c21104

Browse files
authored
feat: add DISABLE_EXTERNAL_MODEL_CONTROLLER env var (opendatahub-io#424)
When set to "true", skips registering the ExternalModel, ExternalProvider, and legacy migration controllers. The plugin chain (BBR, header stripping, api-translation, metering) still works normally. This allows multi-tenant deployments where each tenant has its own IPP instance for plugin processing, but only one instance (the default tenant) runs the controller that creates HTTPRoutes for ExternalModels.
1 parent 98256c6 commit 1c21104

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

cmd/main.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,23 @@ func main() {
3535
// Register ai-gateway payload processing plugins with pluggable bbr
3636
plugins.RegisterPlugins()
3737

38-
if err := runner.NewRunner().
39-
WithExecutableName("ai-gateway-payload-processing").
40-
WithCustomControllers(
38+
r := runner.NewRunner().
39+
WithExecutableName("ai-gateway-payload-processing")
40+
41+
if os.Getenv("DISABLE_EXTERNAL_MODEL_CONTROLLER") != "true" {
42+
r = r.WithCustomControllers(
4143
providerController(),
4244
modelController(
4345
os.Getenv("GATEWAY_NAME"),
4446
os.Getenv("GATEWAY_NAMESPACE"),
4547
),
4648
legacyMigrationController(),
47-
).
48-
Run(ctrl.SetupSignalHandler()); err != nil {
49+
)
50+
} else {
51+
ctrl.Log.WithName("setup").Info("ExternalModel/ExternalProvider controllers disabled via DISABLE_EXTERNAL_MODEL_CONTROLLER=true")
52+
}
53+
54+
if err := r.Run(ctrl.SetupSignalHandler()); err != nil {
4955
os.Exit(1)
5056
}
5157
}

0 commit comments

Comments
 (0)