| 382 | } |
| 383 | |
| 384 | func cloneRootConfigForDynamicUpdate(rc *RootConfig) *RootConfig { |
| 385 | next := *rc |
| 386 | if rc.Registries != nil { |
| 387 | next.Registries = make(map[string]*RegistryConfig, len(rc.Registries)) |
| 388 | for registryID, registryConfig := range rc.Registries { |
| 389 | if registryConfig == nil { |
| 390 | next.Registries[registryID] = nil |
| 391 | continue |
| 392 | } |
| 393 | registryCopy := *registryConfig |
| 394 | next.Registries[registryID] = ®istryCopy |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | if rc.Consumer != nil { |
| 399 | consumerCopy := *rc.Consumer |
| 400 | next.Consumer = &consumerCopy |
| 401 | } |
| 402 | return &next |
| 403 | } |
| 404 | |
| 405 | // TODO:When config is migrated later, the impact of this will be migrated to the global module |
| 406 | // validateRegistryAddresses Checks whether there are duplicate registry addresses |