Skip to content

Commit

Permalink
WIP: testing API type moves
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Jun 9, 2024
1 parent bc3a5c4 commit 882878d
Show file tree
Hide file tree
Showing 26 changed files with 289 additions and 205 deletions.
8 changes: 4 additions & 4 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/docker/buildx/util/resolver"
"github.com/docker/buildx/util/waitmap"
"github.com/docker/cli/opts"
imagetypes "github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
Expand Down Expand Up @@ -665,7 +665,7 @@ func pushWithMoby(ctx context.Context, d *driver.DriverHandle, name string, l pr
return err
}

rc, err := api.ImagePush(ctx, name, imagetypes.PushOptions{
rc, err := api.ImagePush(ctx, name, image.PushOptions{
RegistryAuth: creds,
})
if err != nil {
Expand Down Expand Up @@ -744,11 +744,11 @@ func remoteDigestWithMoby(ctx context.Context, d *driver.DriverHandle, name stri
if err != nil {
return "", err
}
image, _, err := api.ImageInspectWithRaw(ctx, name)
img, _, err := api.ImageInspectWithRaw(ctx, name)
if err != nil {
return "", err
}
if len(image.RepoDigests) == 0 {
if len(img.RepoDigests) == 0 {
return "", nil
}
remoteImage, err := api.DistributionInspect(ctx, name, creds)
Expand Down
7 changes: 3 additions & 4 deletions driver/docker-container/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/docker/buildx/util/imagetools"
"github.com/docker/buildx/util/progress"
"github.com/docker/cli/opts"
dockertypes "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/mount"
Expand Down Expand Up @@ -256,11 +255,11 @@ func (d *Driver) copyToContainer(ctx context.Context, files map[string][]byte) e
defer srcArchive.Close()

baseDir := path.Dir(confutil.DefaultBuildKitConfigDir)
return d.DockerAPI.CopyToContainer(ctx, d.Name, baseDir, srcArchive, dockertypes.CopyToContainerOptions{})
return d.DockerAPI.CopyToContainer(ctx, d.Name, baseDir, srcArchive, container.CopyToContainerOptions{})
}

func (d *Driver) exec(ctx context.Context, cmd []string) (string, net.Conn, error) {
response, err := d.DockerAPI.ContainerExecCreate(ctx, d.Name, dockertypes.ExecConfig{
response, err := d.DockerAPI.ContainerExecCreate(ctx, d.Name, container.ExecOptions{
Cmd: cmd,
AttachStdin: true,
AttachStdout: true,
Expand All @@ -275,7 +274,7 @@ func (d *Driver) exec(ctx context.Context, cmd []string) (string, net.Conn, erro
return "", nil, errors.New("exec ID empty")
}

resp, err := d.DockerAPI.ContainerExecAttach(ctx, execID, dockertypes.ExecStartCheck{})
resp, err := d.DockerAPI.ContainerExecAttach(ctx, execID, container.ExecStartOptions{})
if err != nil {
return "", nil, err
}
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ go 1.21

// FIXME(thaJeztah); testing https://github.com/moby/buildkit/pull/4989
replace (
github.com/docker/cli => github.com/docker/cli v26.1.1-0.20240607143903-7ae9f2738c6b+incompatible // master / v27.0.0-dev
github.com/docker/docker => github.com/docker/docker v26.1.1-0.20240607155439-4fb17cb3afa7+incompatible // master / v27.0.0-dev
// FIXME(thaJeztah): testing https://github.com/docker/cli/pull/5134
github.com/docker/cli => github.com/thaJeztah/cli v0.0.0-20240609123854-8a77ee3fbde7 // master / v27.0.0-dev
// FIXME(thaJeztah): testing https://github.com/moby/moby/pull/47936
github.com/docker/docker => github.com/thaJeztah/docker v24.0.0-rc.1.0.20240609111352-e1f56139da8e+incompatible // master / v27.0.0-dev
github.com/moby/buildkit => github.com/thaJeztah/buildkit v0.0.0-20240607162114-45a674da0ad8
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,11 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v26.1.1-0.20240607143903-7ae9f2738c6b+incompatible h1:EzOsKvsBffOF9UDqAfcuRwtEFlhj7YRdNflO/rhWoRs=
github.com/docker/cli v26.1.1-0.20240607143903-7ae9f2738c6b+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli-docs-tool v0.7.0 h1:M2Da98Unz2kz3A5d4yeSGbhyOge2mfYSNjAFt01Rw0M=
github.com/docker/cli-docs-tool v0.7.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v26.1.1-0.20240607155439-4fb17cb3afa7+incompatible h1:MjwKhiEPrqHPigIVGteLpSk5YlrAZyAf6lLuIKdS+vE=
github.com/docker/docker v26.1.1-0.20240607155439-4fb17cb3afa7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
Expand Down Expand Up @@ -433,6 +429,10 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/thaJeztah/buildkit v0.0.0-20240607162114-45a674da0ad8 h1:XsaYXsRV2+EfUbfvN4d3Q7yCLYN6EFKGnIzD2zH4GSs=
github.com/thaJeztah/buildkit v0.0.0-20240607162114-45a674da0ad8/go.mod h1:A/KU7hzwjFuqpjOaceYJWS34Op1PeOsjbUY4siVCe8A=
github.com/thaJeztah/cli v0.0.0-20240609123854-8a77ee3fbde7 h1:fTMMdMzxikT5ixxqqyJFYDcIQ5V11vJQBnYeVohR8Xs=
github.com/thaJeztah/cli v0.0.0-20240609123854-8a77ee3fbde7/go.mod h1:PnmaRA7hP+mokt+80q1r6bxulIIvKxbaap8NOfsS7/Y=
github.com/thaJeztah/docker v24.0.0-rc.1.0.20240609111352-e1f56139da8e+incompatible h1:eMf1uJG3B30gBGcVAt/QOIgUehs7rgpn6MqFcrngIcw=
github.com/thaJeztah/docker v24.0.0-rc.1.0.20240609111352-e1f56139da8e+incompatible/go.mod h1:eZ6Ef2GDr/8h8se23uenzFTrBHwc9jBEEnfrxqOb0Ss=
github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c=
github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw=
github.com/tonistiigi/fsutil v0.0.0-20240424095704-91a3fc46842c h1:+6wg/4ORAbnSoGDzg2Q1i3CeMcT/jjhye/ZfnBHy7/M=
Expand Down
31 changes: 0 additions & 31 deletions vendor/github.com/docker/docker/api/types/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions vendor/github.com/docker/docker/api/types/configs.go

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/docker/docker/api/types/container/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions vendor/github.com/docker/docker/api/types/container/container.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions vendor/github.com/docker/docker/api/types/container/exec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/docker/docker/api/types/events/events.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/docker/docker/api/types/image/image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions vendor/github.com/docker/docker/api/types/registry/registry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions vendor/github.com/docker/docker/api/types/registry/search.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 882878d

Please sign in to comment.