-
Notifications
You must be signed in to change notification settings - Fork 17
Display network information of checkpoints created with Podman #162
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
base: main
Are you sure you want to change the base?
Display network information of checkpoints created with Podman #162
Conversation
d42ce5a
to
4166f35
Compare
Please have a look at the CI failures and try to fix them. Also, please rebase and remove the merge commit. |
You should also remove the dependabot commit from your PR. |
@deveshgoyal1000 Thank you for working on this! In addition to Adrian's comments, it would be great if you can add more detailed commit messages. The following contributor guide provides more information: https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md#describe-your-changes |
Thanks for the feedback! I’ll start working on the suggested updates. |
4166f35
to
5cdf9c8
Compare
5cdf9c8
to
88acd95
Compare
a975984
to
88acd95
Compare
52dd188
to
03bf319
Compare
Signed-off-by: deveshgoyal1000 <devesh.21bcon427@jecrcu.edu.in>
03bf319
to
7669ce5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
==========================================
- Coverage 71.43% 71.41% -0.02%
==========================================
Files 13 14 +1
Lines 1565 1599 +34
==========================================
+ Hits 1118 1142 +24
- Misses 373 384 +11
+ Partials 74 73 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
if specDump.Annotations["io.container.manager"] == "libpod" { | ||
// Create temp dir for network status file | ||
tmpDir, err := os.MkdirTemp("", "network-status") | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would like to return the error here (possible wrapped with some context)
|
||
// Extract network.status file | ||
err = UntarFiles(task.CheckpointFilePath, tmpDir, []string{metadata.NetworkStatusFile}) | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
if err == nil { | ||
networkStatusFile := filepath.Join(tmpDir, metadata.NetworkStatusFile) | ||
ip, mac, err := getPodmanNetworkInfo(networkStatusFile) | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
if strings.Contains(err.Error(), "unexpected end of JSON input") { | ||
return nil, fmt.Errorf("config.dump: unexpected end of JSON input") | ||
} | ||
return nil, fmt.Errorf("config.dump: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if strings.Contains(err.Error(), "unexpected end of JSON input") { | |
return nil, fmt.Errorf("config.dump: unexpected end of JSON input") | |
} | |
return nil, fmt.Errorf("config.dump: %w", err) | |
return nil, fmt.Errorf("config.dump: %w", err) |
I don't think we need the special case since we are wrapping with context.
if os.IsNotExist(err) { | ||
return nil, fmt.Errorf("spec.dump: no such file or directory") | ||
} | ||
if strings.Contains(err.Error(), "unexpected end of JSON input") { | ||
return nil, fmt.Errorf("spec.dump: unexpected end of JSON input") | ||
} | ||
return nil, fmt.Errorf("spec.dump: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if os.IsNotExist(err) { | |
return nil, fmt.Errorf("spec.dump: no such file or directory") | |
} | |
if strings.Contains(err.Error(), "unexpected end of JSON input") { | |
return nil, fmt.Errorf("spec.dump: unexpected end of JSON input") | |
} | |
return nil, fmt.Errorf("spec.dump: %w", err) | |
return nil, fmt.Errorf("spec.dump: %w", err) |
I don't think we need the special case since we are wrapping with context.
"IP", | ||
"MAC", | ||
"CHKPT Size", | ||
"Root FS Diff Size", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Root FS Diff Size", | |
"Root FS Diff", |
Would it make sense to drop the "size" suffix, since the field ought to make it clear that we are talking about the size?
if strings.Contains(err.Error(), "Error: ") { | ||
return fmt.Errorf("%s", strings.TrimPrefix(err.Error(), "Error: ")) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary
} | ||
|
||
return "", "", nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline at the end of the file :)
if err == nil { | ||
t.Error("getPodmanNetworkInfo should fail with invalid JSON") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline at the end of the file :)
Oh also, it looks like you need to format the files correctly |
Yes, I’m working on it. Thanks for the detailed review and suggestions |
This PR implements support for displaying network information (IP and MAC addresses) from Podman container checkpoints, addressing issue.
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.
Implementation:
Testing Results:
Before (Original Output) and After (With Network Information output)
The implementation successfully displays:
Fixes #132