Skip to content

Commit eb2dbd0

Browse files
committed
fix: healthz/metrics port args kimup-controller
1 parent 1b10ca3 commit eb2dbd0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cmd/operator/main.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ func main() {
7676

7777
ctrl.SetLogger(logrusr.New(log.GetLogger()))
7878

79-
webhook := webhook.NewServer(webhook.Options{Port: models.MutatorDefaultPort})
80-
8179
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
8280
Scheme: scheme,
8381
Metrics: metricsserver.Options{
@@ -99,7 +97,7 @@ func main() {
9997
}(),
10098
LeaderElection: enableLeaderElection,
10199
LeaderElectionID: "71be4586.kimup.cloudavenue.io",
102-
WebhookServer: webhook,
100+
WebhookServer: webhook.NewServer(webhook.Options{Port: models.MutatorDefaultPort}),
103101
})
104102
if err != nil {
105103
log.WithError(err).Error("unable to start manager")

internal/controller/resources_common.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func buildKimupArgs(extra v1alpha1.KimupExtraSpec) (args []string) {
2424

2525
// set the healthz port
2626
healthzPort := extra.Healthz.Port
27-
if healthzPort != 0 {
27+
if healthzPort == 0 {
2828
healthzPort = models.HealthzDefaultPort
2929
}
3030
args = append(args, fmt.Sprintf("--%s=%d", models.HealthzPortFlagName, healthzPort))
@@ -43,7 +43,7 @@ func buildKimupArgs(extra v1alpha1.KimupExtraSpec) (args []string) {
4343

4444
// set the metrics port
4545
metricsPort := extra.Metrics.Port
46-
if metricsPort != 0 {
46+
if metricsPort == 0 {
4747
metricsPort = models.MetricsDefaultPort
4848
}
4949

@@ -58,7 +58,6 @@ func buildKimupArgs(extra v1alpha1.KimupExtraSpec) (args []string) {
5858
args = append(args, fmt.Sprintf("--%s=%s", models.MetricsPathFlagName, metricsPath))
5959
}
6060

61-
// TODO
6261
args = append(args, fmt.Sprintf("--%s=%s", models.LogLevelFlagName, extra.LogLevel))
6362

6463
return args

0 commit comments

Comments
 (0)