From b6106341fb3a749ec37e59ee3290257a1729def1 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 6 Sep 2019 13:52:13 -0400 Subject: When first mounting any named volume, copy up Previously, we only did this for volumes created at the same time as the container. However, this is not correct behavior - Docker does so for all named volumes, even those made with 'podman volume create' and mounted into a container later. Fixes #3945 Signed-off-by: Matthew Heon --- libpod/volume.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libpod/volume.go') diff --git a/libpod/volume.go b/libpod/volume.go index b4de3aedc..c4771bbb8 100644 --- a/libpod/volume.go +++ b/libpod/volume.go @@ -57,6 +57,13 @@ type VolumeState struct { // On incrementing from 0, the volume will be mounted on the host. // On decrementing to 0, the volume will be unmounted on the host. MountCount uint `json:"mountCount"` + // NeedsCopyUp indicates that the next time the volume is mounted into + // a container, the container will "copy up" the contents of the + // mountpoint into the volume. + // This should only be done once. As such, this is set at container + // create time, then cleared after the copy up is done and never set + // again. + NeedsCopyUp bool `json:"notYetMounted,omitempty"` } // Name retrieves the volume's name -- cgit v1.2.3-54-g00ecf