Skip to content

Commit

Permalink
bake: display read definition files in build output
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Oct 23, 2023
1 parent 7838ade commit df69bb0
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 11 deletions.
103 changes: 97 additions & 6 deletions bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ import (
"sort"
"strconv"
"strings"
"time"

composecli "github.com/compose-spec/compose-go/cli"
"github.com/docker/buildx/bake/hclparser"
"github.com/docker/buildx/build"
controllerapi "github.com/docker/buildx/controller/pb"
"github.com/docker/buildx/util/buildflags"
"github.com/docker/buildx/util/platformutil"
"github.com/docker/buildx/util/progress"
"github.com/docker/cli/cli/config"
hcl "github.com/hashicorp/hcl/v2"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/session/auth/authprovider"
"github.com/pkg/errors"
Expand Down Expand Up @@ -54,28 +57,34 @@ func defaultFilenames() []string {
return names
}

func ReadLocalFiles(names []string, stdin io.Reader) ([]File, error) {
func ReadLocalFiles(names []string, stdin io.Reader, l progress.SubLogger) ([]File, error) {
isDefault := false
if len(names) == 0 {
isDefault = true
names = defaultFilenames()
}
out := make([]File, 0, len(names))

setStatus := func(st *client.VertexStatus) {
if l != nil {
l.SetStatus(st)
}
}

for _, n := range names {
var dt []byte
var err error
if n == "-" {
dt, err = io.ReadAll(stdin)
dt, err = readWithProgress(stdin, setStatus)
if err != nil {
return nil, err
}
} else {
dt, err = os.ReadFile(n)
dt, err = readFileWithProgress(n, isDefault, setStatus)
if dt == nil && err == nil {
continue
}
if err != nil {
if isDefault && errors.Is(err, os.ErrNotExist) {
continue
}
return nil, err
}
}
Expand All @@ -84,6 +93,88 @@ func ReadLocalFiles(names []string, stdin io.Reader) ([]File, error) {
return out, nil
}

func readFileWithProgress(fname string, isDefault bool, setStatus func(st *client.VertexStatus)) (dt []byte, err error) {
st := &client.VertexStatus{
ID: "reading " + fname,
}

defer func() {
now := time.Now()
st.Completed = &now
if dt != nil || err != nil {
setStatus(st)
}
}()

now := time.Now()
st.Started = &now

f, err := os.Open(fname)
if err != nil {
if isDefault && errors.Is(err, os.ErrNotExist) {
return nil, nil
}
return nil, err
}
defer f.Close()
setStatus(st)

info, err := f.Stat()
if err != nil {
return nil, err
}
st.Total = info.Size()
setStatus(st)

buf := make([]byte, 1024)
for {
n, err := f.Read(buf)
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
dt = append(dt, buf[:n]...)
st.Current += int64(n)
setStatus(st)
}

return dt, nil
}

func readWithProgress(r io.Reader, setStatus func(st *client.VertexStatus)) (dt []byte, err error) {
st := &client.VertexStatus{
ID: "reading from stdin",
}

defer func() {
now := time.Now()
st.Completed = &now
setStatus(st)
}()

now := time.Now()
st.Started = &now
setStatus(st)

buf := make([]byte, 1024)
for {
n, err := r.Read(buf)
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
dt = append(dt, buf[:n]...)
st.Current += int64(n)
setStatus(st)
}

return dt, nil
}

func ListTargets(files []File) ([]string, error) {
c, err := ParseFiles(files, nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion bake/bake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ func TestReadLocalFilesDefault(t *testing.T) {
for _, tf := range tt.filenames {
require.NoError(t, os.WriteFile(tf, []byte(tf), 0644))
}
files, err := ReadLocalFiles(nil, nil)
files, err := ReadLocalFiles(nil, nil, nil)
require.NoError(t, err)
if len(files) == 0 {
require.Equal(t, len(tt.expected), len(files))
Expand Down
5 changes: 4 additions & 1 deletion commands/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions, cFlags com
if url != "" {
files, inp, err = bake.ReadRemoteFiles(ctx, nodes, url, in.files, printer)
} else {
files, err = bake.ReadLocalFiles(in.files, dockerCli.In())
progress.Wrap("[internal] load local bake definitions", printer.Write, func(sub progress.SubLogger) error {
files, err = bake.ReadLocalFiles(in.files, dockerCli.In(), sub)
return nil
})
}
if err != nil {
return err
Expand Down
45 changes: 43 additions & 2 deletions tests/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func bakeCmd(sb integration.Sandbox, opts ...cmdOpt) (string, error) {

var bakeTests = []func(t *testing.T, sb integration.Sandbox){
testBakeLocal,
testBakeLocalMulti,
testBakeRemote,
testBakeRemoteCmdContext,
testBakeRemoteCmdContextOverride,
Expand Down Expand Up @@ -47,8 +48,45 @@ target "default" {
)
dirDest := t.TempDir()

out, err := bakeCmd(sb, withDir(dir), withArgs("--set", "*.output=type=local,dest="+dirDest))
cmd := buildxCmd(sb, withDir(dir), withArgs("bake", "--progress=plain", "--set", "*.output=type=local,dest="+dirDest))
out, err := cmd.CombinedOutput()
require.NoError(t, err, out)
require.Contains(t, string(out), `#1 [internal] load local bake definitions`)
require.Contains(t, string(out), `#1 reading docker-bake.hcl`)

require.FileExists(t, filepath.Join(dirDest, "foo"))
}

func testBakeLocalMulti(t *testing.T, sb integration.Sandbox) {
dockerfile := []byte(`
FROM scratch
COPY foo /foo
`)
bakefile := []byte(`
target "default" {
}
`)
composefile := []byte(`
services:
app:
build: {}
`)

dir := tmpdir(
t,
fstest.CreateFile("docker-bake.hcl", bakefile, 0600),
fstest.CreateFile("compose.yaml", composefile, 0600),
fstest.CreateFile("Dockerfile", dockerfile, 0600),
fstest.CreateFile("foo", []byte("foo"), 0600),
)
dirDest := t.TempDir()

cmd := buildxCmd(sb, withDir(dir), withArgs("bake", "--progress=plain", "--set", "*.output=type=local,dest="+dirDest))
out, err := cmd.CombinedOutput()
require.NoError(t, err, out)
require.Contains(t, string(out), `#1 [internal] load local bake definitions`)
require.Contains(t, string(out), `#1 reading compose.yaml`)
require.Contains(t, string(out), `#1 reading docker-bake.hcl`)

require.FileExists(t, filepath.Join(dirDest, "foo"))
}
Expand Down Expand Up @@ -77,8 +115,11 @@ EOT
gitutil.GitCommit(git, t, "initial commit")
addr := gitutil.GitServeHTTP(git, t)

out, err := bakeCmd(sb, withDir(dir), withArgs(addr, "--set", "*.output=type=local,dest="+dirDest))
cmd := buildxCmd(sb, withDir(dir), withArgs("bake", addr, "--progress=plain", "--set", "*.output=type=local,dest="+dirDest))
out, err := cmd.CombinedOutput()
require.NoError(t, err, out)
require.Contains(t, string(out), `#1 [internal] load remote bake definitions`)

Check failure on line 121 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=docker

=== RUN TestIntegration/TestBakeRemote/worker=docker === PAUSE TestIntegration/TestBakeRemote/worker=docker === CONT TestIntegration/TestBakeRemote/worker=docker bake.go:121: Error Trace: /src/tests/bake.go:121 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "#0 building with \"integration-au7ekouzlvr8qdbkg5krtf4us\" instance using docker driver\n\n#1 [internal] load git source http://127.0.0.1:36003/test.git\n#1 0.045 Initialized empty Git repository in /tmp/integration636585254/dmhsnq8dnkeoq/root/overlay2/7cpff4u15g7pk5i97r2tfi9ta/diff/\n#1 0.137 ref: refs/heads/main\tHEAD\n#1 0.138 9db5892dc68e051a7e425c086fbea1a4e5c04331\tHEAD\n#1 0.183 9db5892dc68e051a7e425c086fbea1a4e5c04331\trefs/heads/main\n#1 0.044 ref: refs/heads/main\tHEAD\n#1 0.045 9db5892dc68e051a7e425c086fbea1a4e5c04331\tHEAD\n#1 0.092 fatal: dumb http transport does not support shallow capabilities\n#1 0.140 From http://127.0.0.1:36003/test\n#1 0.140 * [new branch] main -> main\n#1 0.140 * [new branch] main -> origin/main\n#1 DONE 0.5s\n\n#2 [internal] load build definition from Dockerfile\n#2 transferring dockerfile: 64B done\n#2 DONE 0.0s\n\n#1 [internal] load git source http://127.0.0.1:36003/test.git\n#1 0.048 ref: refs/heads/main\tHEAD\n#1 0.048 9db5892dc68e051a7e425c086fbea1a4e5c04331\tHEAD\n#1 0.088 9db5892dc68e051a7e425c086fbea1a4e5c04331\trefs/heads/main\n#1 CACHED\n\n#3 [1/1] COPY foo /foo\n#3 DONE 0.0s\n\n#4 exporting to client directory\n#4 copying files 29B done\n#4 DONE 0.0s\n" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=docker sandbox.go:128: stdout: /usr/bin/dockerd sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-23 13:32:39.915592643 +0000 UTC m=+6.407871757 /usr/bin/dockerd --data-root /tmp/integration636585254/dmhsnq8dnkeoq/root --exec-root /tmp/dxr/dmhsnq8dnkeoq --pidfile /tmp/integration636585254/dmhsnq8dnkeoq/docker.pid --containerd-namespace dmhsnq8dnkeoq --containerd-plugins-namespace dmhsnq8dnkeoqp --host unix:///tmp/docker-integration/dmhsnq8dnkeoq.sock --config-file /tmp/integration636585254/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-23T13:32:39.946835203Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-23T13:32:39.948517901Z" level=warning msg="could not change group /tmp/docker-integration/dmhsnq8dnkeoq.sock to docker: group docker not found" sandbox.go:131: time="2023-10-23T13:32:39.948652201Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/dmhsnq8dnkeoq.sock)" sandbox.go:131: time="2023-10-23T13:32:39.948670501Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-23T13:32:39.949291700Z" level=info msg="started new containerd process" address=/tmp/dxr/dmhsnq8dnkeoq/containerd/containerd.sock module=libcontainerd pid=4772 sandbox.go:131: time="2023-10-23T13:32:39.965045480Z" level=info msg="starting containerd" revision=7880925980b188f4c97b462f709d0db8e8962aff version=v1.7.3 sandbox.go:131: time="2023-10-23T13:32:39.981331959Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-23T13:32:39.982166558Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: can't change directory to '/lib/modules': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-23T13:32:39.982199758Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-23T13:32:39.982301958Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"...

Check failure on line 121 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker\+containerd, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=docker+containerd

=== RUN TestIntegration/TestBakeRemote/worker=docker+containerd === PAUSE TestIntegration/TestBakeRemote/worker=docker+containerd === CONT TestIntegration/TestBakeRemote/worker=docker+containerd bake.go:121: Error Trace: /src/tests/bake.go:121 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "#0 building with \"integration-lsclg1nctmh90xrlfe68x8ha6\" instance using docker driver\n\n#1 [internal] load git source http://127.0.0.1:35665/test.git\n#1 0.057 Initialized empty Git repository in /tmp/integration1861253043/dsg8k8321tpr8/root/containerd/daemon/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs/\n#1 0.156 ref: refs/heads/main\tHEAD\n#1 0.157 1fe31512f665eaab9f47b57d440028435c5c55c8\tHEAD\n#1 0.206 1fe31512f665eaab9f47b57d440028435c5c55c8\trefs/heads/main\n#1 0.042 ref: refs/heads/main\tHEAD\n#1 0.043 1fe31512f665eaab9f47b57d440028435c5c55c8\tHEAD\n#1 0.090 fatal: dumb http transport does not support shallow capabilities\n#1 0.140 From http://127.0.0.1:35665/test\n#1 0.140 * [new branch] main -> main\n#1 0.140 * [new branch] main -> origin/main\n#1 DONE 0.5s\n\n#2 [internal] load build definition from Dockerfile\n#2 transferring dockerfile: 64B done\n#2 DONE 0.0s\n\n#1 [internal] load git source http://127.0.0.1:35665/test.git\n#1 0.046 ref: refs/heads/main\tHEAD\n#1 0.047 1fe31512f665eaab9f47b57d440028435c5c55c8\tHEAD\n#1 0.089 1fe31512f665eaab9f47b57d440028435c5c55c8\trefs/heads/main\n#1 CACHED\n\n#3 [1/1] COPY foo /foo\n#3 DONE 0.0s\n\n#4 exporting to client directory\n#4 copying files 29B done\n#4 DONE 0.0s\n" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=docker+containerd sandbox.go:128: stdout: /usr/bin/dockerd sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-23 13:32:53.248778117 +0000 UTC m=+7.615310034 /usr/bin/dockerd --data-root /tmp/integration1861253043/dsg8k8321tpr8/root --exec-root /tmp/dxr/dsg8k8321tpr8 --pidfile /tmp/integration1861253043/dsg8k8321tpr8/docker.pid --containerd-namespace dsg8k8321tpr8 --containerd-plugins-namespace dsg8k8321tpr8p --host unix:///tmp/docker-integration/dsg8k8321tpr8.sock --config-file /tmp/integration1861253043/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-23T13:32:53.287433391Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-23T13:32:53.288737400Z" level=warning msg="could not change group /tmp/docker-integration/dsg8k8321tpr8.sock to docker: group docker not found" sandbox.go:131: time="2023-10-23T13:32:53.288933501Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/dsg8k8321tpr8.sock)" sandbox.go:131: time="2023-10-23T13:32:53.288967502Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-23T13:32:53.289710007Z" level=info msg="started new containerd process" address=/tmp/dxr/dsg8k8321tpr8/containerd/containerd.sock module=libcontainerd pid=4755 sandbox.go:131: time="2023-10-23T13:32:53.308204538Z" level=info msg="starting containerd" revision=7880925980b188f4c97b462f709d0db8e8962aff version=v1.7.3 sandbox.go:131: time="2023-10-23T13:32:53.325275959Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-23T13:32:53.326182265Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: can't change directory to '/lib/modules': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-23T13:32:53.326210265Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-23T13:32:53.32635

Check failure on line 121 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker-container, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=docker-container

=== RUN TestIntegration/TestBakeRemote/worker=docker-container === PAUSE TestIntegration/TestBakeRemote/worker=docker-container === CONT TestIntegration/TestBakeRemote/worker=docker-container bake.go:121: Error Trace: /src/tests/bake.go:121 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "#0 building with \"integration-container-153feyz4xxvg9iolumy0fvqhh\" instance using docker-container driver\n\n#1 [internal] load git source http://127.0.0.1:41479/test.git\n#1 0.015 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/\n#1 0.024 ref: refs/heads/main\tHEAD\n#1 0.025 13b98f5d5e0886cf5c90d6b178fd5882782532bf\tHEAD\n#1 0.031 13b98f5d5e0886cf5c90d6b178fd5882782532bf\trefs/heads/main\n#1 0.008 ref: refs/heads/main\tHEAD\n#1 0.009 13b98f5d5e0886cf5c90d6b178fd5882782532bf\tHEAD\n#1 0.015 fatal: dumb http transport does not support shallow capabilities\n#1 0.026 From http://127.0.0.1:41479/test\n#1 0.026 * [new branch] main -> main\n#1 0.027 * [new branch] main -> origin/main\n#1 DONE 0.1s\n\n#2 [internal] load build definition from Dockerfile\n#2 transferring dockerfile: 64B done\n#2 DONE 0.0s\n\n#1 [internal] load git source http://127.0.0.1:41479/test.git\n#1 0.010 ref: refs/heads/main\tHEAD\n#1 0.011 13b98f5d5e0886cf5c90d6b178fd5882782532bf\tHEAD\n#1 0.020 13b98f5d5e0886cf5c90d6b178fd5882782532bf\trefs/heads/main\n#1 CACHED\n\n#3 [1/1] COPY foo /foo\n#3 DONE 0.0s\n\n#4 exporting to client directory\n#4 copying files 29B done\n#4 DONE 0.0s\n" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=docker-container --- FAIL: TestIntegration/TestBakeRemote/worker=docker-container (3.48s)

Check failure on line 121 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (remote, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=remote

=== RUN TestIntegration/TestBakeRemote/worker=remote === PAUSE TestIntegration/TestBakeRemote/worker=remote === CONT TestIntegration/TestBakeRemote/worker=remote bake.go:121: Error Trace: /src/tests/bake.go:121 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "#0 building with \"integration-remote-pcc9qjslvpokd2m2g9e07rwyt\" instance using remote driver\n\n#1 [internal] load git source http://127.0.0.1:45065/test.git\n#1 0.038 Initialized empty Git repository in /tmp/bktest_buildkitd2307016825/runc-overlayfs/snapshots/snapshots/1/fs/\n#1 0.118 ref: refs/heads/main\tHEAD\n#1 0.120 d45f95a740fc46ddb322b077c85553f626ba1151\tHEAD\n#1 0.160 d45f95a740fc46ddb322b077c85553f626ba1151\trefs/heads/main\n#1 0.046 ref: refs/heads/main\tHEAD\n#1 0.047 d45f95a740fc46ddb322b077c85553f626ba1151\tHEAD\n#1 0.088 fatal: dumb http transport does not support shallow capabilities\n#1 0.151 From http://127.0.0.1:45065/test\n#1 0.151 * [new branch] main -> main\n#1 0.152 * [new branch] main -> origin/main\n#1 DONE 0.5s\n\n#2 [internal] load build definition from Dockerfile\n#2 transferring dockerfile: 64B done\n#2 DONE 0.0s\n\n#1 [internal] load git source http://127.0.0.1:45065/test.git\n#1 0.048 ref: refs/heads/main\tHEAD\n#1 0.049 d45f95a740fc46ddb322b077c85553f626ba1151\tHEAD\n#1 0.081 d45f95a740fc46ddb322b077c85553f626ba1151\trefs/heads/main\n#1 CACHED\n\n#3 [1/1] COPY foo /foo\n#3 DONE 0.0s\n\n#4 exporting to client directory\n#4 copying files 29B done\n#4 DONE 0.0s\n" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=remote sandbox.go:128: stdout: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config42139717/buildkitd.toml --root /tmp/bktest_buildkitd2307016825 --addr unix:///tmp/bktest_buildkitd2307016825/buildkitd.sock --debug sandbox.go:128: stderr: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config42139717/buildkitd.toml --root /tmp/bktest_buildkitd2307016825 --addr unix:///tmp/bktest_buildkitd2307016825/buildkitd.sock --debug sandbox.go:131: > StartCmd 2023-10-23 13:34:14.85912794 +0000 UTC m=+21.942417621 /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config42139717/buildkitd.toml --root /tmp/bktest_buildkitd2307016825 --addr unix:///tmp/bktest_buildkitd2307016825/buildkitd.sock --debug sandbox.go:131: time="2023-10-23T13:34:14Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:131: time="2023-10-23T13:34:14Z" level=warning msg="using host network as the default" sandbox.go:131: time="2023-10-23T13:34:14Z" level=info msg="found worker \"x41zhkm5qzbttk5ed05gqr9to\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:6315ff0affb1 org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:131: time="2023-10-23T13:34:15Z" level=info msg="found 1 workers, default=\"x41zhkm5qzbttk5ed05gqr9to\"" sandbox.go:131: time="2023-10-23T13:34:15Z" level=warning msg="currently, only the default worker can be used." sandbox.go:131: time="2023-10-23T13:34:15Z" level=info msg="running server on /tmp/bktest_buildkitd2307016825/buildkitd.sock
require.Contains(t, string(out), `#1 reading docker-bake.hcl`)

require.FileExists(t, filepath.Join(dirDest, "foo"))
}
Expand Down
2 changes: 1 addition & 1 deletion util/cobrautil/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Disable(cmd *cobra.Command, args []string, toComplete string) ([]string, co

func BakeTargets(files []string) ValidArgsFn {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
f, err := bake.ReadLocalFiles(files, nil)
f, err := bake.ReadLocalFiles(files, nil, nil)
if err != nil {
return nil, cobra.ShellCompDirectiveError
}
Expand Down

0 comments on commit df69bb0

Please sign in to comment.