@@ -10,16 +10,18 @@ import (
10
10
11
11
// DefaultOperatorConfig holds the default values of OperatorConfig.
12
12
var DefaultOperatorConfig = OperatorConfig {
13
- SmbdContainerImage : "quay.io/samba.org/samba-server:latest" ,
14
- SvcWatchContainerImage : "quay.io/samba.org/svcwatch:latest" ,
15
- SmbdContainerName : "samba" ,
16
- WinbindContainerName : "wb" ,
17
- WorkingNamespace : "" ,
18
- SambaDebugLevel : "" ,
19
- StatePVCSize : "1Gi" ,
20
- ClusterSupport : "" ,
21
- SmbServicePort : 445 ,
22
- SmbdPort : 445 ,
13
+ SmbdContainerImage : "quay.io/samba.org/samba-server:latest" ,
14
+ SmbdMetricsContainerImage : "quay.io/samba.org/samba-metrics:latest" ,
15
+ SvcWatchContainerImage : "quay.io/samba.org/svcwatch:latest" ,
16
+ SmbdContainerName : "samba" ,
17
+ WinbindContainerName : "wb" ,
18
+ WorkingNamespace : "" ,
19
+ SambaDebugLevel : "" ,
20
+ StatePVCSize : "1Gi" ,
21
+ ClusterSupport : "" ,
22
+ SmbServicePort : 445 ,
23
+ SmbdPort : 445 ,
24
+ MetricsExporterMode : "disabled" ,
23
25
}
24
26
25
27
// OperatorConfig is a type holding general configuration values.
@@ -28,6 +30,9 @@ var DefaultOperatorConfig = OperatorConfig{
28
30
type OperatorConfig struct {
29
31
// SmbdContainerImage can be used to select alternate container sources.
30
32
SmbdContainerImage string `mapstructure:"smbd-container-image"`
33
+ // SmbdMetricsContainerImage can be used to select alternate
34
+ // metrics-exporter container sources.
35
+ SmbdMetricsContainerImage string `mapstructure:"smbd-metrics-container-image"`
31
36
// SvcWatchContainerImage can be used to select alternate container image
32
37
// for the service watch utility.
33
38
SvcWatchContainerImage string `mapstructure:"svc-watch-container-image"`
@@ -58,6 +63,10 @@ type OperatorConfig struct {
58
63
// ServiceAccountName is a (string) which overrides the default service
59
64
// account associated with child pods. Required in OpenShift.
60
65
ServiceAccountName string `mapstructure:"service-account-name"`
66
+ // MetricsExporterMode is a (string) flag which indicates if and how the
67
+ // operator should run metrics-exporter container within samba-server pod.
68
+ // Valid values are "enabled", "disabled" or empty string (default).
69
+ MetricsExporterMode string `mapstructure:"metrics-exporter-mode"`
61
70
}
62
71
63
72
// Validate the OperatorConfig returning an error if the config is not
@@ -92,6 +101,7 @@ func NewSource() *Source {
92
101
d := DefaultOperatorConfig
93
102
v := viper .New ()
94
103
v .SetDefault ("smbd-container-image" , d .SmbdContainerImage )
104
+ v .SetDefault ("smbd-metrics-container-image" , d .SmbdMetricsContainerImage )
95
105
v .SetDefault ("smbd-container-name" , d .SmbdContainerName )
96
106
v .SetDefault ("winbind-container-name" , d .WinbindContainerName )
97
107
v .SetDefault ("working-namespace" , d .WorkingNamespace )
@@ -102,6 +112,7 @@ func NewSource() *Source {
102
112
v .SetDefault ("smb-service-port" , d .SmbServicePort )
103
113
v .SetDefault ("smbd-port" , d .SmbdPort )
104
114
v .SetDefault ("service-account-name" , d .ServiceAccountName )
115
+ v .SetDefault ("metrics-exporter-mode" , d .MetricsExporterMode )
105
116
return & Source {v : v }
106
117
}
107
118
0 commit comments