@@ -31,12 +31,12 @@ const (
31
31
// The functions in this file implement the configurator.Configurator interface
32
32
33
33
// GetMeshConfig returns the MeshConfig resource corresponding to the control plane
34
- func (c * Client ) GetMeshConfig () * configv1alpha1.MeshConfig {
34
+ func (c * client ) GetMeshConfig () * configv1alpha1.MeshConfig {
35
35
return c .getMeshConfig ()
36
36
}
37
37
38
38
// GetOSMNamespace returns the namespace in which the OSM controller pod resides.
39
- func (c * Client ) GetOSMNamespace () string {
39
+ func (c * client ) GetOSMNamespace () string {
40
40
return c .osmNamespace
41
41
}
42
42
@@ -49,7 +49,7 @@ func marshalConfigToJSON(config *configv1alpha1.MeshConfigSpec) (string, error)
49
49
}
50
50
51
51
// GetMeshConfigJSON returns the MeshConfig in pretty JSON.
52
- func (c * Client ) GetMeshConfigJSON () (string , error ) {
52
+ func (c * client ) GetMeshConfigJSON () (string , error ) {
53
53
cm , err := marshalConfigToJSON (& c .getMeshConfig ().Spec )
54
54
if err != nil {
55
55
log .Error ().Err (err ).Str (errcode .Kind , errcode .GetErrCodeWithMetric (errcode .ErrMeshConfigMarshaling )).Msgf ("Error marshaling MeshConfig %s: %+v" , c .getMeshConfigCacheKey (), c .getMeshConfig ())
@@ -62,27 +62,27 @@ func (c *Client) GetMeshConfigJSON() (string, error) {
62
62
// where all existing traffic is allowed to flow as it is,
63
63
// or it is in SMI Spec mode, in which only traffic between source/destinations
64
64
// referenced in SMI policies is allowed.
65
- func (c * Client ) IsPermissiveTrafficPolicyMode () bool {
65
+ func (c * client ) IsPermissiveTrafficPolicyMode () bool {
66
66
return c .getMeshConfig ().Spec .Traffic .EnablePermissiveTrafficPolicyMode
67
67
}
68
68
69
69
// IsEgressEnabled determines whether egress is globally enabled in the mesh or not.
70
- func (c * Client ) IsEgressEnabled () bool {
70
+ func (c * client ) IsEgressEnabled () bool {
71
71
return c .getMeshConfig ().Spec .Traffic .EnableEgress
72
72
}
73
73
74
74
// IsDebugServerEnabled determines whether osm debug HTTP server is enabled
75
- func (c * Client ) IsDebugServerEnabled () bool {
75
+ func (c * client ) IsDebugServerEnabled () bool {
76
76
return c .getMeshConfig ().Spec .Observability .EnableDebugServer
77
77
}
78
78
79
79
// IsTracingEnabled returns whether tracing is enabled
80
- func (c * Client ) IsTracingEnabled () bool {
80
+ func (c * client ) IsTracingEnabled () bool {
81
81
return c .getMeshConfig ().Spec .Observability .Tracing .Enable
82
82
}
83
83
84
84
// GetTracingHost is the host to which we send tracing spans
85
- func (c * Client ) GetTracingHost () string {
85
+ func (c * client ) GetTracingHost () string {
86
86
tracingAddress := c .getMeshConfig ().Spec .Observability .Tracing .Address
87
87
if tracingAddress != "" {
88
88
return tracingAddress
@@ -91,7 +91,7 @@ func (c *Client) GetTracingHost() string {
91
91
}
92
92
93
93
// GetTracingPort returns the tracing listener port
94
- func (c * Client ) GetTracingPort () uint32 {
94
+ func (c * client ) GetTracingPort () uint32 {
95
95
tracingPort := c .getMeshConfig ().Spec .Observability .Tracing .Port
96
96
if tracingPort != 0 {
97
97
return uint32 (tracingPort )
@@ -100,7 +100,7 @@ func (c *Client) GetTracingPort() uint32 {
100
100
}
101
101
102
102
// GetTracingEndpoint returns the listener's collector endpoint
103
- func (c * Client ) GetTracingEndpoint () string {
103
+ func (c * client ) GetTracingEndpoint () string {
104
104
tracingEndpoint := c .getMeshConfig ().Spec .Observability .Tracing .Endpoint
105
105
if tracingEndpoint != "" {
106
106
return tracingEndpoint
@@ -109,17 +109,17 @@ func (c *Client) GetTracingEndpoint() string {
109
109
}
110
110
111
111
// UseHTTPSIngress determines whether traffic between ingress and backend pods should use HTTPS protocol
112
- func (c * Client ) UseHTTPSIngress () bool {
112
+ func (c * client ) UseHTTPSIngress () bool {
113
113
return c .getMeshConfig ().Spec .Traffic .UseHTTPSIngress
114
114
}
115
115
116
116
// GetMaxDataPlaneConnections returns the max data plane connections allowed, 0 if disabled
117
- func (c * Client ) GetMaxDataPlaneConnections () int {
117
+ func (c * client ) GetMaxDataPlaneConnections () int {
118
118
return c .getMeshConfig ().Spec .Sidecar .MaxDataPlaneConnections
119
119
}
120
120
121
121
// GetEnvoyLogLevel returns the envoy log level
122
- func (c * Client ) GetEnvoyLogLevel () string {
122
+ func (c * client ) GetEnvoyLogLevel () string {
123
123
logLevel := c .getMeshConfig ().Spec .Sidecar .LogLevel
124
124
if logLevel != "" {
125
125
return logLevel
@@ -128,7 +128,7 @@ func (c *Client) GetEnvoyLogLevel() string {
128
128
}
129
129
130
130
// GetEnvoyImage returns the envoy image
131
- func (c * Client ) GetEnvoyImage () string {
131
+ func (c * client ) GetEnvoyImage () string {
132
132
image := c .getMeshConfig ().Spec .Sidecar .EnvoyImage
133
133
if image != "" {
134
134
return image
@@ -137,7 +137,7 @@ func (c *Client) GetEnvoyImage() string {
137
137
}
138
138
139
139
// GetEnvoyWindowsImage returns the envoy windows image
140
- func (c * Client ) GetEnvoyWindowsImage () string {
140
+ func (c * client ) GetEnvoyWindowsImage () string {
141
141
image := c .getMeshConfig ().Spec .Sidecar .EnvoyWindowsImage
142
142
if image != "" {
143
143
return image
@@ -146,7 +146,7 @@ func (c *Client) GetEnvoyWindowsImage() string {
146
146
}
147
147
148
148
// GetInitContainerImage returns the init container image
149
- func (c * Client ) GetInitContainerImage () string {
149
+ func (c * client ) GetInitContainerImage () string {
150
150
initImage := c .getMeshConfig ().Spec .Sidecar .InitContainerImage
151
151
if initImage != "" {
152
152
return initImage
@@ -155,7 +155,7 @@ func (c *Client) GetInitContainerImage() string {
155
155
}
156
156
157
157
// GetServiceCertValidityPeriod returns the validity duration for service certificates, and a default in case of invalid duration
158
- func (c * Client ) GetServiceCertValidityPeriod () time.Duration {
158
+ func (c * client ) GetServiceCertValidityPeriod () time.Duration {
159
159
durationStr := c .getMeshConfig ().Spec .Certificate .ServiceCertValidityDuration
160
160
validityDuration , err := time .ParseDuration (durationStr )
161
161
if err != nil {
@@ -167,7 +167,7 @@ func (c *Client) GetServiceCertValidityPeriod() time.Duration {
167
167
}
168
168
169
169
// GetCertKeyBitSize returns the certificate key bit size to be used
170
- func (c * Client ) GetCertKeyBitSize () int {
170
+ func (c * client ) GetCertKeyBitSize () int {
171
171
bitSize := c .getMeshConfig ().Spec .Certificate .CertKeyBitSize
172
172
if bitSize < minCertKeyBitSize || bitSize > maxCertKeyBitSize {
173
173
log .Error ().Msgf ("Invalid key bit size: %d" , bitSize )
@@ -178,28 +178,28 @@ func (c *Client) GetCertKeyBitSize() int {
178
178
}
179
179
180
180
// GetOutboundIPRangeExclusionList returns the list of IP ranges of the form x.x.x.x/y to exclude from outbound sidecar interception
181
- func (c * Client ) GetOutboundIPRangeExclusionList () []string {
181
+ func (c * client ) GetOutboundIPRangeExclusionList () []string {
182
182
return c .getMeshConfig ().Spec .Traffic .OutboundIPRangeExclusionList
183
183
}
184
184
185
185
// GetOutboundPortExclusionList returns the list of ports (positive integers) to exclude from outbound sidecar interception
186
- func (c * Client ) GetOutboundPortExclusionList () []int {
186
+ func (c * client ) GetOutboundPortExclusionList () []int {
187
187
return c .getMeshConfig ().Spec .Traffic .OutboundPortExclusionList
188
188
}
189
189
190
190
// GetInboundPortExclusionList returns the list of ports (positive integers) to exclude from inbound sidecar interception
191
- func (c * Client ) GetInboundPortExclusionList () []int {
191
+ func (c * client ) GetInboundPortExclusionList () []int {
192
192
return c .getMeshConfig ().Spec .Traffic .InboundPortExclusionList
193
193
}
194
194
195
195
// IsPrivilegedInitContainer returns whether init containers should be privileged
196
- func (c * Client ) IsPrivilegedInitContainer () bool {
196
+ func (c * client ) IsPrivilegedInitContainer () bool {
197
197
return c .getMeshConfig ().Spec .Sidecar .EnablePrivilegedInitContainer
198
198
}
199
199
200
200
// GetConfigResyncInterval returns the duration for resync interval.
201
201
// If error or non-parsable value, returns 0 duration
202
- func (c * Client ) GetConfigResyncInterval () time.Duration {
202
+ func (c * client ) GetConfigResyncInterval () time.Duration {
203
203
resyncDuration := c .getMeshConfig ().Spec .Sidecar .ConfigResyncInterval
204
204
duration , err := time .ParseDuration (resyncDuration )
205
205
if err != nil {
@@ -210,12 +210,12 @@ func (c *Client) GetConfigResyncInterval() time.Duration {
210
210
}
211
211
212
212
// GetProxyResources returns the `Resources` configured for proxies, if any
213
- func (c * Client ) GetProxyResources () corev1.ResourceRequirements {
213
+ func (c * client ) GetProxyResources () corev1.ResourceRequirements {
214
214
return c .getMeshConfig ().Spec .Sidecar .Resources
215
215
}
216
216
217
217
// GetInboundExternalAuthConfig returns the External Authentication configuration for incoming traffic, if any
218
- func (c * Client ) GetInboundExternalAuthConfig () auth.ExtAuthConfig {
218
+ func (c * client ) GetInboundExternalAuthConfig () auth.ExtAuthConfig {
219
219
extAuthConfig := auth.ExtAuthConfig {}
220
220
inboundExtAuthzMeshConfig := c .getMeshConfig ().Spec .Traffic .InboundExternalAuthorization
221
221
@@ -236,11 +236,11 @@ func (c *Client) GetInboundExternalAuthConfig() auth.ExtAuthConfig {
236
236
}
237
237
238
238
// GetFeatureFlags returns OSM's feature flags
239
- func (c * Client ) GetFeatureFlags () configv1alpha1.FeatureFlags {
239
+ func (c * client ) GetFeatureFlags () configv1alpha1.FeatureFlags {
240
240
return c .getMeshConfig ().Spec .FeatureFlags
241
241
}
242
242
243
243
// GetOSMLogLevel returns the configured OSM log level
244
- func (c * Client ) GetOSMLogLevel () string {
244
+ func (c * client ) GetOSMLogLevel () string {
245
245
return c .getMeshConfig ().Spec .Observability .OSMLogLevel
246
246
}
0 commit comments