We need to relabel newly created container volumes

This will add a label to any volume that is shared into a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
(cherry picked from commit 5a277c8a4a)
This commit is contained in:
Dan Walsh 2016-05-26 11:11:28 -04:00 committed by Brian Goff
parent 7e902398f9
commit 403c9b9676

View file

@ -199,6 +199,9 @@ func (container *Container) CopyImagePathContent(v volume.Volume, destination st
logrus.Warnf("error while unmounting volume %s: %v", v.Name(), err)
}
}()
if err := label.Relabel(path, container.MountLabel, true); err != nil && err != syscall.ENOTSUP {
return err
}
return copyExistingContents(rootfs, path)
}