openyurtio / openyurt

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

fix: edgex component creation cause registration errors and core-command crash #2029

Closed LavenderQAQ closed 2 months ago

LavenderQAQ commented 2 months ago

What type of PR is this?

/kind bug /sig iot

What this PR does / why we need it:

The default maxSurge value for k8s deployment is 25%, and when replicas is 1, maxSurge is 1 after rounding up. This results in the existence of 2 identical edgex components at the same time after a quick create + update operation, and edgex components use a registration mechanism. If a component preregisters and is terminated by workload, this causes the metadata component to scramble. This chaos manifests itself in the form of other components crashing all the time.

I updated auto-collector to directly inject the default maxSurge value of 0 into the config file and the issue was resolved.

Which issue(s) this PR fixes:

Fixes #2028

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 55.32%. Comparing base (08ab7e4) to head (10b6c6c). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2029 +/- ## ======================================= Coverage 55.32% 55.32% ======================================= Files 183 183 Lines 17835 17835 ======================================= Hits 9867 9867 Misses 6942 6942 Partials 1026 1026 ``` | [Flag](https://app.codecov.io/gh/openyurtio/openyurt/pull/2029/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/2029/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | `55.32% <ø> (ø)` | | 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.

rambohe-ch commented 2 months ago

/lgtm

rambohe-ch commented 2 months ago

/backport release-v1.4

github-actions[bot] commented 2 months ago

Backport failed for release-v1.4, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin release-v1.4
git worktree add -d .worktree/backport-2029-to-release-v1.4 origin/release-v1.4
cd .worktree/backport-2029-to-release-v1.4
git checkout -b backport-2029-to-release-v1.4
ancref=$(git merge-base 430b047d2c8023cb9bb2ffac5402ec2e7bee69ae 10b6c6cd18a6da2a815a9b160cfa0814fbf88711)
git cherry-pick -x $ancref..10b6c6cd18a6da2a815a9b160cfa0814fbf88711
rambohe-ch commented 2 months ago

/backport release-v1.4

github-actions[bot] commented 2 months ago

Backport failed for release-v1.4, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin release-v1.4
git worktree add -d .worktree/backport-2029-to-release-v1.4 origin/release-v1.4
cd .worktree/backport-2029-to-release-v1.4
git checkout -b backport-2029-to-release-v1.4
ancref=$(git merge-base 430b047d2c8023cb9bb2ffac5402ec2e7bee69ae 10b6c6cd18a6da2a815a9b160cfa0814fbf88711)
git cherry-pick -x $ancref..10b6c6cd18a6da2a815a9b160cfa0814fbf88711
rambohe-ch commented 2 months ago

/backport release-v1.4

github-actions[bot] commented 2 months ago

Backport failed for release-v1.4, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin release-v1.4
git worktree add -d .worktree/backport-2029-to-release-v1.4 origin/release-v1.4
cd .worktree/backport-2029-to-release-v1.4
git checkout -b backport-2029-to-release-v1.4
ancref=$(git merge-base 430b047d2c8023cb9bb2ffac5402ec2e7bee69ae 10b6c6cd18a6da2a815a9b160cfa0814fbf88711)
git cherry-pick -x $ancref..10b6c6cd18a6da2a815a9b160cfa0814fbf88711