Skip to content

Commit f0d1fd0

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

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.goreleaser.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ builds:
4040
env:
4141
- CGO_ENABLED=0
4242
ldflags:
43-
- '-X github.com/orange-cloudavenue/kube-image-updater/internal/models/models.Version={{.Tag}}'
43+
- '-X github.com/orange-cloudavenue/kube-image-updater/internal/models.Version={{.Tag}}'
4444

4545
dockers:
4646
# * KIMUP

cmd/operator/main.go

+2-4
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")
@@ -178,7 +176,7 @@ func main() {
178176
c <- syscall.SIGINT
179177
}
180178

181-
log.Info("Starting operator")
179+
log.WithField("version", models.Version).Info("Starting kimup operator", models.Version)
182180
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
183181
log.WithError(err).Error(err, "problem running manager")
184182
c <- syscall.SIGINT

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)