You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess I am confused by all the layers but I currently cannot find the right way to use Diff() when compared to Changes(). This is motivated by the podman bug report: containers/podman#4606
Looking at the documentation of Diff() and Changes() I see:
// Changes returns a slice of Change structures, which contain a pathname
// (Path) and a description of what sort of change (Kind) was made by the
// layer (either ChangeModify, ChangeAdd, or ChangeDelete), relative to a
// specified layer. By default, the layer's parent is used as a reference.
Changes(from, to string) ([]archive.Change, error)
// Diff produces a tarstream which can be applied to a layer with the contents
// of the first layer to produce a layer with the contents of the second layer.
// By default, the parent of the second layer is used as the first
// layer, so it need not be specified. Options can be used to override
// default behavior, but are also not required.
Diff(from, to string, options *DiffOptions) (io.ReadCloser, error)
To checkpoint a container with the changes to the root file-system I am using Diff() to get a tarstream of all the changes since the container has been started.
The code in container_internal_linux.go looks like this:
This is using the same parameters as podman diff. (This is all confusing as the podman command diff uses the call Changes() and Diff() creates the tarstream, I hope I did not mix them up).
Reading the comments above more closely it seems Diff() (to create a tarstream) does
"By default, the parent of the second layer is used as the first layer, so it need not be specified."
This confuses me and maybe someone can give me an explanation how to use Diff() to get the same results as Changes().
Currently the rootfs diff in the checkpoint archive contains the changes to the container as well as the complete layer below. In an one layer images like ubi8, this is all the content. I would like to only have the changes in the tarstream between the current running container and the layer the container was started from.
The text was updated successfully, but these errors were encountered:
I guess I am confused by all the layers but I currently cannot find the right way to use
Diff()
when compared toChanges()
. This is motivated by the podman bug report: containers/podman#4606Looking at the documentation of
Diff()
andChanges()
I see:To checkpoint a container with the changes to the root file-system I am using
Diff()
to get a tarstream of all the changes since the container has been started.The code in
container_internal_linux.go
looks like this:This is using the same parameters as
podman diff
. (This is all confusing as the podman commanddiff
uses the callChanges()
andDiff()
creates the tarstream, I hope I did not mix them up).Reading the comments above more closely it seems
Diff()
(to create a tarstream) doesThis confuses me and maybe someone can give me an explanation how to use
Diff()
to get the same results asChanges()
.Currently the rootfs diff in the checkpoint archive contains the changes to the container as well as the complete layer below. In an one layer images like ubi8, this is all the content. I would like to only have the changes in the tarstream between the current running container and the layer the container was started from.
The text was updated successfully, but these errors were encountered: