Skip to content

Display network information of checkpoints created with Podman #132

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

Open
rst0git opened this issue Jun 2, 2024 · 6 comments · May be fixed by #162
Open

Display network information of checkpoints created with Podman #132

rst0git opened this issue Jun 2, 2024 · 6 comments · May be fixed by #162
Labels
enhancement New feature or request

Comments

@rst0git
Copy link
Member

rst0git commented Jun 2, 2024

checkpointctl currently shows IP address information for checkpoints created with CRI-O but not with Podman. For checkpoints created with Podman, this information is stored in network.status, which has content in a JSON format like the following example:

{
  "podman": {
    "interfaces": {
      "eth0": {
        "subnets": [
          {
            "ipnet": "10.88.0.9/16",
            "gateway": "10.88.0.1"
          }
        ],
        "mac_address": "f2:99:8d:fb:5a:57"
      }
    }
  }
}

To enable this feature, we need to extract the network.status file from the checkpoint and parse its content.

@rst0git rst0git added the enhancement New feature or request label Jun 2, 2024
@nick2432
Copy link

can i work on this?

@rst0git
Copy link
Member Author

rst0git commented Jul 21, 2024

@nick2432 Thank you for reaching out! You are more than welcome to work on this feature.

@deveshgoyal1000
Copy link

@rst0git Hello, can I work on this issue?

@snprajwal
Copy link
Member

@deveshgoyal1000 thank you for the interest! Please feel free to take this up :)

@deveshgoyal1000
Copy link

Okay Thanks!

@deveshgoyal1000
Copy link

deveshgoyal1000 commented Apr 5, 2025

Hey @rst0git @snprajwal 👋

Apologies for the delay on this! I’ve been spending the past few weeks diving deep into the codebase and trying to wrap my head around everything. It took a bit longer than expected. But I’ve finally got it working and will be opening a PR shortly!

deveshgoyal1000 added a commit to deveshgoyal1000/checkpointctl that referenced this issue Apr 5, 2025
Currently, checkpointctl shows IP address information for checkpoints created
with CRI-O but not with Podman. For Podman checkpoints, this information is
stored in network.status in JSON format.

This commit adds support for extracting and displaying network information
from Podman container checkpoints by:
- Adding network.status file parsing functionality
- Displaying IP and MAC address information in checkpoint show output
- Adding test coverage for network information parsing
- Maintaining compatibility with existing checkpoint formats
- Updated import references from lib to metadata for consistency

Testing Results:
1. Test Environment:
   - Container: nginx (docker.io/library/nginx:latest)
   - Container ID: 4cf1a79a043a
   - Runtime: crun

2. Verification:
   - Successfully extracts network.status from checkpoint
   - Correctly displays IP address (10.88.0.2/16)
   - Correctly displays MAC address (c2:10:ff:79:ea:72)
   - Maintains all existing checkpoint information

Fixes: checkpoint-restore#132
Signed-off-by: deveshgoyal1000 <[email protected]>
deveshgoyal1000 added a commit to deveshgoyal1000/checkpointctl that referenced this issue Apr 6, 2025
Currently, checkpointctl shows IP address information for checkpoints
created with CRI-O but not with Podman. This patch adds support for
extracting and displaying network information from Podman container
checkpoints.

The network information is stored in network.status file in JSON format:
{
  podman: {
    interfaces: {
      eth0: {
        subnets: [{
          ipnet: 10.88.0.9/16,
          gateway: 10.88.0.1
        }],
        mac_address: f2:99:8d:fb:5a:57
      }
    }
  }
}

Implementation details:
- Extract network.status file from checkpoint archive
- Parse JSON content to get IP and MAC address information
- Add network information columns to output table
- Display IP address and MAC address for Podman containers
- Add test coverage for network information parsing
- Handle network information extraction errors gracefully

This enables users to see network configuration for Podman
checkpoints, providing parity with CRI-O checkpoint display.

Fixes: checkpoint-restore#132
Signed-off-by: deveshgoyal1000 <[email protected]>
deveshgoyal1000 added a commit to deveshgoyal1000/checkpointctl that referenced this issue Apr 6, 2025
Currently, checkpointctl shows IP address information for checkpoints
created with CRI-O but not with Podman. This patch adds support for
extracting and displaying network information from Podman container
checkpoints.

The network information is stored in network.status file in JSON format:
{
  podman: {
    interfaces: {
      eth0: {
        subnets: [{
          ipnet: 10.88.0.9/16,
          gateway: 10.88.0.1
        }],
        mac_address: f2:99:8d:fb:5a:57
      }
    }
  }
}

Implementation details:
- Extract network.status file from checkpoint archive
- Parse JSON content to get IP and MAC address information
- Add network information columns to output table
- Display IP address and MAC address for Podman containers
- Add test coverage for network information parsing
- Handle network information extraction errors gracefully

Files changed:
- internal/container.go: Add network info display
- internal/podman_network.go: Network info extraction
- internal/podman_network_test.go: Test coverage

Testing:
- All Go unit tests pass
- All 61 BATS integration tests pass
- Container checkpoint tests pass
- Network information display verified in EC2

This enables users to see network configuration for Podman
checkpoints, providing parity with CRI-O checkpoint display.

Fixes: checkpoint-restore#132
Signed-off-by: deveshgoyal1000 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants