Skip to content

Commit dba6acf

Browse files
committed
Allow function mesh controller to be disabled
1 parent f36a68d commit dba6acf

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

main.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ func main() {
7171
os.Exit(1)
7272
}
7373

74-
if err = (&controllers.FunctionMeshReconciler{
75-
Client: mgr.GetClient(),
76-
Log: ctrl.Log.WithName("controllers").WithName("FunctionMesh"),
77-
Scheme: mgr.GetScheme(),
78-
}).SetupWithManager(mgr); err != nil {
79-
setupLog.Error(err, "unable to create controller", "controller", "FunctionMesh")
80-
os.Exit(1)
74+
// allow function mesh to be disabled and enable it by default
75+
// required because of https://github.com/operator-framework/operator-lifecycle-manager/issues/1523
76+
if os.Getenv("ENABLE_FUNCTION_MESH_CONTROLLER") == "false" {
77+
if err = (&controllers.FunctionMeshReconciler{
78+
Client: mgr.GetClient(),
79+
Log: ctrl.Log.WithName("controllers").WithName("FunctionMesh"),
80+
Scheme: mgr.GetScheme(),
81+
}).SetupWithManager(mgr); err != nil {
82+
setupLog.Error(err, "unable to create controller", "controller", "FunctionMesh")
83+
os.Exit(1)
84+
}
8185
}
8286
if err = (&controllers.FunctionReconciler{
8387
Client: mgr.GetClient(),

0 commit comments

Comments
 (0)