Skip to content
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

fix cache manager panic in yurthub #1950

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

rambohe-ch
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind bug

What this PR does / why we need it:

background:

yurt-hub-cfg configmap is used in multiple places, like:

In the cache manager, configmap is read, but in the approver, configmap is modified, so a panic maybe triggered.

solution:

deepcopy configmap before modify to avoid panic.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Copy link

sonarcloud bot commented Feb 20, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

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

See analysis details on SonarCloud

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3e5d8fc) 52.04% compared to head (3de0034) 52.34%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1950      +/-   ##
==========================================
+ Coverage   52.04%   52.34%   +0.30%     
==========================================
  Files         174      173       -1     
  Lines       21213    21012     -201     
==========================================
- Hits        11040    10999      -41     
+ Misses       9199     9062     -137     
+ Partials      974      951      -23     
Flag Coverage Δ
unittests 52.34% <100.00%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@YTGhost YTGhost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@YTGhost YTGhost merged commit c8778fc into openyurtio:master Feb 20, 2024
13 checks passed
@rambohe-ch rambohe-ch added the backport release-v1.4 backport release-v1.4 label Feb 20, 2024
@rambohe-ch
Copy link
Member Author

/backport release-v1.4

Copy link

Successfully created backport PR for release-v1.4:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-v1.4 backport release-v1.4 kind/bug kind/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants