Display network information of checkpoints created with Podman#206
Conversation
|
Hello maintainers, this PR is ready to be reviewed, Thankyou :D |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
I am not sure what the changes to the I am also not sure if we want it in the For the 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? |
|
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 :( |
798e758 to
76ff8ae
Compare
Sure, it makes sense. Let me review it.
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. |
Right, adding it to show makes sense. |
76ff8ae to
16bf695
Compare
|
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. |
|
Hello, let me know if this requires some changes from my side or is ready to be merged, thanks for your time :) |
|
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 :) |
0890ee4 to
4a6d45c
Compare
|
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. |
4a6d45c to
bbb9c93
Compare
|
@adrianreber Hello, is it fine now? :) |
|
@nishantxscooby I've updated your patches here: https://github.com/rst0git/checkpointctl/commits/podman-network-status Podman checkpoints: CRI-O checkpoints (only IP address info is included): containerd checkpoints don't include network information. |
@nishantxscooby Would you be able to use a real name? |
6e36bf7 to
b6e69c7
Compare
|
I hope that's fine now :) @rst0git |
|
Please do not add fixup commits. Apply the fixes to the commit which introduces the change. |
|
But the tests were failing, so eventually I had to :( |
31d7085 to
dbc0b63
Compare
@nishantxscooby It would be good also to follow Adrian's suggestion above. Here is an example:
You can use |
|
Okay, I'll look into this, but for now I've removed the fixup commits, lmk if that's fine |
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. |
|
Okay, I'll keep all of this in mind, sorry for the chaos. :( |
dbc0b63 to
71503a4
Compare
|
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. |
71503a4 to
e96dc3e
Compare
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>
e96dc3e to
3fc6820
Compare
There was a problem hiding this comment.
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
|
Cool, thankyou so much :) |
Summary
network.statusfile from Podman checkpoint archives to extract IP and MAC address informationshow,inspect(tree and JSON formats), anddiffoutput, matching existing CRI-O behaviornetwork.statusfiles for backward compatibility with older checkpointsCloses #132
Changes
lib/metadata.goPodmanNetworkStatustypes andReadContainerCheckpointNetworkStatus()readerinternal/container.gogetPodmanInfo()to readnetwork.statusand extract IP/MACinternal/config_extractor.go,internal/oci_image_build.gogetContainerInfo()cmd/show.go,cmd/inspect.go,cmd/diff.gonetwork.statusto required files for extractionlib/metadata_test.gotest/data/network.statustest/checkpointctl.batsTest plan
go test -v ./...— 30/30 pass)network.statusshows IP and MAC inshowoutputnetwork.statusshows IP and MAC ininspecttree outputnetwork.statusshows IP and MAC ininspectJSON outputnetwork.statusstill works (no IP/MAC columns)