Skip to content

Commit 17b70f5

Browse files
committed
fix code
Signed-off-by: Oded Viner <[email protected]>
1 parent 98afab0 commit 17b70f5

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

pkg/operator/manager.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ import (
3232

3333
// Change below variables to serve metrics on different host or port.
3434
var (
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

pkg/operator/operator.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ func Cmd() *cobra.Command {
3333
Use: "operator",
3434
Short: "Deployment using operator",
3535
}
36-
// health-probe flag available on operator and inherited by subcommands
37-
cmd.PersistentFlags().String("health-probe-bind-address", ":8081", "HTTP address for health/readiness probes (e.g., :8081)")
3836
cmd.AddCommand(
3937
CmdInstall(),
4038
CmdUninstall(),

0 commit comments

Comments
 (0)