@@ -26,21 +26,21 @@ type LogConfigurer interface {
26
26
27
27
// MetricsConfigurer defines the accessor methods for metrics configurations.
28
28
type MetricsConfigurer interface {
29
- MetricsAddress () int
29
+ MetricsAddress () string
30
30
MetricsSecure () bool
31
31
}
32
32
33
33
// ControllerConfigurer defines the accessor methods for the controller's
34
34
// configurations.
35
35
type ControllerConfigurer interface {
36
36
EnableLeaderElection () bool
37
- ControllerHealthProbeAddr () int
37
+ ControllerHealthProbeAddr () string
38
38
ControllerEnableHTTP2 () bool
39
39
ControllerRequeueInterval () time.Duration
40
40
}
41
41
42
42
// MetricsAddress acessor method
43
- func (c * Config ) MetricsAddress () int {
43
+ func (c * Config ) MetricsAddress () string {
44
44
return c .Metrics .Address
45
45
}
46
46
@@ -65,7 +65,7 @@ func (c *Config) EnableLeaderElection() bool {
65
65
}
66
66
67
67
// ControllerHealthProbeAddr acessor method
68
- func (c * Config ) ControllerHealthProbeAddr () int {
68
+ func (c * Config ) ControllerHealthProbeAddr () string {
69
69
return c .Controller .HealthProbeAddr
70
70
}
71
71
@@ -92,8 +92,8 @@ type Config struct {
92
92
// MetricsConfig defines the metrics configurations
93
93
type MetricsConfig struct {
94
94
// Address The address the metric endpoint binds to.
95
- // Use the port 8080. If not set, it will be 0 in order to disable the metrics server.
96
- Address int `env:"ADDR, default=0"`
95
+ // Use the port : 8080. If not set, it will be 0 in order to disable the metrics server
96
+ Address string `env:"ADDR, default=0"`
97
97
// Secure If set the metrics endpoint is served securely.
98
98
Secure bool `env:"SECURE, default=false"`
99
99
}
@@ -104,7 +104,7 @@ type ControllerConfig struct {
104
104
// Enabling this will ensure there is only one active controller manager.
105
105
EnableLeaderElection bool `env:"ENABLE_LEADER_ELECTION, default=false"`
106
106
// HealthProbeAddr The address the probe endpoint binds to.
107
- HealthProbeAddr int `env:"HEALTH_PROBE_ADDR, default=8081"`
107
+ HealthProbeAddr string `env:"HEALTH_PROBE_ADDR, default=: 8081"`
108
108
// EnableHTTP2 If set, HTTP/2 will be enabled for the metrics and webhook
109
109
// servers.
110
110
EnableHTTP2 bool `env:"ENABLE_HTTP2, default=false"`
@@ -129,7 +129,7 @@ type LogConfig struct {
129
129
130
130
// String prints the config state
131
131
func (c * Config ) String () string {
132
- return fmt .Sprintf ("Metrics: [ Address: %d Secure: %t ] Log [ Level: %s Format: %s ] Controller [ EnableLeaderElection: %t HealthProbeAddress: %d EnableHTTP2: %t RequeueInterval: %s]" , c .Metrics .Address , c .Metrics .Secure , c .Log .Level , c .Log .Format , c .Controller .EnableLeaderElection , c .Controller .HealthProbeAddr , c .Controller .EnableHTTP2 , c .Controller .RequeueInterval )
132
+ return fmt .Sprintf ("Metrics: [ Address: %s Secure: %t ] Log [ Level: %s Format: %s ] Controller [ EnableLeaderElection: %t HealthProbeAddress: %s EnableHTTP2: %t RequeueInterval: %s]" , c .Metrics .Address , c .Metrics .Secure , c .Log .Level , c .Log .Format , c .Controller .EnableLeaderElection , c .Controller .HealthProbeAddr , c .Controller .EnableHTTP2 , c .Controller .RequeueInterval )
133
133
}
134
134
135
135
// ReadEnvConfigs will read all environment variables as defined in the Config
0 commit comments