New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
design(Refactor Registry): Create a design for refactoring the Registry component #2133
Conversation
If **no value** is provided to the `-cp/-configProvider` option, i.e. just `-cp`, and no environment variable override is specified, the default value of `consul.http://localhost:8500` will be used. | ||
|
||
if `-cp/-configProvider` **not used** and no environment variable override is specified the local configuration file is used, as is it now. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if the local configuration file has no cp entry? use the consul.http://localhost:8500
?
A little concerned if services start-up out of sync, that is one referring to a registry foo and another to bar.
Guess an error message may work that attempts a connection check to registry and if it fails, emit an misconfiguration error message and promptly exit.
A la dependency injection, would it make sense to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plan is to not put config Provider in the local config (chicken before the egg...) If no -cp then config is simply from local file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments added
GetConfiguration(configStruct interface{}) (interface{}, error) | ||
WatchForChanges(updateChannel chan<- interface{}, errorChannel chan<- error, | ||
configuration interface{}, waitKey string) | ||
IsAlive() bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsAlive feels more like registry related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsAlive() just determines if the Provider is alive, i.e. available. Applicable to Config and Registry
adr/Registry Refactoring Design.md
Outdated
```go | ||
type Client interface { | ||
HasConfiguration() (bool, error) | ||
PutConfigurationToml(configuration *toml.Tree, overwrite bool) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? If we have a toml-backed implementation of the Configuration Client, the configuration in toml.Tree form won't need to be seen outside of that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is used by Config Seed since it only deals with the TOML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean update the configurations from TOML file? If it does, we had better rename it to:
PutConfigurationByToml
or PutConfigurationFromToml
Also, if it is only for Config Seed, it might not be put in this interface. Config Seed can convert to configStruct on its own and call PutConfiguration
.
if `-cp/-configProvider` **not used** and no environment variable override is specified the local configuration file is used, as is it now. | ||
|
||
The existing `-r/-registry` command line option will be removed from all services. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the -p/-profile option being removed also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Still need it.
274249a
to
d4fe39b
Compare
Codecov Report
@@ Coverage Diff @@
## master #2133 +/- ##
=======================================
Coverage 39.39% 39.39%
=======================================
Files 174 174
Lines 12812 12812
=======================================
Hits 5047 5047
Misses 7498 7498
Partials 267 267 Continue to review full report at Codecov.
|
d4fe39b
to
1024cbd
Compare
…ry component Design for refactoring the Registry component to separate out the Service Configuration and Service Registration. Also create initial `adr` folder and README for location to hold Architecture Decision Records. Signed-off-by: lenny <leonard.goodell@intel.com>
- Added that config provider information will be logged - Changed Stem to Basepath in the New Configuration Client Config - Added section for Config endpoint chnages to include the config provider information Signed-off-by: lenny <leonard.goodell@intel.com>
e5dc45f
to
d9a53a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, it's a nice work.
Only a minor suggestion in the comment, and we had better write down the GODOC to prevent any function name confusion.
adr/Registry Refactoring Design.md
Outdated
```go | ||
type Client interface { | ||
HasConfiguration() (bool, error) | ||
PutConfigurationToml(configuration *toml.Tree, overwrite bool) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean update the configurations from TOML file? If it does, we had better rename it to:
PutConfigurationByToml
or PutConfigurationFromToml
Also, if it is only for Config Seed, it might not be put in this interface. Config Seed can convert to configStruct on its own and call PutConfiguration
.
@cloudxxx8 , PutConfigurationToml is currently only used by Config-seed, but from a module perspective it should stay in the interface. I do like the name change for clarity. Thx! |
…ry component Design for refactoring the Registry component to separate out the Service Configuration and Service Registration. Also create initial `adr` folder and README for location to hold Architecture Decision Records. Signed-off-by: lenny <leonard.goodell@intel.com>
- Added that config provider information will be logged - Changed Stem to Basepath in the New Configuration Client Config - Added section for Config endpoint chnages to include the config provider information Signed-off-by: lenny <leonard.goodell@intel.com>
…uration Client interface Signed-off-by: lenny <leonard.goodell@intel.com>
…ex-go into RefactorRegistry # Conflicts: # adr/Registry Refactoring Design.md
…uration Client interface Signed-off-by: lenny <leonard.goodell@intel.com>
Design for refactoring the Registry component to separate out the Service Configuration and Service Registration.
Also create initial
adr
folder and README for location to hold Architecture Decision Records.Note that this design doesn't address the configuration hierarchy that @jpwhitemn brought up in the PHX F2F. I feel that is out of scope for this effort and should be addressed separately.