mirror of
https://github.com/containers/podman.git
synced 2025-12-03 19:59:39 +08:00
Vendor in containers/storage
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
2
vendor/github.com/containers/storage/drivers/aufs/aufs.go
generated
vendored
2
vendor/github.com/containers/storage/drivers/aufs/aufs.go
generated
vendored
@@ -405,7 +405,7 @@ func atomicRemove(source string) error {
|
||||
case os.IsExist(err):
|
||||
// Got error saying the target dir already exists, maybe the source doesn't exist due to a previous (failed) remove
|
||||
if _, e := os.Stat(source); !os.IsNotExist(e) {
|
||||
return errors.Wrapf(err, "target rename dir '%s' exists but should not, this needs to be manually cleaned up")
|
||||
return errors.Wrapf(err, "target rename dir '%s' exists but should not, this needs to be manually cleaned up", target)
|
||||
}
|
||||
default:
|
||||
return errors.Wrapf(err, "error preparing atomic delete")
|
||||
|
||||
19
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
19
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@@ -340,6 +340,10 @@ func supportsOverlay(home string, homeMagic graphdriver.FsMagic, rootUID, rootGI
|
||||
|
||||
func (d *Driver) useNaiveDiff() bool {
|
||||
useNaiveDiffLock.Do(func() {
|
||||
if d.options.mountProgram != "" {
|
||||
useNaiveDiffOnly = true
|
||||
return
|
||||
}
|
||||
if err := doesSupportNativeDiff(d.home, d.options.mountOptions); err != nil {
|
||||
logrus.Warnf("Not using native diff for overlay, this may cause degraded performance for building images: %v", err)
|
||||
useNaiveDiffOnly = true
|
||||
@@ -841,6 +845,17 @@ func (d *Driver) isParent(id, parent string) bool {
|
||||
return ld == parentDir
|
||||
}
|
||||
|
||||
func (d *Driver) getWhiteoutFormat() archive.WhiteoutFormat {
|
||||
whiteoutFormat := archive.OverlayWhiteoutFormat
|
||||
if d.options.mountProgram != "" {
|
||||
// If we are using a mount program, we are most likely running
|
||||
// as an unprivileged user that cannot use mknod, so fallback to the
|
||||
// AUFS whiteout format.
|
||||
whiteoutFormat = archive.AUFSWhiteoutFormat
|
||||
}
|
||||
return whiteoutFormat
|
||||
}
|
||||
|
||||
// ApplyDiff applies the new layer into a root
|
||||
func (d *Driver) ApplyDiff(id string, idMappings *idtools.IDMappings, parent string, mountLabel string, diff io.Reader) (size int64, err error) {
|
||||
if !d.isParent(id, parent) {
|
||||
@@ -858,7 +873,7 @@ func (d *Driver) ApplyDiff(id string, idMappings *idtools.IDMappings, parent str
|
||||
if err := untar(diff, applyDir, &archive.TarOptions{
|
||||
UIDMaps: idMappings.UIDs(),
|
||||
GIDMaps: idMappings.GIDs(),
|
||||
WhiteoutFormat: archive.OverlayWhiteoutFormat,
|
||||
WhiteoutFormat: d.getWhiteoutFormat(),
|
||||
}); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -911,7 +926,7 @@ func (d *Driver) Diff(id string, idMappings *idtools.IDMappings, parent string,
|
||||
Compression: archive.Uncompressed,
|
||||
UIDMaps: idMappings.UIDs(),
|
||||
GIDMaps: idMappings.GIDs(),
|
||||
WhiteoutFormat: archive.OverlayWhiteoutFormat,
|
||||
WhiteoutFormat: d.getWhiteoutFormat(),
|
||||
WhiteoutData: lowerDirs,
|
||||
})
|
||||
}
|
||||
|
||||
2
vendor/github.com/containers/storage/drivers/zfs/zfs.go
generated
vendored
2
vendor/github.com/containers/storage/drivers/zfs/zfs.go
generated
vendored
@@ -52,7 +52,7 @@ func Init(base string, opt []string, uidMaps, gidMaps []idtools.IDMap) (graphdri
|
||||
return nil, errors.Wrap(graphdriver.ErrPrerequisites, "the 'zfs' command is not available")
|
||||
}
|
||||
|
||||
file, err := os.OpenFile("/dev/zfs", os.O_RDWR, 600)
|
||||
file, err := os.OpenFile("/dev/zfs", os.O_RDWR, 0600)
|
||||
if err != nil {
|
||||
logrus.Debugf("[zfs] cannot open /dev/zfs: %v", err)
|
||||
return nil, errors.Wrapf(graphdriver.ErrPrerequisites, "could not open /dev/zfs: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user