Remove skip evaluation of symlinks to data root on IoT Core
This fix was added in8e71b1e210
to work around a go issue (https://github.com/golang/go/issues/20506). That issue was fixed in66c03d39f3
, which is part of Go 1.10 and up. This reverts the changes that were made in8e71b1e210
, and are no longer needed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
47a84dcc64
commit
bad0b4e604
|
@ -20,6 +20,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/docker/docker/pkg/fileutils"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
|
@ -765,7 +766,7 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
|
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
|
||||||
}
|
}
|
||||||
realTmp, err := getRealPath(tmp)
|
realTmp, err := fileutils.ReadSymlinkedDirectory(tmp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
|
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
|
||||||
}
|
}
|
||||||
|
@ -1447,7 +1448,7 @@ func CreateDaemonRoot(config *config.Config) error {
|
||||||
if _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) {
|
if _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) {
|
||||||
realRoot = config.Root
|
realRoot = config.Root
|
||||||
} else {
|
} else {
|
||||||
realRoot, err = getRealPath(config.Root)
|
realRoot, err = fileutils.ReadSymlinkedDirectory(config.Root)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Unable to get the full path to root (%s): %s", config.Root, err)
|
return fmt.Errorf("Unable to get the full path to root (%s): %s", config.Root, err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/docker/daemon/config"
|
"github.com/docker/docker/daemon/config"
|
||||||
"github.com/docker/docker/pkg/fileutils"
|
|
||||||
"github.com/docker/docker/pkg/mount"
|
"github.com/docker/docker/pkg/mount"
|
||||||
"github.com/docker/libnetwork/resolvconf"
|
"github.com/docker/libnetwork/resolvconf"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
@ -123,10 +122,6 @@ func getCleanPatterns(id string) (regexps []*regexp.Regexp) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func getRealPath(path string) (string, error) {
|
|
||||||
return fileutils.ReadSymlinkedDirectory(path)
|
|
||||||
}
|
|
||||||
|
|
||||||
func shouldUnmountRoot(root string, info *mount.Info) bool {
|
func shouldUnmountRoot(root string, info *mount.Info) bool {
|
||||||
if !strings.HasSuffix(root, info.Root) {
|
if !strings.HasSuffix(root, info.Root) {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -12,7 +12,6 @@ import (
|
||||||
"github.com/docker/docker/container"
|
"github.com/docker/docker/container"
|
||||||
"github.com/docker/docker/daemon/config"
|
"github.com/docker/docker/daemon/config"
|
||||||
"github.com/docker/docker/pkg/containerfs"
|
"github.com/docker/docker/pkg/containerfs"
|
||||||
"github.com/docker/docker/pkg/fileutils"
|
|
||||||
"github.com/docker/docker/pkg/idtools"
|
"github.com/docker/docker/pkg/idtools"
|
||||||
"github.com/docker/docker/pkg/parsers"
|
"github.com/docker/docker/pkg/parsers"
|
||||||
"github.com/docker/docker/pkg/platform"
|
"github.com/docker/docker/pkg/platform"
|
||||||
|
@ -651,16 +650,6 @@ func (daemon *Daemon) setupSeccompProfile() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getRealPath(path string) (string, error) {
|
|
||||||
if system.IsIoTCore() {
|
|
||||||
// Due to https://github.com/golang/go/issues/20506, path expansion
|
|
||||||
// does not work correctly on the default IoT Core configuration.
|
|
||||||
// TODO @darrenstahlmsft remove this once golang/go/20506 is fixed
|
|
||||||
return path, nil
|
|
||||||
}
|
|
||||||
return fileutils.ReadSymlinkedDirectory(path)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (daemon *Daemon) loadRuntimes() error {
|
func (daemon *Daemon) loadRuntimes() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,8 +120,6 @@ func IsWindowsClient() bool {
|
||||||
|
|
||||||
// IsIoTCore returns true if the currently running image is based off of
|
// IsIoTCore returns true if the currently running image is based off of
|
||||||
// Windows 10 IoT Core.
|
// Windows 10 IoT Core.
|
||||||
// @engine maintainers - this function should not be removed or modified as it
|
|
||||||
// is used to enforce licensing restrictions on Windows.
|
|
||||||
func IsIoTCore() bool {
|
func IsIoTCore() bool {
|
||||||
var returnedProductType uint32
|
var returnedProductType uint32
|
||||||
r1, _, err := procGetProductInfo.Call(6, 1, 0, 0, uintptr(unsafe.Pointer(&returnedProductType)))
|
r1, _, err := procGetProductInfo.Call(6, 1, 0, 0, uintptr(unsafe.Pointer(&returnedProductType)))
|
||||||
|
|
Loading…
Reference in New Issue