@@ -32,9 +32,10 @@ import (
3232
3333// Change below variables to serve metrics on different host or port.
3434var (
35- metricsHost = "0.0.0.0"
36- metricsPort int32 = 8383
37- log = util .Logger ()
35+ metricsHost = "0.0.0.0"
36+ metricsPort int32 = 8383
37+ healthProbeAddr = ":8081"
38+ log = util .Logger ()
3839)
3940
4041// RunOperator is the main function of the operator but it is called from a cobra.Command
@@ -45,8 +46,6 @@ func RunOperator(cmd *cobra.Command, args []string) {
4546 util .InitLogger (logrus .DebugLevel )
4647 }
4748 version .RunVersion (cmd , args )
48- // Probe address from CLI flag (defaults to :8081)
49- probeAddr , _ := cmd .Flags ().GetString ("health-probe-bind-address" )
5049
5150 config := util .KubeConfig ()
5251
@@ -69,7 +68,7 @@ func RunOperator(cmd *cobra.Command, args []string) {
6968 Metrics : metricsServer.Options {
7069 BindAddress : fmt .Sprintf ("%s:%d" , metricsHost , metricsPort ),
7170 },
72- HealthProbeBindAddress : probeAddr , // Serve /healthz and /readyz here
71+ HealthProbeBindAddress : healthProbeAddr , // Serve /healthz and /readyz here
7372 })
7473 if err != nil {
7574 log .Fatalf ("Failed to create manager: %s" , err )
@@ -101,16 +100,10 @@ func RunOperator(cmd *cobra.Command, args []string) {
101100 log .Fatalf ("Failed AddToClusterScopedManager: %s" , err )
102101 }
103102
104- // Register health and readiness endpoints on mgr
105- if err := mgr .AddHealthzCheck ("healthz" , healthz .Ping ); err != nil {
106- log .Fatalf ("Failed to add health check: %s" , err )
107- }
108-
109103 if err := mgr .AddReadyzCheck ("readyz" , healthz .Ping ); err != nil {
110104 log .Fatalf ("Failed to add readiness check: %s" , err )
111105 }
112106
113-
114107 util .Panic (mgr .Add (manager .RunnableFunc (func (ctx context.Context ) error {
115108 system .RunOperatorCreate (cmd , args )
116109 return nil
0 commit comments