Skip to content

Commit

Permalink
fix: move the comments back to the original location
Browse files Browse the repository at this point in the history
Signed-off-by: Q.s <[email protected]>
  • Loading branch information
qs-wang committed Jan 27, 2025
1 parent 38fa016 commit 989def7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bootstrap/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ func (cp *Processor) loadConfigByProvider(

// TODO: figure out what uses the dic - this will not have the common config info!!
// is this potentially custom config for app/device services?
// Must remove any settings in the config that are not actually present in the Config Provider
// Now merge only the actual present value with the existing configuration from common.
cp.dic.Update(di.ServiceConstructorMap{
container.ConfigClientInterfaceName: func(get di.Get) any {
return privateConfigClient
Expand All @@ -307,12 +305,14 @@ func (cp *Processor) loadConfigByProvider(
return err
}

// Must remove any settings in the config that are not actually present in the Config Provider
privateConfigKeys := utils.StringSliceToMap(configKeys)
privateConfigMap, err := utils.RemoveUnusedSettings(privateServiceConfig, utils.BuildBaseKey(configStem, serviceKey), privateConfigKeys)
if err != nil {
return fmt.Errorf("could not remove unused settings from private configurations: %s", err.Error())
}

// Now merge only the actual present value with the existing configuration from common.
if err := utils.MergeValues(serviceConfig, privateConfigMap); err != nil {
return fmt.Errorf("could not merge common and private configurations: %s", err.Error())
}
Expand Down

0 comments on commit 989def7

Please sign in to comment.