mirror of
https://github.com/containers/skopeo.git
synced 2025-09-26 12:44:55 +00:00
Bump github.com/containers/common from 0.11.2 to 0.11.4
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.11.2 to 0.11.4. - [Release notes](https://github.com/containers/common/releases) - [Commits](https://github.com/containers/common/compare/v0.11.2...v0.11.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
committed by
Daniel J Walsh
parent
96353f2b64
commit
a31d6069dc
43
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
43
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@@ -33,6 +33,7 @@ import (
|
||||
"github.com/opencontainers/selinux/go-selinux/label"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vbatts/tar-split/tar/storage"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
@@ -152,11 +153,11 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
|
||||
}
|
||||
|
||||
// Create the driver home dir
|
||||
if err := idtools.MkdirAllAs(path.Join(home, linkDir), 0700, rootUID, rootGID); err != nil && !os.IsExist(err) {
|
||||
if err := idtools.MkdirAllAs(path.Join(home, linkDir), 0700, rootUID, rootGID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
runhome := filepath.Join(options.RunRoot, filepath.Base(home))
|
||||
if err := idtools.MkdirAllAs(runhome, 0700, rootUID, rootGID); err != nil && !os.IsExist(err) {
|
||||
if err := idtools.MkdirAllAs(runhome, 0700, rootUID, rootGID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -555,7 +556,7 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) (retErr
|
||||
return err
|
||||
}
|
||||
// Make the link directory if it does not exist
|
||||
if err := idtools.MkdirAllAs(path.Join(d.home, linkDir), 0700, rootUID, rootGID); err != nil && !os.IsExist(err) {
|
||||
if err := idtools.MkdirAllAs(path.Join(d.home, linkDir), 0700, rootUID, rootGID); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := idtools.MkdirAllAs(path.Dir(dir), 0700, rootUID, rootGID); err != nil {
|
||||
@@ -767,7 +768,7 @@ func (d *Driver) recreateSymlinks() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := idtools.MkdirAllAs(path.Join(d.home, linkDir), 0700, rootUID, rootGID); err != nil && !os.IsExist(err) {
|
||||
if err := idtools.MkdirAllAs(path.Join(d.home, linkDir), 0700, rootUID, rootGID); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, dir := range dirs {
|
||||
@@ -809,6 +810,13 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
|
||||
}
|
||||
readWrite := true
|
||||
|
||||
for _, o := range options.Options {
|
||||
if o == "ro" {
|
||||
readWrite = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
lowers, err := ioutil.ReadFile(path.Join(dir, lowerFile))
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return "", err
|
||||
@@ -886,7 +894,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
|
||||
|
||||
// if we are doing a readOnly mount, and there is only one lower
|
||||
// We should just return the lower directory, no reason to mount.
|
||||
if !readWrite {
|
||||
if !readWrite && d.options.mountProgram == "" {
|
||||
if len(absLowers) == 0 {
|
||||
return path.Join(dir, "empty"), nil
|
||||
}
|
||||
@@ -904,10 +912,8 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
|
||||
return "", err
|
||||
}
|
||||
diffDir := path.Join(dir, "diff")
|
||||
if readWrite {
|
||||
if err := idtools.MkdirAllAs(diffDir, 0755, rootUID, rootGID); err != nil && !os.IsExist(err) {
|
||||
return "", err
|
||||
}
|
||||
if err := idtools.MkdirAllAs(diffDir, 0755, rootUID, rootGID); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
mergedDir := path.Join(dir, "merged")
|
||||
@@ -932,7 +938,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
|
||||
if readWrite {
|
||||
opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(absLowers, ":"), diffDir, path.Join(dir, "work"))
|
||||
} else {
|
||||
opts = fmt.Sprintf("lowerdir=%s", strings.Join(absLowers, ":"))
|
||||
opts = fmt.Sprintf("lowerdir=%s:%s", diffDir, strings.Join(absLowers, ":"))
|
||||
}
|
||||
if len(options.Options) > 0 {
|
||||
opts = fmt.Sprintf("%s,%s", strings.Join(options.Options, ","), opts)
|
||||
@@ -1018,7 +1024,7 @@ func (d *Driver) Put(id string) error {
|
||||
// If they fail, fallback to unix.Unmount
|
||||
for _, v := range []string{"fusermount3", "fusermount"} {
|
||||
err := exec.Command(v, "-u", mountpoint).Run()
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
if err != nil && errors.Cause(err) != exec.ErrNotFound {
|
||||
logrus.Debugf("Error unmounting %s with %s - %v", mountpoint, v, err)
|
||||
}
|
||||
if err == nil {
|
||||
@@ -1090,6 +1096,21 @@ func (d *Driver) getWhiteoutFormat() archive.WhiteoutFormat {
|
||||
return whiteoutFormat
|
||||
}
|
||||
|
||||
type fileGetNilCloser struct {
|
||||
storage.FileGetter
|
||||
}
|
||||
|
||||
func (f fileGetNilCloser) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DiffGetter returns a FileGetCloser that can read files from the directory that
|
||||
// contains files for the layer differences. Used for direct access for tar-split.
|
||||
func (d *Driver) DiffGetter(id string) (graphdriver.FileGetCloser, error) {
|
||||
p := d.getDiffPath(id)
|
||||
return fileGetNilCloser{storage.NewPathFileGetter(p)}, nil
|
||||
}
|
||||
|
||||
// ApplyDiff applies the new layer into a root
|
||||
func (d *Driver) ApplyDiff(id, parent string, options graphdriver.ApplyDiffOpts) (size int64, err error) {
|
||||
|
||||
|
Reference in New Issue
Block a user