vendor: github.com/docker/docker 06499c52e2b1 (v25.0.0-dev)
full diff: https://github.com/docker/docker/compare/032797ea4bcb...06499c52e2b12b0540fed5c47a22e25c0cf6775a Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+4
-10
@@ -10,17 +10,11 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/user"
|
||||
)
|
||||
|
||||
var (
|
||||
entOnce sync.Once
|
||||
getentCmd string
|
||||
)
|
||||
|
||||
func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error {
|
||||
path, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
@@ -161,10 +155,10 @@ func getentGroup(name string) (user.Group, error) {
|
||||
}
|
||||
|
||||
func callGetent(database, key string) (io.Reader, error) {
|
||||
entOnce.Do(func() { getentCmd, _ = resolveBinary("getent") })
|
||||
// if no `getent` command on host, can't do anything else
|
||||
if getentCmd == "" {
|
||||
return nil, fmt.Errorf("unable to find getent command")
|
||||
getentCmd, err := resolveBinary("getent")
|
||||
// if no `getent` command within the execution environment, can't do anything else
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to find getent command: %w", err)
|
||||
}
|
||||
command := exec.Command(getentCmd, database, key)
|
||||
// we run getent within container filesystem, but without /dev so /dev/null is not available for exec to mock stdin
|
||||
|
||||
+3
-10
@@ -1,13 +1,6 @@
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
// ErrNotSupportedPlatform means the platform is not supported.
|
||||
ErrNotSupportedPlatform = errors.New("platform and architecture is not supported")
|
||||
|
||||
// ErrNotSupportedOperatingSystem means the operating system is not supported.
|
||||
ErrNotSupportedOperatingSystem = errors.New("operating system is not supported")
|
||||
)
|
||||
// ErrNotSupportedPlatform means the platform is not supported.
|
||||
var ErrNotSupportedPlatform = errors.New("platform and architecture is not supported")
|
||||
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
import (
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// IsOSSupported determines if an operating system is supported by the host.
|
||||
func IsOSSupported(os string) bool {
|
||||
return strings.EqualFold(runtime.GOOS, os)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ErrNotSupportedOperatingSystem means the operating system is not supported.
|
||||
//
|
||||
// Deprecated: use [github.com/docker/docker/image.CheckOS] and check the error returned.
|
||||
var ErrNotSupportedOperatingSystem = errors.New("operating system is not supported")
|
||||
|
||||
// IsOSSupported determines if an operating system is supported by the host.
|
||||
//
|
||||
// Deprecated: use [github.com/docker/docker/image.CheckOS] and check the error returned.
|
||||
func IsOSSupported(os string) bool {
|
||||
return strings.EqualFold(runtime.GOOS, os)
|
||||
}
|
||||
Reference in New Issue
Block a user