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
Add diff
command
#2626
Add diff
command
#2626
Conversation
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
5e9f539
to
3957c75
Compare
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
3957c75
to
da85b40
Compare
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
cmd/nerdctl/container_diff.go
Outdated
var changes []fs.Change | ||
err = mount.WithReadonlyTempMount(ctx, parent, func(lower string) error { | ||
return mount.WithReadonlyTempMount(ctx, mounts, func(upper string) error { | ||
fs.Changes(ctx, lower, upper, func(ck fs.ChangeKind, s string, fi os.FileInfo, 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.
The return value from fs.Changes shouldn’t be ignored
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.
Fixed at 00c0d3b
Thanks a lot. 🙇
cmd/nerdctl/container_diff.go
Outdated
} | ||
|
||
func diffShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { | ||
// show container names (TODO: only show containers with logs) |
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.
TODO seems wrong
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.
Fixed at d03a599 🙇♂️
cmd/nerdctl/container_diff.go
Outdated
case fs.ChangeKindModify: | ||
fmt.Fprintln(cmd.OutOrStdout(), "C", change.Path) | ||
case fs.ChangeKindDelete: | ||
fmt.Fprintln(cmd.OutOrStdout(), "D", change.Path) |
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.
OutOrStdout should be called only once
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.
Fixed at 3d1a5f1
Thanks a lot really. 👍
@@ -251,6 +251,7 @@ Config file ($NERDCTL_TOML): %s | |||
newPortCommand(), | |||
newStopCommand(), | |||
newStartCommand(), | |||
newDiffCommand(), |
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.
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.
Added at a78b50e
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
Signed-off-by: Min Uk Lee <minuk.dev@gmail.com>
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.
Thanks
Next time please squash commits |
#1376
Add
diff
command:continuity/fs
to compare filesystem.I referred to
nerdctl/pkg/imgutil/commit/commit.go
Lines 73 to 95 in e674fe7
(Updated) I found the test of
diff
command only works on linux, so remove its test from windows. I think I don't use a platform specific feature, but the test output is weird.: