-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat: Add Self seeding, env var overrides, cmd-line options per ADR 0005-Service-Self-Config.md #59
Conversation
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.
looking good Lenny. Thanks for adding all the TODOs for 2.0 work.
56382cd
to
51c5424
Compare
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
+ Coverage 47.17% 53.97% +6.80%
==========================================
Files 9 8 -1
Lines 602 465 -137
==========================================
- Hits 284 251 -33
+ Misses 309 206 -103
+ Partials 9 8 -1
Continue to review full report at Codecov.
|
6cd33d4
to
2c61f4c
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.
Looks good to me
2c61f4c
to
a041e08
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
@tsconn23 , @michaelestrin , @iain-anderson , I have pushed the requested changes under a new commit. I am in process of running through all my tests cases (above) using my edgex-go PR. |
e858aaa
to
47efb14
Compare
…005-Service-Self-Config.md closes #14 Signed-off-by: lenny <[email protected]>
4a7b71e
to
ef763dd
Compare
Signed-off-by: lenny <[email protected]>
ef763dd
to
32b5fa0
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #14
What is the new behavior?
<url>
for backward compatibility with Device ServicesDoes this PR introduce a breaking change?
Per ADR 0005-Service-Self-Config.md, backward compatibility has been maintained.
Are there any specific instructions or things that should be known prior to reviewing?
This draft PR (HERE) for edgex-go was used to test these changes with the following test case:
Run core-data with following command-line and environment variable combinations
Precondition for all these testcases:
<file>
up redis consul"<file>
down<file>
up redis consulTestCase: No command line options & no environment variable
Additional Preconditions: None
Command: ./core-data
Result:
Logs contains
Logs don't contain
TestCase: -confdir & -file & -profile & no environment variable
Additional Preconditions: None
Command: ./core-data -confdir=./confg -file=config.toml -profile=junk
Result:
Fails to start
Logs contains:
TestCase: EDGEX_CONF_DIR & EDGEX_CONFIG_FILE & EDGEX_PROFILE environment variables
Additional Preconditions: None
Command: EDGEX_CONF_DIR=./files EDGEX_CONFIG_FILE=myconfig.toml EDGEX_PROFILE=dummy ./core-data
Result:
Fails to start
Logs contains
TestCase: * Backward compatibility for old edgex_profile environment variable*
Additional Preconditions: None
Command: edgex_profile=dummy ./core-data
Result:
Fails to start
Logs contains
TestCase: -r & Service_Port=18080 override
Additional Precondition: Consul restarted fresh (no data), change local config to have Registry.Host = 127.0.0.1
Command: Service_Port=18080 ./core-data -r
Result:
Logs contains
Core data in Consul's list of registered services with port 18080 (consul will show health error due to docker can't hit system's localhost)
TestCase: -cp & Service_Port=58080 override
Additional Precondition: Consul restarted fresh (no data)
Command: Service_Port=58080 ./core-data -cp
Result:
Logs contains
Logs don't contain
Core data NOT in Consul's list of registered services
TestCase: -cp & Service_Port=58080 override (consul has port as 9999)
Additional Precondition: core-data config is in Consul and Service.Port changed to 9999 in consul
Command: Service_Port=58080 ./core-data -cp
Result:
Logs contains
Logs don't contain
Core data NOT in Consul's list of registered services
TestCase: overwrite flag
Additional Precondition: core-data config is in Consul and Writable/PersistData = true in Consul
Command: Writable_PersistData=false ./core-data -cp -o
Result:
Logs contains
Logs don't contain
Core data NOT in Consul's list of registered services
Writable/PersistData = false in Consul
TestCase: -cp=
<url>
& no environment variable overrideAdditional Precondition: core-data config is in Consul and Service.Port changed to 9999 in consul
Command: ./core-data -cp=consul.http://127.0.0.1:8500
Result:
Logs contains
Logs don't contain
Core data NOT in Consul's list of registered services
TestCase: Backwards compatibility for Device Services
Additional Precondition: Consul restarted fresh (no data)
Command: ./core-data -r=consul://localhost:8500
Result:
Logs contains
Logs don't contain
Core data in Consul's list of registered services with port 48080(consul will show health error due to docker can't hit system's localhost)
TestCase: EDGEX_CONFIGURATION_PROVIDER environment variable
Additional Precondition: Consul has core-data config
Command: EDGEX_CONFIGURATION_PROVIDER=consul.http://127.0.0.1:8500 ./core-data
Result:
Logs contains
Logs don't contain
Core data NOT in Consul's list of registered services
TestCase: Backwards compatibility for edgex_registry environment variable
Additional Precondition: Consul has core-data config, but not service registration.
Command: Service_Port=18080 edgex_registry=consul://127.0.0.1:8500 ./core-data
Result:
Logs contains
Core data in Consul's list of registered services with port 18080 (consul will show health error due to docker can't hit system's localhost)
TestCase: Backwards compatibility for startup_duration & startup_interval environment variables
Additional Precondition: None.
Command: startup_interval=5 startup_duration=10 ./core-data
Result:
Logs contains
TestCase: New EDGEX_STARTUP_INTERVAL & EDGEX_STARTUP_DURATION environment variables
Additional Precondition: None.
Command: EDGEX_STARTUP_INTERVAL=6 EDGEX_STARTUP_DURATION=15 ./core-data
Result:
Logs contains
Other information