Skip to content

Display network information of checkpoints created with Podman#206

Merged
rst0git merged 3 commits into
checkpoint-restore:mainfrom
nishantxscooby:podman-network-status
Mar 16, 2026
Merged

Display network information of checkpoints created with Podman#206
rst0git merged 3 commits into
checkpoint-restore:mainfrom
nishantxscooby:podman-network-status

Conversation

@nishantxscooby
Copy link
Copy Markdown
Contributor

@nishantxscooby nishantxscooby commented Mar 2, 2026

Summary

  • Parse the network.status file from Podman checkpoint archives to extract IP and MAC address information
  • Display network info in show, inspect (tree and JSON formats), and diff output, matching existing CRI-O behavior
  • Gracefully handle missing network.status files for backward compatibility with older checkpoints

Closes #132

Changes

File Description
lib/metadata.go Add PodmanNetworkStatus types and ReadContainerCheckpointNetworkStatus() reader
internal/container.go Update getPodmanInfo() to read network.status and extract IP/MAC
internal/config_extractor.go, internal/oci_image_build.go Pass checkpoint directory to getContainerInfo()
cmd/show.go, cmd/inspect.go, cmd/diff.go Add network.status to required files for extraction
lib/metadata_test.go Unit tests for network status parsing (single/multiple subnets, file-not-found)
test/data/network.status Test fixture matching the format from the issue
test/checkpointctl.bats BATS tests for show, inspect tree, and inspect JSON with network info

Test plan

  • Go unit tests pass (go test -v ./... — 30/30 pass)
  • Podman checkpoint with network.status shows IP and MAC in show output
  • Podman checkpoint with network.status shows IP and MAC in inspect tree output
  • Podman checkpoint with network.status shows IP and MAC in inspect JSON output
  • Podman checkpoint without network.status still works (no IP/MAC columns)
  • CRI-O checkpoint still works as before
  • Multiple checkpoints display correctly

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Hello maintainers, this PR is ready to be reviewed, Thankyou :D

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Test Results

86 tests  +5   86 ✅ +5   3s ⏱️ -1s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 3fc6820. ± Comparison against base commit 44489aa.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 98.73418% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.98%. Comparing base (44489aa) to head (3fc6820).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
internal/oci_image_build.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
+ Coverage   78.71%   79.98%   +1.27%     
==========================================
  Files          16       16              
  Lines        1701     1759      +58     
==========================================
+ Hits         1339     1407      +68     
+ Misses        269      263       -6     
+ Partials       93       89       -4     

☔ 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
Copy link
Copy Markdown
Member

I am not sure what the changes to the diff command are doing. Is this necessary? Does this change anything?

I am also not sure if we want it in the show command. The problem with the table is that is gets harder to read the more content it has.

For the inspect command it makes sense.

Can you also add a test with a broken network status file to see if the parser handles it gracefully.

Also tell us which AI tool you have been using as described in https://github.com/checkpoint-restore/checkpointctl?tab=contributing-ov-file

I guess there is no collision but I would like to see #201 merged first before additional features.

@rst0git as you opened #132 is this how envisioned this? Or is this the wrong approach?

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Thanks for the review :D

diff command: ig you're right, the CheckpointMetadata struct in diff.go doesn't include IP/MAC fields, so the extracted network.status data is never used in the diff output. I'll revert that change.

show command: The show command already conditionally displays IP and MAC columns for CRI-O checkpoints (as shown in the README example). The columns only appear when the values are non-empty, so Podman checkpoints without network.status won't get extra columns. This change just enables the same behavior for Podman to keep it consistent. But happy to drop it if you'd prefer to keep network info only in inspect.

Broken network status test: Will add a test with a broken/malformed network.status file to verify graceful handling.

PR #201: No problem, I'll rebase once #201 is merged.

For the AI, I have been using cursor, sorry forgot to mention :(

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from 798e758 to 76ff8ae Compare March 3, 2026 17:47
@rst0git
Copy link
Copy Markdown
Member

rst0git commented Mar 3, 2026

I guess there is no collision but I would like to see #201 merged first before additional features.

Sure, it makes sense. Let me review it.

@rst0git as you opened #132 is this how envisioned this? Or is this the wrong approach?

The main idea is to show network information about checkpoints created with Podman, similar to the way we do this for checkpoints created with CRI-O. It should be straightforward.

@adrianreber
Copy link
Copy Markdown
Member

show command: The show command already conditionally displays IP and MAC columns for CRI-O checkpoints (as shown in the README example). The columns only appear when the values are non-empty, so Podman checkpoints without network.status won't get extra columns. This change just enables the same behavior for Podman to keep it consistent. But happy to drop it if you'd prefer to keep network info only in inspect.

Right, adding it to show makes sense.

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from 76ff8ae to 16bf695 Compare March 5, 2026 19:43
@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Rebased on latest main (now that #201 is merged), addressed all review feedback

Changes since last review:

All tests passing. Ready for another look when you get a chance.

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Hello, let me know if this requires some changes from my side or is ready to be merged, thanks for your time :)

Comment thread internal/container.go
@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Hello, I think the above merged fix fixes it all? let me know if any changes are required so I can work on it, Thankyou :)

@rst0git
Copy link
Copy Markdown
Member

rst0git commented Mar 10, 2026

Hello, I think the above merged fix fixes it all? let me know if any changes are required so I can work on it, Thankyou :)

@nishantxscooby AI agents work well but only for well defined problems or tasks. In my message above I didn't describe the problem or the potential solution very well and left too much ambiguity. Can you try reading my message yourself and see if this is the right approach :)

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from 0890ee4 to 4a6d45c Compare March 11, 2026 07:25
@adrianreber
Copy link
Copy Markdown
Member

Please do not include the go-criu update in this PR.

Please also re-order and squash the commits. No merge commits in the PR please. Use one commit for the changes and split the test changes into separate commits. Maybe one commit for the unit tests the other for the integration/e2e tests.

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from 4a6d45c to bbb9c93 Compare March 13, 2026 21:03
@nishantxscooby
Copy link
Copy Markdown
Contributor Author

@adrianreber Hello, is it fine now? :)

@rst0git
Copy link
Copy Markdown
Member

rst0git commented Mar 14, 2026

@nishantxscooby I've updated your patches here: https://github.com/rst0git/checkpointctl/commits/podman-network-status

Podman checkpoints:

Displaying container checkpoint tree view from /tmp/test.tar

looper
├── Image: docker.io/library/busybox:latest
├── ID: c00a173fe7241cf6f4c052571a371bc18eb6ce89512c5545bfb636020814d81e
├── Runtime: crun
├── Created: 2026-03-13T21:11:20Z
├── Engine: Podman
├── Network Interfaces
│   ├── net1 (eth0)
│   │   ├── IP: 10.89.0.2/24
│   │   ├── MAC: 02:60:91:3e:6c:55
│   │   └── Gateway: 10.89.0.1
│   └── net2 (eth1)
│       ├── IP: 10.89.1.2/24
│       ├── MAC: 9a:52:c1:ef:92:e9
│       └── Gateway: 10.89.1.1
└── Checkpoint size: 336.1 KiB
    └── Memory pages size: 300.0 KiB
looper
├── Image: docker.io/library/busybox:latest
├── ID: 274be359d4947d98206280ff2acef87c7b3a50c434e079fc8b4604dba46e5e1e
├── Runtime: crun
├── Created: 2026-03-13T21:21:31Z
├── Engine: Podman
├── Network Interfaces
│   └── podman (eth0)
│       ├── IP: 10.88.0.21/16
│       ├── MAC: f6:92:a1:69:c2:49
│       └── Gateway: 10.88.0.1
└── Checkpoint size: 332.1 KiB
    └── Memory pages size: 296.0 KiB

CRI-O checkpoints (only IP address info is included):

Displaying container checkpoint tree view from /var/lib/kubelet/checkpoints/checkpoint-checkpoint-test_default-checkpoint-test-2026-03-13T21:43:06Z.tar

checkpoint-test
├── Image: docker.io/library/busybox:latest
├── ID: 68bb2fa6a1765e137dc0fecc4804385fdf1d1379e50f8d33cf8525f0b9e5e0a0
├── Runtime: crun
├── Created: 2026-03-13T21:42:59.05135916Z
├── Checkpointed: 2026-03-13T21:43:06Z
├── Engine: CRI-O
├── IP: 192.168.87.136
├── Checkpoint size: 314.6 KiB
│   └── Memory pages size: 296.0 KiB
└── Root FS diff size: 3.5 KiB

containerd checkpoints don't include network information.

@rst0git
Copy link
Copy Markdown
Member

rst0git commented Mar 14, 2026

Signed-off-by: nishantxscooby officialnishant21@gmail.com

@nishantxscooby Would you be able to use a real name?

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

I hope that's fine now :) @rst0git

@adrianreber
Copy link
Copy Markdown
Member

Please do not add fixup commits. Apply the fixes to the commit which introduces the change.

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

But the tests were failing, so eventually I had to :(

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from 31d7085 to dbc0b63 Compare March 14, 2026 13:04
@rst0git
Copy link
Copy Markdown
Member

rst0git commented Mar 14, 2026

Use one commit for the changes and split the test changes into separate commits. Maybe one commit for the unit tests the other for the integration/e2e tests.

@nishantxscooby It would be good also to follow Adrian's suggestion above. Here is an example:

  1. inspect: Display network information for Podman checkpoints
  2. test: Add unit tests for network status parsing and tree rendering
  3. test: Add integration tests for network status display

You can use git rebase -i HEAD~4 to edit your commits, then do git push -f to update your branch.

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Okay, I'll look into this, but for now I've removed the fixup commits, lmk if that's fine

@adrianreber
Copy link
Copy Markdown
Member

But the tests were failing, so eventually I had to :(

Yes, fixing it is correct, but include the fix in your original commit instead of creating a new commit. As long as the changes are only in the PR you can rewrite the commits as long as necessary.

Also just use one Signed-off-by line in the commit messages.

@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Okay, I'll keep all of this in mind, sorry for the chaos. :(

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from dbc0b63 to 71503a4 Compare March 15, 2026 13:54
@adrianreber
Copy link
Copy Markdown
Member

The ordering and splitting of the commits looks good. Please attribute which AI tool you have used in each commit.

We will review the code in a next step.

@nishantxscooby nishantxscooby force-pushed the podman-network-status branch from 71503a4 to e96dc3e Compare March 15, 2026 14:02
nishantxscooby and others added 3 commits March 16, 2026 08:24
Parse network.status from checkpoint archives and display per-interface
IP, MAC, and Gateway information. This information is shown in "Network
Interfaces" sub-tree of the inspect output. For CRI-O checkpoints,
the inspect tree continues to show the IP from spec annotations.
Containerd checkpoints do not include network information.

The IP and MAC columns are removed from the show table output as
network details are now shown in the inspect tree view.

Assisted-by: Cursor, Copilot, Claude Code

Co-authored-by: Devesh Goyal <devesh.21bcon427@jecrcu.edu.in>
Signed-off-by: Nishant <officialnishant21@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
Add unit tests for the Podman network status types and the new tree
rendering functions.

The metadata tests verify that the network status JSON is correctly
deserialized into the PodmanNetworkStatus structures for both single and
multi-network configurations.

The tree tests verify that the structured network information is
rendered correctly and that the flat IP and MAC fallback is used when no
structured network data is available.

Assisted-by: Cursor, Copilot, Claude Code

Signed-off-by: Nishant <officialnishant21@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
Add BATS integration tests to verify how network information from
checkpoint archives is shown. The tests cover both single-network and
multi-network configurations using the format generated by Podman.

Assisted-by: Cursor, Copilot, Claude Code

Signed-off-by: Nishant <officialnishant21@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
@rst0git rst0git force-pushed the podman-network-status branch from e96dc3e to 3fc6820 Compare March 16, 2026 08:27
Copy link
Copy Markdown
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

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

LGTM.

I've reviewed and tested these changes with Podman, CRI-O and containerd. A few minor changes: I've updated the patches to remove network info from the show table output and only display it in the inspect tree view, since there isn't enough space in the table. I've also updated the README examples and unit and integration tests.

I've also added Devesh Goyal as a co-author for the first patch as he created an initial version here: #162

@rst0git rst0git merged commit 34f655f into checkpoint-restore:main Mar 16, 2026
11 checks passed
@nishantxscooby
Copy link
Copy Markdown
Contributor Author

Cool, thankyou so much :)

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.

Display network information of checkpoints created with Podman

4 participants