Add a CreateFromTemplate() method to graph drivers, and use it instead
of a driver-oblivious diff/put method when we want to create a copy of
an image's top layer that has the same parent and which differs from the
original only in its ID maps.
This lets drivers that can quickly make an independent layer based on
another layer do something smarter than we were doing with the
driver-oblivious method. For some drivers, a native method is
dramatically faster.
Note that the driver needs to be able to do this while still exposing
just one notional layer (i.e., one link in the chain of layers for a
given container) to the higher levels of the APIs, so if the new layer
is actually a child of the template layer, that needs to remain a detail
that's private to the driver.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
If in storage.conf I set the mount options to:
mountopt = "nodev,metacopy=on,redirect_dir=on"
This will turn on redirect_dir but the useNaiveDiff does not currently check
this option. This will cause container images on commit to not be saved
correctly.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Add an "echo" driver test, for making sure that we generate diffs
correctly when particular paths are removed in one layer and restored in
a subsequent one.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Finish the overlay->overlay2 changeover by:
* renaming overlay2 to overlay
* teaching the driver to accept the overlay.override_kernel_check and
overlay2.override_kernel_check options as having the same meaning
* registering the driver init function using both names, returning as
the driver's name
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Since we prefer our users to use overlay2, there is not reason to
support and provide overlay as an option, and potentially use a worse
driver by accident.
We also need to make overlay2 the prefered driver in containers/storage.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Rename the library module and CLI wrapper.
Rename daemon/graphdriver to drivers.
Catch up vendoring to match modules we've pruned.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>