Compare commits

...

6 Commits

Author SHA1 Message Date
Tõnis Tiigi
ef73c64d2c Merge pull request #2993 from tonistiigi/update-buildkit-v0.20.0-rc2
vendor: update buildkit to v0.20.0-rc2
2025-02-13 17:15:50 -08:00
Tonis Tiigi
1784f84561 vendor: update buildkit to v0.20.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-13 16:54:50 -08:00
Tõnis Tiigi
6a6fa4f422 Merge pull request #2986 from tonistiigi/remove-x-slices
remove import of x/exp
2025-02-13 10:16:48 -08:00
Tõnis Tiigi
2389d457a4 Merge pull request #2988 from crazy-max/ctn-driver-display-pull-error
docker-container: check error from response body when pulling image
2025-02-12 08:47:05 -08:00
CrazyMax
3f82aadc6e docker-container: check error from response body when pulling image
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-12 12:35:27 +01:00
Tonis Tiigi
79e3f12305 remove import of x/exp
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-11 19:23:36 -08:00
10 changed files with 30 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"os"
"slices"
"time"
"github.com/containerd/console"
@@ -18,7 +19,6 @@ import (
"github.com/docker/cli/cli/command/formatter"
"github.com/docker/go-units"
"github.com/spf13/cobra"
"golang.org/x/exp/slices"
)
const (

View File

@@ -26,6 +26,7 @@ import (
"github.com/docker/docker/errdefs"
dockerarchive "github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/stdcopy"
"github.com/moby/buildkit/client"
"github.com/pkg/errors"
@@ -94,14 +95,14 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
if err != nil {
return err
}
rc, err := d.DockerAPI.ImageCreate(ctx, imageName, image.CreateOptions{
resp, err := d.DockerAPI.ImageCreate(ctx, imageName, image.CreateOptions{
RegistryAuth: ra,
})
if err != nil {
return err
}
_, err = io.Copy(io.Discard, rc)
return err
defer resp.Close()
return jsonmessage.DisplayJSONMessagesStream(resp, io.Discard, 0, false, nil)
}); err != nil {
// image pulling failed, check if it exists in local image store.
// if not, return pulling error. otherwise log it.

4
go.mod
View File

@@ -29,7 +29,7 @@ require (
github.com/hashicorp/hcl/v2 v2.23.0
github.com/in-toto/in-toto-golang v0.5.0
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/moby/buildkit v0.20.0-rc1
github.com/moby/buildkit v0.20.0-rc2
github.com/moby/sys/mountinfo v0.7.2
github.com/moby/sys/signal v0.7.1
github.com/morikuni/aec v1.0.0
@@ -53,7 +53,6 @@ require (
go.opentelemetry.io/otel/metric v1.31.0
go.opentelemetry.io/otel/sdk v1.31.0
go.opentelemetry.io/otel/trace v1.31.0
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
golang.org/x/mod v0.22.0
golang.org/x/sync v0.10.0
golang.org/x/sys v0.29.0
@@ -171,6 +170,7 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/time v0.6.0 // indirect

4
go.sum
View File

@@ -297,8 +297,8 @@ github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/z
github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/buildkit v0.20.0-rc1 h1:aRO8ApLVz7EuzCVPUFmXiU5nwQkYDUPty9InUp0HJes=
github.com/moby/buildkit v0.20.0-rc1/go.mod h1:mtRqVBkksyvFm+ljU1u+cigDh36TdFvlEGfz/XbYTiI=
github.com/moby/buildkit v0.20.0-rc2 h1:QjACghvG0pSAp7dk9aQMYWioDEOljDWyyoUjyg35qfg=
github.com/moby/buildkit v0.20.0-rc2/go.mod h1:kMXf90l/f3zygRK8bYbyetfyzoJYntb6Bpi2VsLfXgQ=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=

View File

@@ -463,7 +463,7 @@ func init() {
Caps.Init(apicaps.Cap{
ID: CapRemoteCacheAzBlob,
Enabled: false,
Enabled: true,
Status: apicaps.CapStatusExperimental,
})

View File

@@ -110,6 +110,20 @@ func (r *Result[T]) EachRef(fn func(T) error) (err error) {
return err
}
// IsEmpty returns true if this result does not refer to
// any references.
func (r *Result[T]) IsEmpty() bool {
r.mu.Lock()
defer r.mu.Unlock()
if len(r.Refs) > 0 {
return false
}
var zero T
return r.Ref == zero
}
// EachRef iterates over references in both a and b.
// a and b are assumed to be of the same size and map their references
// to the same set of keys

View File

@@ -18,7 +18,7 @@ var (
var (
UserCNIConfigPath = DefaultCNIConfigPath
CDISpecDirs []string
CDISpecDirs = []string{filepath.Join(os.Getenv("ProgramData"), "buildkitd", "cdi")}
)
func UserAddress() string {

View File

@@ -41,6 +41,7 @@ func InitDockerdWorker() {
FeatureSBOM,
FeatureSecurityMode,
FeatureCNINetwork,
FeatureCDI,
},
})
integration.Register(&Moby{
@@ -51,6 +52,7 @@ func InitDockerdWorker() {
FeatureSecurityMode,
FeatureCNINetwork,
FeatureContentCheck,
FeatureCDI,
},
})
}

View File

@@ -31,6 +31,7 @@ const (
FeatureSourceDateEpoch = "source_date_epoch"
FeatureCNINetwork = "cni_network"
FeatureContentCheck = "content_check"
FeatureCDI = "cdi"
)
var features = map[string]struct{}{
@@ -58,6 +59,7 @@ var features = map[string]struct{}{
FeatureSourceDateEpoch: {},
FeatureCNINetwork: {},
FeatureContentCheck: {},
FeatureCDI: {},
}
func CheckFeatureCompat(t *testing.T, sb integration.Sandbox, reason ...string) {

2
vendor/modules.txt vendored
View File

@@ -493,7 +493,7 @@ github.com/mitchellh/go-wordwrap
github.com/mitchellh/hashstructure/v2
# github.com/mitchellh/mapstructure v1.5.0
## explicit; go 1.14
# github.com/moby/buildkit v0.20.0-rc1
# github.com/moby/buildkit v0.20.0-rc2
## explicit; go 1.22.0
github.com/moby/buildkit/api/services/control
github.com/moby/buildkit/api/types