@@ -39,6 +39,7 @@ import (
3939 metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
4040
4141 networkv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
42+ "github.com/openstack-k8s-operators/lib-common/modules/common/operator"
4243 testv1beta1 "github.com/openstack-k8s-operators/test-operator/api/v1beta1"
4344 "github.com/openstack-k8s-operators/test-operator/controllers"
4445 //+kubebuilder:scaffold:imports
@@ -82,7 +83,7 @@ func main() {
8283 c .NextProtos = []string {"http/1.1" }
8384 }
8485
85- mgr , err := ctrl . NewManager ( ctrl . GetConfigOrDie (), ctrl.Options {
86+ options := ctrl.Options {
8687 Scheme : scheme ,
8788 Metrics : metricsserver.Options {
8889 BindAddress : metricsAddr ,
@@ -106,7 +107,15 @@ func main() {
106107 // if you are doing or is intended to do any operation such as perform cleanups
107108 // after the manager stops then its usage might be unsafe.
108109 // LeaderElectionReleaseOnCancel: true,
109- })
110+ }
111+
112+ err := operator .SetManagerOptions (& options , setupLog )
113+ if err != nil {
114+ setupLog .Error (err , "unable to set manager options" )
115+ os .Exit (1 )
116+ }
117+
118+ mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), options )
110119 if err != nil {
111120 setupLog .Error (err , "unable to start manager" )
112121 os .Exit (1 )
0 commit comments