mirror of
https://github.com/containers/podman.git
synced 2025-10-20 20:54:45 +08:00
@ -39,7 +39,7 @@
|
|||||||
%global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7})
|
%global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7})
|
||||||
|
|
||||||
Name: podman
|
Name: podman
|
||||||
Version: 1.0.5
|
Version: 1.0.6
|
||||||
Release: #COMMITDATE#.git%{shortcommit0}%{?dist}
|
Release: #COMMITDATE#.git%{shortcommit0}%{?dist}
|
||||||
Summary: Manage Pods, Containers and Container Images
|
Summary: Manage Pods, Containers and Container Images
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
|
@ -12,7 +12,7 @@ github.com/containerd/continuity master
|
|||||||
github.com/containernetworking/cni v0.7.0-alpha1
|
github.com/containernetworking/cni v0.7.0-alpha1
|
||||||
github.com/containernetworking/plugins 1562a1e60ed101aacc5e08ed9dbeba8e9f3d4ec1
|
github.com/containernetworking/plugins 1562a1e60ed101aacc5e08ed9dbeba8e9f3d4ec1
|
||||||
github.com/containers/image 93bced01015eb94bec4821df1876314be8197680
|
github.com/containers/image 93bced01015eb94bec4821df1876314be8197680
|
||||||
github.com/containers/storage 67bf6c9b41967780f4bcb5725c00283ad6397679 https://github.com/mheon/storage.git
|
github.com/containers/storage backport_symlinks https://github.com/mheon/storage.git
|
||||||
github.com/containers/psgo dc0bc9fac5b715034c4310ed4d795b3182360842
|
github.com/containers/psgo dc0bc9fac5b715034c4310ed4d795b3182360842
|
||||||
github.com/coreos/go-systemd v14
|
github.com/coreos/go-systemd v14
|
||||||
github.com/cri-o/ocicni 2d2983e40c242322a56c22a903785e7f83eb378c
|
github.com/cri-o/ocicni 2d2983e40c242322a56c22a903785e7f83eb378c
|
||||||
|
59
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
59
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@ -16,7 +16,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/containers/storage/drivers"
|
graphdriver "github.com/containers/storage/drivers"
|
||||||
"github.com/containers/storage/drivers/overlayutils"
|
"github.com/containers/storage/drivers/overlayutils"
|
||||||
"github.com/containers/storage/drivers/quota"
|
"github.com/containers/storage/drivers/quota"
|
||||||
"github.com/containers/storage/pkg/archive"
|
"github.com/containers/storage/pkg/archive"
|
||||||
@ -558,6 +558,10 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) (retErr
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := idtools.MkdirAllAs(path.Dir(dir), 0700, rootUID, rootGID); err != nil {
|
if err := idtools.MkdirAllAs(path.Dir(dir), 0700, rootUID, rootGID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -761,6 +765,48 @@ func (d *Driver) Remove(id string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// recreateSymlinks goes through the driver's home directory and checks if the diff directory
|
||||||
|
// under each layer has a symlink created for it under the linkDir. If the symlink does not
|
||||||
|
// exist, it creates them
|
||||||
|
func (d *Driver) recreateSymlinks() error {
|
||||||
|
// List all the directories under the home directory
|
||||||
|
dirs, err := ioutil.ReadDir(d.home)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error reading driver home directory %q: %v", d.home, err)
|
||||||
|
}
|
||||||
|
// This makes the link directory if it doesn't exist
|
||||||
|
rootUID, rootGID, err := idtools.GetRootUIDGID(d.uidMaps, d.gidMaps)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := idtools.MkdirAllAs(path.Join(d.home, linkDir), 0700, rootUID, rootGID); err != nil && !os.IsExist(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, dir := range dirs {
|
||||||
|
// Skip over the linkDir and anything that is not a directory
|
||||||
|
if dir.Name() == linkDir || !dir.Mode().IsDir() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// Read the "link" file under each layer to get the name of the symlink
|
||||||
|
data, err := ioutil.ReadFile(path.Join(d.dir(dir.Name()), "link"))
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error reading name of symlink for %q: %v", dir, err)
|
||||||
|
}
|
||||||
|
linkPath := path.Join(d.home, linkDir, strings.Trim(string(data), "\n"))
|
||||||
|
// Check if the symlink exists, and if it doesn't create it again with the name we
|
||||||
|
// got from the "link" file
|
||||||
|
_, err = os.Stat(linkPath)
|
||||||
|
if err != nil && os.IsNotExist(err) {
|
||||||
|
if err := os.Symlink(path.Join("..", dir.Name(), "diff"), linkPath); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else if err != nil {
|
||||||
|
return fmt.Errorf("error trying to stat %q: %v", linkPath, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Get creates and mounts the required file system for the given id and returns the mount path.
|
// Get creates and mounts the required file system for the given id and returns the mount path.
|
||||||
func (d *Driver) Get(id string, options graphdriver.MountOpts) (_ string, retErr error) {
|
func (d *Driver) Get(id string, options graphdriver.MountOpts) (_ string, retErr error) {
|
||||||
return d.get(id, false, options)
|
return d.get(id, false, options)
|
||||||
@ -816,7 +862,16 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
|
|||||||
}
|
}
|
||||||
lower = ""
|
lower = ""
|
||||||
}
|
}
|
||||||
if lower == "" {
|
// if it is a "not found" error, that means the symlinks were lost in a sudden reboot
|
||||||
|
// so call the recreateSymlinks function to go through all the layer dirs and recreate
|
||||||
|
// the symlinks with the name from their respective "link" files
|
||||||
|
if lower == "" && os.IsNotExist(err) {
|
||||||
|
logrus.Warnf("Can't stat lower layer %q because it does not exist. Going through storage to recreate the missing symlinks.", newpath)
|
||||||
|
if err := d.recreateSymlinks(); err != nil {
|
||||||
|
return "", fmt.Errorf("error recreating the missing symlinks: %v", err)
|
||||||
|
}
|
||||||
|
lower = newpath
|
||||||
|
} else if lower == "" {
|
||||||
return "", fmt.Errorf("Can't stat lower layer %q: %v", newpath, err)
|
return "", fmt.Errorf("Can't stat lower layer %q: %v", newpath, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,4 +4,4 @@ package version
|
|||||||
// NOTE: remember to bump the version at the top
|
// NOTE: remember to bump the version at the top
|
||||||
// of the top-level README.md file when this is
|
// of the top-level README.md file when this is
|
||||||
// bumped.
|
// bumped.
|
||||||
const Version = "1.0.5-dev"
|
const Version = "1.0.6-dev"
|
||||||
|
Reference in New Issue
Block a user