-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or requestholdIntended for PRs we want to flag for ongoing reviewIntended for PRs we want to flag for ongoing review
Description
🚀 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
- 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).
- GetConfigurationMap() {map[string]any, error)
- 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?Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestholdIntended for PRs we want to flag for ongoing reviewIntended for PRs we want to flag for ongoing review
Type
Projects
Status
Icebox