MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / mergeConfig

Function mergeConfig

pkg/config/sync.go:250–526  ·  view source on GitHub ↗
(from, to *controller.OperatorConfiguration)

Source from the content-addressed store, hash-verified

248}
249
250func mergeConfig(from, to *controller.OperatorConfiguration) {
251 if to == nil {
252 to = &controller.OperatorConfiguration{}
253 }
254 if from == nil {
255 return
256 }
257 if from.EnableExperimentalFeatures != nil {
258 to.EnableExperimentalFeatures = from.EnableExperimentalFeatures
259 }
260 if from.Webhook != nil {
261 if to.Webhook == nil {
262 to.Webhook = &controller.WebhookConfig{}
263 }
264 if from.Webhook.NodeSelector != nil {
265 to.Webhook.NodeSelector = from.Webhook.NodeSelector
266 }
267 if from.Webhook.Tolerations != nil {
268 to.Webhook.Tolerations = from.Webhook.Tolerations
269 }
270 if from.Webhook.Replicas != nil {
271 to.Webhook.Replicas = from.Webhook.Replicas
272 }
273 }
274 if from.Routing != nil {
275 if to.Routing == nil {
276 to.Routing = &controller.RoutingConfig{}
277 }
278 if from.Routing.DefaultRoutingClass != "" {
279 to.Routing.DefaultRoutingClass = from.Routing.DefaultRoutingClass
280 }
281 if from.Routing.ClusterHostSuffix != "" {
282 to.Routing.ClusterHostSuffix = from.Routing.ClusterHostSuffix
283 }
284 if from.Routing.ProxyConfig != nil {
285 if to.Routing.ProxyConfig == nil {
286 to.Routing.ProxyConfig = &controller.Proxy{}
287 }
288 to.Routing.ProxyConfig = proxy.MergeProxyConfigs(from.Routing.ProxyConfig, defaultConfig.Routing.ProxyConfig)
289 }
290 if from.Routing.TLSCertificateConfigmapRef != nil {
291 if to.Routing.TLSCertificateConfigmapRef == nil {
292 to.Routing.TLSCertificateConfigmapRef = &controller.ConfigmapReference{}
293 }
294 to.Routing.TLSCertificateConfigmapRef = mergeTLSCertificateConfigmapRef(from.Routing.TLSCertificateConfigmapRef, defaultConfig.Routing.TLSCertificateConfigmapRef)
295 }
296 }
297 if from.Workspace != nil {
298 if to.Workspace == nil {
299 to.Workspace = &controller.WorkspaceConfig{}
300 }
301 if from.Workspace.StorageClassName != nil {
302 to.Workspace.StorageClassName = from.Workspace.StorageClassName
303 }
304 if from.Workspace.RuntimeClassName != nil {
305 to.Workspace.RuntimeClassName = from.Workspace.RuntimeClassName
306 }
307 if from.Workspace.PVCName != "" {

Calls 6

MergeProxyConfigsFunction · 0.92
mergePodSecurityContextFunction · 0.85
mergeResourcesFunction · 0.85
DeepCopyMethod · 0.45