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

bugfix: marshal checkpoint by json #466

Merged

Conversation

WangZzzhe
Copy link
Collaborator

What type of PR is this?

Bug fixes

What this PR does / why we need it:

use json.Marshal instead of allocationInfo.Marshal() when turns podResourcesChk to checkpointData.
allocationInfo.Marshal() may produce invalid UTF-8 characters when some float value is greater than 1000, which causes verifyChecksum error after the encoding and decoding of the checkpoint.
bad cases are showed in pkg/agent/orm/pod_resource_test.go

Special notes for your reviewer:

@csfldf It seems that this issue may also occur in QRM?

@WangZzzhe WangZzzhe added bug Something isn't working workflow/need-review review: test succeeded, need to review labels Jan 30, 2024
@WangZzzhe WangZzzhe self-assigned this Jan 30, 2024
@WangZzzhe WangZzzhe requested a review from caohe as a code owner January 30, 2024 13:11
@WangZzzhe WangZzzhe force-pushed the bugfix/orm_marshal_checkpoint_by_json branch from 7d6d1f9 to 3199ec3 Compare January 30, 2024 13:21
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5f147ea) 54.89% compared to head (3199ec3) 54.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #466      +/-   ##
==========================================
- Coverage   54.89%   54.85%   -0.05%     
==========================================
  Files         503      503              
  Lines       54778    54778              
==========================================
- Hits        30070    30046      -24     
- Misses      21469    21489      +20     
- Partials     3239     3243       +4     
Flag Coverage Δ
unittest 54.85% <100.00%> (-0.05%) ⬇️

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.

@waynepeking348 waynepeking348 merged commit eab8ab0 into kubewharf:main Mar 25, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workflow/need-review review: test succeeded, need to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants