Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 87cf3fa

Browse files
committed
Remove skip evaluation of symlinks to data root on IoT Core
This fix was added in 8e71b1e to work around a go issue (golang/go#20506). That issue was fixed in golang/go@66c03d3, which is part of Go 1.10 and up. This reverts the changes that were made in 8e71b1e, and are no longer needed. Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: bad0b4e6043fa45e5f17f863f6c4dfba4398f414 Component: engine
1 parent 07602ec commit 87cf3fa

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

components/engine/daemon/daemon.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"sync"
2121
"time"
2222

23+
"github.com/docker/docker/pkg/fileutils"
2324
"google.golang.org/grpc"
2425

2526
"github.com/containerd/containerd"
@@ -765,7 +766,7 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
765766
if err != nil {
766767
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
767768
}
768-
realTmp, err := getRealPath(tmp)
769+
realTmp, err := fileutils.ReadSymlinkedDirectory(tmp)
769770
if err != nil {
770771
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
771772
}
@@ -1447,7 +1448,7 @@ func CreateDaemonRoot(config *config.Config) error {
14471448
if _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) {
14481449
realRoot = config.Root
14491450
} else {
1450-
realRoot, err = getRealPath(config.Root)
1451+
realRoot, err = fileutils.ReadSymlinkedDirectory(config.Root)
14511452
if err != nil {
14521453
return fmt.Errorf("Unable to get the full path to root (%s): %s", config.Root, err)
14531454
}

components/engine/daemon/daemon_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"strings"
1010

1111
"github.com/docker/docker/daemon/config"
12-
"github.com/docker/docker/pkg/fileutils"
1312
"github.com/docker/docker/pkg/mount"
1413
"github.com/docker/libnetwork/resolvconf"
1514
"github.com/pkg/errors"
@@ -123,10 +122,6 @@ func getCleanPatterns(id string) (regexps []*regexp.Regexp) {
123122
return
124123
}
125124

126-
func getRealPath(path string) (string, error) {
127-
return fileutils.ReadSymlinkedDirectory(path)
128-
}
129-
130125
func shouldUnmountRoot(root string, info *mount.Info) bool {
131126
if !strings.HasSuffix(root, info.Root) {
132127
return false

components/engine/daemon/daemon_windows.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/docker/docker/container"
1313
"github.com/docker/docker/daemon/config"
1414
"github.com/docker/docker/pkg/containerfs"
15-
"github.com/docker/docker/pkg/fileutils"
1615
"github.com/docker/docker/pkg/idtools"
1716
"github.com/docker/docker/pkg/parsers"
1817
"github.com/docker/docker/pkg/platform"
@@ -651,16 +650,6 @@ func (daemon *Daemon) setupSeccompProfile() error {
651650
return nil
652651
}
653652

654-
func getRealPath(path string) (string, error) {
655-
if system.IsIoTCore() {
656-
// Due to https://github.com/golang/go/issues/20506, path expansion
657-
// does not work correctly on the default IoT Core configuration.
658-
// TODO @darrenstahlmsft remove this once golang/go/20506 is fixed
659-
return path, nil
660-
}
661-
return fileutils.ReadSymlinkedDirectory(path)
662-
}
663-
664653
func (daemon *Daemon) loadRuntimes() error {
665654
return nil
666655
}

components/engine/pkg/system/syscall_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ func IsWindowsClient() bool {
120120

121121
// IsIoTCore returns true if the currently running image is based off of
122122
// Windows 10 IoT Core.
123-
// @engine maintainers - this function should not be removed or modified as it
124-
// is used to enforce licensing restrictions on Windows.
125123
func IsIoTCore() bool {
126124
var returnedProductType uint32
127125
r1, _, err := procGetProductInfo.Call(6, 1, 0, 0, uintptr(unsafe.Pointer(&returnedProductType)))

0 commit comments

Comments
 (0)