Skip to content

Comments

lib: Add CheckpointOptions struct and parsing for CRI options#199

Open
adrianreber wants to merge 1 commit intocheckpoint-restore:mainfrom
adrianreber:2026-02-13-options
Open

lib: Add CheckpointOptions struct and parsing for CRI options#199
adrianreber wants to merge 1 commit intocheckpoint-restore:mainfrom
adrianreber:2026-02-13-options

Conversation

@adrianreber
Copy link
Member

Add support for parsing checkpoint options from the Kubernetes CRI CheckpointPodRequest map[string]string options field. The new ParseCheckpointOptions function validates known options and their expected types (bool, int, string).

Known options: leave-running, tcp-established, ghost-limit, network-lock

Boolean values accept: yes, no, true, false, on, off, 0, 1

Generated with Claude Code (https://claude.ai/code)

@github-actions
Copy link

github-actions bot commented Feb 13, 2026

Test Results

61 tests  ±0   61 ✅ ±0   2s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 85677b0. ± Comparison against base commit d4ddee6.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.88%. Comparing base (d4ddee6) to head (85677b0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   76.00%   76.88%   +0.87%     
==========================================
  Files          13       14       +1     
  Lines        1288     1337      +49     
==========================================
+ Hits          979     1028      +49     
  Misses        232      232              
  Partials       77       77              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adrianreber adrianreber marked this pull request as draft February 13, 2026 09:09
Add support for parsing checkpoint options from the Kubernetes CRI
CheckpointPodRequest map[string]string options field. The new
ParseCheckpointOptions function validates known options and their
expected types (bool, int, string).

SupportedCheckpointOptions exports the currently supported options
with help text for use by tools. Currently only "leave-running" is
supported. Additional options (tcp-established, ghost-limit,
network-lock) are defined internally to test all option type parsers.

Boolean values accept: yes, no, true, false, on, off, 0, 1

Generated with Claude Code (https://claude.ai/code)

Signed-off-by: Adrian Reber <areber@redhat.com>
@adrianreber adrianreber marked this pull request as ready for review February 13, 2026 09:31
// LeaveRunning leaves the processes running in the container after checkpointing
LeaveRunning bool `json:"leaveRunning,omitempty"`
// TCPEstablished enables support for established TCP connections in the checkpoint
TCPEstablished bool `json:"tcpEstablished,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

We should also add tcp-close.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just as an example for now. Just for testing. I think this can be added any time later.

wantError bool
}{
// True values
{name: "yes lowercase", value: "yes", wantBool: true, wantError: false},
Copy link
Member

@rst0git rst0git Feb 13, 2026

Choose a reason for hiding this comment

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

Why do we have so many boolean values (yes, no, true, false, on, off, 0, 1)?
This could lead to inconsistencies (e.g., leave-running=1, tcp-established=False)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just to make sure whatever people use works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants