fix(deps): update module github.com/docker/buildx to v0.18.0 (main) (#312)
This commit is contained in:
committed by
GitHub
parent
0b7a26a9b6
commit
0ce316d7de
@@ -329,8 +329,8 @@ func (c *cli) execBuild(b Build) (*client.SolveResponse, error) {
|
||||
return nil, err
|
||||
}
|
||||
// We abuse the pb.Secret proto by stuffing the secret's value in
|
||||
// XXX_unrecognized. We never serialize this proto so this is tolerable.
|
||||
env = append(env, fmt.Sprintf("%s=%s", envvar, s.XXX_unrecognized))
|
||||
// Env. We never serialize this proto so this is tolerable.
|
||||
env = append(env, fmt.Sprintf("%s=%s", envvar, s.Env))
|
||||
args = append(args, "--secret", fmt.Sprintf("id=%s,env=%s", s.ID, envvar))
|
||||
}
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/distribution/reference"
|
||||
buildx "github.com/docker/buildx/build"
|
||||
"github.com/docker/buildx/commands"
|
||||
controllerapi "github.com/docker/buildx/controller/pb"
|
||||
"github.com/docker/buildx/util/confutil"
|
||||
"github.com/docker/buildx/util/dockerutil"
|
||||
"github.com/docker/buildx/util/platformutil"
|
||||
"github.com/docker/buildx/util/progress"
|
||||
@@ -197,7 +197,7 @@ func (c *cli) Build(
|
||||
DockerfilePath: opts.DockerfileName,
|
||||
DockerfileInline: build.Inline(),
|
||||
NamedContexts: namedContexts,
|
||||
InStream: strings.NewReader(""),
|
||||
InStream: buildx.NewSyncMultiReader(strings.NewReader("")),
|
||||
},
|
||||
// Disable default provenance for now. Docker's `manifest create`
|
||||
// doesn't handle manifests with provenance included; more reason
|
||||
@@ -230,7 +230,7 @@ func (c *cli) Build(
|
||||
b.nodes,
|
||||
payload,
|
||||
dockerutil.NewClient(c),
|
||||
filepath.Dir(c.ConfigFile().Filename),
|
||||
confutil.NewConfig(c),
|
||||
printer,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
@@ -466,15 +466,15 @@ type build struct {
|
||||
exec bool
|
||||
}
|
||||
|
||||
func (b build) BuildOptions() controllerapi.BuildOptions {
|
||||
return b.opts
|
||||
func (b *build) BuildOptions() controllerapi.BuildOptions {
|
||||
return b.opts //nolint:govet // copylocks - not serialized.
|
||||
}
|
||||
|
||||
func (b build) Inline() string {
|
||||
func (b *build) Inline() string {
|
||||
return b.inline
|
||||
}
|
||||
|
||||
func (b build) Secrets() session.Attachable {
|
||||
func (b *build) Secrets() session.Attachable {
|
||||
m := map[string][]byte{}
|
||||
for k, v := range b.secrets {
|
||||
m[k] = []byte(v)
|
||||
@@ -482,7 +482,7 @@ func (b build) Secrets() session.Attachable {
|
||||
return secretsprovider.FromMap(m)
|
||||
}
|
||||
|
||||
func (b build) ShouldExec() bool {
|
||||
func (b *build) ShouldExec() bool {
|
||||
return b.exec
|
||||
}
|
||||
|
||||
@@ -507,8 +507,8 @@ func (ia ImageArgs) toBuild(
|
||||
"Instead, perform one cached build per platform and create an Index to join them all together.")
|
||||
}
|
||||
|
||||
return build{
|
||||
opts: opts,
|
||||
return &build{
|
||||
opts: opts, //nolint:govet // copylocks - not serialized.
|
||||
inline: ia.Dockerfile.Inline,
|
||||
secrets: ia.Secrets,
|
||||
exec: ia.Exec,
|
||||
@@ -626,10 +626,10 @@ func (ia *ImageArgs) validate(preview bool) (controllerapi.BuildOptions, error)
|
||||
secrets := []*controllerapi.Secret{}
|
||||
for k, v := range normalized.Secrets {
|
||||
// We abuse the pb.Secret proto by stuffing the secret's value in
|
||||
// XXX_unrecognized. We never serialize this proto so this is tolerable.
|
||||
// Env. We never serialize this proto so this is tolerable.
|
||||
secrets = append(secrets, &controllerapi.Secret{
|
||||
ID: k,
|
||||
XXX_unrecognized: []byte(v),
|
||||
ID: k,
|
||||
Env: v,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -659,7 +659,7 @@ func (ia *ImageArgs) validate(preview bool) (controllerapi.BuildOptions, error)
|
||||
Target: normalized.Target,
|
||||
}
|
||||
|
||||
return opts, multierr
|
||||
return opts, multierr //nolint:govet // copylocks - not serialized.
|
||||
}
|
||||
|
||||
// Create builds an image using buildkit.
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestImageLifecycle(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
c := NewMockClient(ctrl)
|
||||
c.EXPECT().BuildKitEnabled().Return(true, nil).AnyTimes()
|
||||
c.EXPECT().Build(gomock.Any(), gomock.AssignableToTypeOf(build{})).DoAndReturn(
|
||||
c.EXPECT().Build(gomock.Any(), gomock.AssignableToTypeOf(&build{})).DoAndReturn(
|
||||
func(_ context.Context, b Build) (*client.SolveResponse, error) {
|
||||
assert.Equal(t, "testdata/noop/Dockerfile", b.BuildOptions().DockerfileName)
|
||||
return &client.SolveResponse{
|
||||
@@ -238,7 +238,7 @@ func TestImageLifecycle(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
c := NewMockClient(ctrl)
|
||||
c.EXPECT().BuildKitEnabled().Return(true, nil).AnyTimes()
|
||||
c.EXPECT().Build(gomock.Any(), gomock.AssignableToTypeOf(build{})).DoAndReturn(
|
||||
c.EXPECT().Build(gomock.Any(), gomock.AssignableToTypeOf(&build{})).DoAndReturn(
|
||||
func(_ context.Context, b Build) (*client.SolveResponse, error) {
|
||||
assert.Equal(t, "testdata/noop/Dockerfile", b.BuildOptions().DockerfileName)
|
||||
return &client.SolveResponse{
|
||||
@@ -279,7 +279,7 @@ func TestImageLifecycle(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
c := NewMockClient(ctrl)
|
||||
c.EXPECT().BuildKitEnabled().Return(true, nil).AnyTimes()
|
||||
c.EXPECT().Build(gomock.Any(), gomock.AssignableToTypeOf(build{})).DoAndReturn(
|
||||
c.EXPECT().Build(gomock.Any(), gomock.AssignableToTypeOf(&build{})).DoAndReturn(
|
||||
func(_ context.Context, b Build) (*client.SolveResponse, error) {
|
||||
assert.Equal(t, "FROM alpine:latest", b.Inline())
|
||||
return &client.SolveResponse{
|
||||
|
||||
Reference in New Issue
Block a user