openyurtio / openyurt

OpenYurt - Extending your native Kubernetes to edge(project under CNCF)
https://openyurt.io
Apache License 2.0
1.69k stars 398 forks source link

feat: support message bus to sync metadata changes #1955

Closed wangxye closed 2 months ago

wangxye commented 6 months ago

What type of PR is this?

/sig iot /kind feature

What this PR does / why we need it:

Since MessageBus is now the default inter-communication method for EdgeX, yurt-iot-dock should switch to MessageBus, and supports synchronization of message bus-driven metadata changes.

Which issue(s) this PR fixes:

Fixes #1799

Special notes for your reviewer:

/assign @LavenderQAQ /assign @Rui-Gan

other Note

There are still the following issues to be resolved:

Example of Test
users:
# curl -X POST -H 'Content-Type: application/json'  \
http://edgex-core-metadata:59881/api/v3/device \
-d '[
         {
            "apiVersion": "v3",
            "device": {
               "name":"Camera",
               "serviceName": "device-rest",
               "profileName": "sample-numeric",
               "description": "My test camera",
               "adminState": "UNLOCKED",
               "operatingState": "UP",
               "protocols": {
                  "Onvif": {
                     "Address": "192.168.0.1",
                     "Port": "80",
                     "MACAddress": "xx:xx:xx:xx:xx:xx",
                     "FriendlyName":"Default Camera"
                  },
                  "CustomMetadata": {
                     "Location":"Front door"
                  }
               }
            }
         }
]'

openyurt:
# kubectl get device | grep camera
hangzhou-camera             hangzhou   true     5s
codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 0% with 73 lines in your changes are missing coverage. Please review.

Project coverage is 52.22%. Comparing base (3dd6c5c) to head (063d15f). Report is 55 commits behind head on master.

Files Patch % Lines
pkg/yurtiotdock/controllers/util/messagebus.go 0.00% 41 Missing :warning:
pkg/yurtiotdock/controllers/util/health_checker.go 0.00% 32 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1955 +/- ## ========================================== - Coverage 52.23% 52.22% -0.01% ========================================== Files 173 175 +2 Lines 21117 21088 -29 ========================================== - Hits 11031 11014 -17 - Misses 9110 9124 +14 + Partials 976 950 -26 ``` | [Flag](https://app.codecov.io/gh/openyurtio/openyurt/pull/1955/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/openyurtio/openyurt/pull/1955/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | `52.22% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

wangxye commented 6 months ago

/rerun

wangxye commented 6 months ago

/assign @LavenderQAQ /assign @Rui-Gan

LavenderQAQ commented 6 months ago

/assign

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
6 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

wangxye commented 6 months ago

/rerun

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.