mirror of
https://github.com/containers/skopeo.git
synced 2025-10-21 19:03:44 +00:00
Update image-tools, and remove the duplicate Sirupsen/logrus vendor
This commit is contained in:
20
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
20
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@@ -228,7 +228,7 @@ func parseOptions(options []string) (*overlayOptions, error) {
|
||||
key = strings.ToLower(key)
|
||||
switch key {
|
||||
case "overlay.override_kernel_check", "overlay2.override_kernel_check":
|
||||
logrus.Debugf("overlay: overide_kernelcheck=%s", val)
|
||||
logrus.Debugf("overlay: override_kernelcheck=%s", val)
|
||||
o.overrideKernelCheck, err = strconv.ParseBool(val)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -287,8 +287,8 @@ func supportsOverlay() error {
|
||||
|
||||
func useNaiveDiff(home string) bool {
|
||||
useNaiveDiffLock.Do(func() {
|
||||
if err := hasOpaqueCopyUpBug(home); err != nil {
|
||||
logrus.Warnf("Not using native diff for overlay: %v", err)
|
||||
if err := doesSupportNativeDiff(home); err != nil {
|
||||
logrus.Warnf("Not using native diff for overlay, this may cause degraded performance for building images: %v", err)
|
||||
useNaiveDiffOnly = true
|
||||
}
|
||||
})
|
||||
@@ -650,12 +650,22 @@ func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
||||
func (d *Driver) Put(id string) error {
|
||||
d.locker.Lock(id)
|
||||
defer d.locker.Unlock(id)
|
||||
dir := d.dir(id)
|
||||
if _, err := os.Stat(dir); err != nil {
|
||||
return err
|
||||
}
|
||||
mountpoint := path.Join(d.dir(id), "merged")
|
||||
if count := d.ctr.Decrement(mountpoint); count > 0 {
|
||||
return nil
|
||||
}
|
||||
err := unix.Unmount(mountpoint, unix.MNT_DETACH)
|
||||
if err != nil {
|
||||
if _, err := ioutil.ReadFile(path.Join(dir, lowerFile)); err != nil {
|
||||
// If no lower, we used the diff directory, so no work to do
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
|
||||
logrus.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err)
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user