Add Full Support for ServiceDiscovery
This PR implements functionality for ServiceDiscovery Instances. It also adds support for the missing update_http_namespace() function.
Functions added:
- update_http_namespace()
- register_instance()
- deregister_instance()
- get_instance()
- get_instances_health_status()
- update_instance_custom_health_status()
- list_instances()
- discover_instances()
- discover_instances_revision()
This leaves ServiceDiscovery at 100% implementation.
Feedback on any issues is welcome!
Thank you for taking a look at my changes! Those whitespace changes are changing CRLF to just LF. Previously different files had different methods of encoding line breaks. I've changed them to all follow the Linux standard of LF, since CRLF broke some files (in particular the shebangs at the tops of python files). Let me know if you would still like me to revert and I will be happy to do so.
Let me know if you would still like me to revert and I will be happy to do so.
Yes please
I have reverted the whitespace changes. Let me know if I can do anything else for you!
I've noticed some issues with dict and list typing issues in Python 3.8. I have fixed this in the latest commit.
Looks like there are a few errors during the 3.12 tests, although they seem to be relating to other services (Lambda, CloudWatch, etc.). Could that be an issue with my proposed changes?
Codecov Report
Attention: Patch coverage is 90.82969% with 21 lines in your changes missing coverage. Please review.
Project coverage is 94.33%. Comparing base (
5acba3a) to head (c698d30). Report is 34 commits behind head on master.
| Files | Patch % | Lines |
|---|---|---|
| moto/servicediscovery/models.py | 86.76% | 18 Missing :warning: |
| moto/servicediscovery/exceptions.py | 77.77% | 2 Missing :warning: |
| moto/servicediscovery/responses.py | 98.80% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #7770 +/- ##
==========================================
- Coverage 94.34% 94.33% -0.01%
==========================================
Files 1092 1107 +15
Lines 93171 94207 +1036
==========================================
+ Hits 87898 88871 +973
- Misses 5273 5336 +63
| Flag | Coverage Δ | |
|---|---|---|
| servertests | 29.28% <13.97%> (-0.26%) |
:arrow_down: |
| unittests | 94.30% <90.82%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Looks like there are a few errors during the 3.12 tests, although they seem to be relating to other services (Lambda, CloudWatch, etc.). Could that be an issue with my proposed changes?
I think Github had some hickups last night - all Docker tests failed randomly, on all PR's. Restarting the build fixed it.
This is now part of moto >= 5.0.11.dev12