Skip to content

Commit f35715d

Browse files
committed
refactor: update health and metric port defaults from strings to ints
1 parent e42175c commit f35715d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmd/kar-controllers/app/options/options.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"os"
2222
"strconv"
2323
"strings"
24+
25+
klog "k8s.io/klog/v2"
2426
)
2527

2628
// ServerOption is the main context object for the controller manager.
@@ -38,9 +40,9 @@ type ServerOption struct {
3840
HeadOfLineHoldingTime int
3941
QuotaEnabled bool // Controller is to evaluate quota per request
4042
QuotaRestURL string
41-
HealthProbeListenAddr string
43+
HealthProbeListenPort int
4244
DispatchResourceReservationTimeout int64
43-
MetricsListenAddr string
45+
MetricsListenPort int
4446
}
4547

4648
// NewServerOption creates a new CMServer with a default config.
@@ -65,9 +67,9 @@ func (s *ServerOption) AddFlags(fs *flag.FlagSet) {
6567
fs.BoolVar(&s.QuotaEnabled, "quotaEnabled", s.QuotaEnabled, "Enable quota policy evaluation. Default is false.")
6668
fs.StringVar(&s.QuotaRestURL, "quotaURL", s.QuotaRestURL, "URL for ReST quota management. Default is none.")
6769
fs.IntVar(&s.SecurePort, "secure-port", 6443, "The port on which to serve secured, authenticated access for metrics.")
68-
fs.StringVar(&s.HealthProbeListenAddr, "healthProbeListenAddr", ":8081", "Listen address for health probes. Defaults to ':8081'")
70+
fs.IntVar(&s.HealthProbeListenPort, "healthProbeListenPort", 8081, "Listen port for health probes. Defaults to ':8081'")
6971
// using port 8083 for metrics as 8082 is used by `custom-metrics-apiserver`
70-
fs.StringVar(&s.MetricsListenAddr, "metricsListenAddr", ":8083", "Listen address for metrics. Defaults to ':8083'")
72+
fs.IntVar(&s.MetricsListenPort, "metricsListenPort", 8083, "Listen port for metrics. Defaults to ':8083'")
7173
fs.Int64Var(&s.DispatchResourceReservationTimeout, "dispatchResourceReservationTimeout", s.DispatchResourceReservationTimeout, "Resource reservation timeout for pods to be created once AppWrapper is dispatched, in millisecond. Defaults to '300000', 5 minutes")
7274
}
7375

0 commit comments

Comments
 (0)