vendor: update buildkit to master@9624ab4
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
9
vendor/github.com/docker/docker/pkg/archive/diff.go
generated
vendored
9
vendor/github.com/docker/docker/pkg/archive/diff.go
generated
vendored
@@ -229,13 +229,8 @@ func applyLayerHandler(dest string, layer io.Reader, options *TarOptions, decomp
|
||||
dest = filepath.Clean(dest)
|
||||
|
||||
// We need to be able to set any perms
|
||||
if runtime.GOOS != "windows" {
|
||||
oldmask, err := system.Umask(0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer system.Umask(oldmask)
|
||||
}
|
||||
restore := overrideUmask(0)
|
||||
defer restore()
|
||||
|
||||
if decompress {
|
||||
decompLayer, err := DecompressStream(layer)
|
||||
|
||||
22
vendor/github.com/docker/docker/pkg/archive/diff_unix.go
generated
vendored
Normal file
22
vendor/github.com/docker/docker/pkg/archive/diff_unix.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package archive
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
// overrideUmask sets current process's file mode creation mask to newmask
|
||||
// and returns a function to restore it.
|
||||
//
|
||||
// WARNING for readers stumbling upon this code. Changing umask in a multi-
|
||||
// threaded environment isn't safe. Don't use this without understanding the
|
||||
// risks, and don't export this function for others to use (we shouldn't even
|
||||
// be using this ourself).
|
||||
//
|
||||
// FIXME(thaJeztah): we should get rid of these hacks if possible.
|
||||
func overrideUmask(newMask int) func() {
|
||||
oldMask := unix.Umask(newMask)
|
||||
return func() {
|
||||
unix.Umask(oldMask)
|
||||
}
|
||||
}
|
||||
6
vendor/github.com/docker/docker/pkg/archive/diff_windows.go
generated
vendored
Normal file
6
vendor/github.com/docker/docker/pkg/archive/diff_windows.go
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
package archive
|
||||
|
||||
// overrideUmask is a no-op on windows.
|
||||
func overrideUmask(newmask int) func() {
|
||||
return func() {}
|
||||
}
|
||||
15
vendor/github.com/docker/docker/pkg/idtools/idtools_unix.go
generated
vendored
15
vendor/github.com/docker/docker/pkg/idtools/idtools_unix.go
generated
vendored
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
@@ -199,7 +200,7 @@ func callGetent(database, key string) (io.Reader, error) {
|
||||
}
|
||||
out, err := execCmd(getentCmd, database, key)
|
||||
if err != nil {
|
||||
exitCode, errC := system.GetExitCode(err)
|
||||
exitCode, errC := getExitCode(err)
|
||||
if errC != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -217,6 +218,18 @@ func callGetent(database, key string) (io.Reader, error) {
|
||||
return bytes.NewReader(out), nil
|
||||
}
|
||||
|
||||
// getExitCode returns the ExitStatus of the specified error if its type is
|
||||
// exec.ExitError, returns 0 and an error otherwise.
|
||||
func getExitCode(err error) (int, error) {
|
||||
exitCode := 0
|
||||
if exiterr, ok := err.(*exec.ExitError); ok {
|
||||
if procExit, ok := exiterr.Sys().(syscall.WaitStatus); ok {
|
||||
return procExit.ExitStatus(), nil
|
||||
}
|
||||
}
|
||||
return exitCode, fmt.Errorf("failed to get exit code")
|
||||
}
|
||||
|
||||
// setPermissions performs a chown/chmod only if the uid/gid don't match what's requested
|
||||
// Normally a Chown is a no-op if uid/gid match, but in some cases this can still cause an error, e.g. if the
|
||||
// dir is on an NFS share, so don't call chown unless we absolutely must.
|
||||
|
||||
19
vendor/github.com/docker/docker/pkg/system/exitcode.go
generated
vendored
19
vendor/github.com/docker/docker/pkg/system/exitcode.go
generated
vendored
@@ -1,19 +0,0 @@
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// GetExitCode returns the ExitStatus of the specified error if its type is
|
||||
// exec.ExitError, returns 0 and an error otherwise.
|
||||
func GetExitCode(err error) (int, error) {
|
||||
exitCode := 0
|
||||
if exiterr, ok := err.(*exec.ExitError); ok {
|
||||
if procExit, ok := exiterr.Sys().(syscall.WaitStatus); ok {
|
||||
return procExit.ExitStatus(), nil
|
||||
}
|
||||
}
|
||||
return exitCode, fmt.Errorf("failed to get exit code")
|
||||
}
|
||||
4
vendor/github.com/docker/docker/pkg/system/stat_windows.go
generated
vendored
4
vendor/github.com/docker/docker/pkg/system/stat_windows.go
generated
vendored
@@ -20,12 +20,12 @@ func (s StatT) Size() int64 {
|
||||
|
||||
// Mode returns file's permission mode.
|
||||
func (s StatT) Mode() os.FileMode {
|
||||
return os.FileMode(s.mode)
|
||||
return s.mode
|
||||
}
|
||||
|
||||
// Mtim returns file's last modification time.
|
||||
func (s StatT) Mtim() time.Time {
|
||||
return time.Time(s.mtim)
|
||||
return s.mtim
|
||||
}
|
||||
|
||||
// Stat takes a path to a file and returns
|
||||
|
||||
14
vendor/github.com/docker/docker/pkg/system/umask.go
generated
vendored
14
vendor/github.com/docker/docker/pkg/system/umask.go
generated
vendored
@@ -1,14 +0,0 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// Umask sets current process's file mode creation mask to newmask
|
||||
// and returns oldmask.
|
||||
func Umask(newmask int) (oldmask int, err error) {
|
||||
return unix.Umask(newmask), nil
|
||||
}
|
||||
7
vendor/github.com/docker/docker/pkg/system/umask_windows.go
generated
vendored
7
vendor/github.com/docker/docker/pkg/system/umask_windows.go
generated
vendored
@@ -1,7 +0,0 @@
|
||||
package system // import "github.com/docker/docker/pkg/system"
|
||||
|
||||
// Umask is not supported on the windows platform.
|
||||
func Umask(newmask int) (oldmask int, err error) {
|
||||
// should not be called on cli code path
|
||||
return 0, ErrNotSupportedPlatform
|
||||
}
|
||||
5
vendor/github.com/docker/docker/registry/service_v2.go
generated
vendored
5
vendor/github.com/docker/docker/registry/service_v2.go
generated
vendored
@@ -8,6 +8,8 @@ import (
|
||||
)
|
||||
|
||||
func (s *defaultService) lookupV2Endpoints(hostname string) (endpoints []APIEndpoint, err error) {
|
||||
ana := s.config.allowNondistributableArtifacts(hostname)
|
||||
|
||||
if hostname == DefaultNamespace || hostname == IndexHostname {
|
||||
for _, mirror := range s.config.Mirrors {
|
||||
if !strings.HasPrefix(mirror, "http://") && !strings.HasPrefix(mirror, "https://") {
|
||||
@@ -35,6 +37,8 @@ func (s *defaultService) lookupV2Endpoints(hostname string) (endpoints []APIEndp
|
||||
Official: true,
|
||||
TrimHostname: true,
|
||||
TLSConfig: tlsconfig.ServerDefault(),
|
||||
|
||||
AllowNondistributableArtifacts: ana,
|
||||
})
|
||||
|
||||
return endpoints, nil
|
||||
@@ -45,7 +49,6 @@ func (s *defaultService) lookupV2Endpoints(hostname string) (endpoints []APIEndp
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ana := s.config.allowNondistributableArtifacts(hostname)
|
||||
endpoints = []APIEndpoint{
|
||||
{
|
||||
URL: &url.URL{
|
||||
|
||||
Reference in New Issue
Block a user