You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature request is for APIs to pull configuration and receive updated configuration (i.e. `Writable`) and the Consul implementation.
Per Napa planning this will not be included due to risk of destabilizing the release. Task for this release is to agree on the approach and possibly create a POC.
Description [REQUIRED]
The current APIs expect the service's complete config struct to be passed in when pulling config and waiting for updates. The Consul implementation uses `github.com/mitchellh/consulstructure` in both cases.
There are two issues with this approach:
github.com/mitchellh/consulstructure doesn't support pull/marshaling slices.
github.com/mitchellh/consulstructure updates the passed in service's config struct with the complete Writable section when a setting changes and doesn't provide indication of which settings have changed. With the need to merge configurations for the recent Common Config implementation, this has lead to this issue when map items are removed.
Describe the solution you'd like
Add new APIs (deprecate old versions) for pulling complete configuration and waiting for updates.
GetConfigurationMap() {map[string]any, error)
This new API returns the service's complete configuration as a map which the caller can then use to merge/marshal into the service's config struct.
WatchForUpdates(updateChannel chan<- map[string]Update, errorChannel chan<- error, watchKey string)
This new API will watch for updates, post a map containing only the fields that have changed. The setting paths are the map keys and the map values contain the new setting value and if the setting is existing, new or deleted (for handling of maps/slices).
Consul implementation would no longer use github.com/mitchellh/consulstructure. Instead would implement pulling/waiting internally. Long request on watchKey url for Updates and simple pull on root key for Get.
go-mod-bootstrap can then be refactored to use these new APIs to resolve edgexfoundry/go-mod-bootstrap#534 and enable slice as a type for configuration items.
Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?
The text was updated successfully, but these errors were encountered:
lenny-goodell
changed the title
[Configuration] Redesign API and Consul implementation to simplify updates from Consul
[Configuration] Redesign API and Consul implementation to simplify pull and updates
Jul 12, 2023
lenny-goodell
changed the title
[Configuration] Redesign API and Consul implementation to simplify pull and updates
[Configuration] New APIs and Consul implementation to simplify pull and updates
Jul 12, 2023
lenny-goodell
changed the title
[Configuration] New APIs and Consul implementation to simplify pull and updates
[Configuration] New APIs to simplify pull and updates
Jul 12, 2023
@lenny-intel thanks for the reminder. I've reviewed the issue description, and the design looks good to me.
Is it the typo in the signature? updateChannel chan<- map[string]Update
I believe it should be updateChannel chan<- map[string]any
Or, would you like to define a struct called Update?
🚀 Tech Debt
Relevant Package [REQUIRED]
This feature request is for APIs to pull configuration and receive updated configuration (i.e. `Writable`) and the Consul implementation.Per Napa planning this will not be included due to risk of destabilizing the release. Task for this release is to agree on the approach and possibly create a POC.
Description [REQUIRED]
The current APIs expect the service's complete config struct to be passed in when pulling config and waiting for updates. The Consul implementation uses `github.com/mitchellh/consulstructure` in both cases.There are two issues with this approach:
github.com/mitchellh/consulstructure
doesn't support pull/marshaling slices.github.com/mitchellh/consulstructure
updates the passed in service's config struct with the complete Writable section when a setting changes and doesn't provide indication of which settings have changed. With the need to merge configurations for the recent Common Config implementation, this has lead to this issue when map items are removed.Describe the solution you'd like
This new API returns the service's complete configuration as a map which the caller can then use to merge/marshal into the service's config struct.
This new API will watch for updates, post a map containing only the fields that have changed. The setting paths are the map keys and the map values contain the new setting value and if the setting is existing, new or deleted (for handling of maps/slices).
github.com/mitchellh/consulstructure
. Instead would implement pulling/waiting internally. Long request on watchKey url for Updates and simple pull on root key for Get.go-mod-bootstrap can then be refactored to use these new APIs to resolve edgexfoundry/go-mod-bootstrap#534 and enable slice as a type for configuration items.
Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?The text was updated successfully, but these errors were encountered: