From 7757b017ed599eb81f1828714c4a002374100184 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Wed, 13 Apr 2022 20:49:17 -0700 Subject: [PATCH 01/21] vendor: update fsutil to 3c5c7e8 Signed-off-by: Tonis Tiigi (cherry picked from commit 60addc4023da1217be19fd3ce6b64207d69465d8) Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 ++-- .../github.com/tonistiigi/fsutil/Dockerfile | 21 ++++++++++--------- .../tonistiigi/fsutil/chtimes_linux.go | 1 + .../github.com/tonistiigi/fsutil/copy/copy.go | 7 +++---- .../tonistiigi/fsutil/copy/copy_darwin.go | 5 +++++ .../tonistiigi/fsutil/copy/copy_freebsd.go | 6 ++++++ .../tonistiigi/fsutil/copy/copy_linux.go | 8 ++----- .../tonistiigi/fsutil/copy/copy_nowindows.go | 18 ++++++++++++++++ .../tonistiigi/fsutil/copy/device_darwin.go | 20 ------------------ .../tonistiigi/fsutil/copy/device_freebsd.go | 20 ------------------ .../tonistiigi/fsutil/copy/hardlink_unix.go | 1 + .../tonistiigi/fsutil/copy/mkdir_unix.go | 1 + .../tonistiigi/fsutil/copy/stat_sysv.go | 1 + .../tonistiigi/fsutil/diskwriter.go | 4 ---- .../tonistiigi/fsutil/diskwriter_freebsd.go | 7 +++++-- .../tonistiigi/fsutil/diskwriter_unix.go | 1 + .../tonistiigi/fsutil/diskwriter_unixnobsd.go | 10 ++++++--- .../tonistiigi/fsutil/docker-bake.hcl | 4 ++-- .../github.com/tonistiigi/fsutil/stat_unix.go | 1 + vendor/github.com/tonistiigi/fsutil/walker.go | 20 +++++++++++------- vendor/modules.txt | 2 +- 22 files changed, 82 insertions(+), 82 deletions(-) delete mode 100644 vendor/github.com/tonistiigi/fsutil/copy/device_darwin.go delete mode 100644 vendor/github.com/tonistiigi/fsutil/copy/device_freebsd.go diff --git a/go.mod b/go.mod index 49f906711fb2..6356c368f45c 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 - github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274 + github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994 github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 github.com/tonistiigi/go-archvariant v1.0.0 github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea diff --git a/go.sum b/go.sum index 52e9a755abc7..375197e74531 100644 --- a/go.sum +++ b/go.sum @@ -1241,8 +1241,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= -github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274 h1:wbyZxD6IPFp0sl5uscMOJRsz5UKGFiNiD16e+MVfKZY= -github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= +github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994 h1:kui3WK5NgTQUD0NdxsCohHLXaN43AzLBI0BES0uoaYQ= +github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc= github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0= diff --git a/vendor/github.com/tonistiigi/fsutil/Dockerfile b/vendor/github.com/tonistiigi/fsutil/Dockerfile index 8ea4b426e567..d4d5bf91f585 100644 --- a/vendor/github.com/tonistiigi/fsutil/Dockerfile +++ b/vendor/github.com/tonistiigi/fsutil/Dockerfile @@ -1,29 +1,30 @@ -#syntax=docker/dockerfile:1.2 -ARG GO_VERSION=1.16 +#syntax=docker/dockerfile:1.4 +ARG GO_VERSION=1.18 -FROM --platform=amd64 tonistiigi/xx:golang AS goxx +FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.1.0 AS xx FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base -RUN apk add --no-cache gcc musl-dev -COPY --from=goxx / / +RUN apk add --no-cache git +COPY --from=xx / / WORKDIR /src FROM base AS build ARG TARGETPLATFORM -RUN --mount=target=. \ +RUN --mount=target=. --mount=target=/go/pkg/mod,type=cache \ --mount=target=/root/.cache,type=cache \ - go build ./... + xx-go build ./... FROM base AS test -RUN --mount=target=. \ +ARG TESTFLAGS +RUN --mount=target=. --mount=target=/go/pkg/mod,type=cache \ --mount=target=/root/.cache,type=cache \ - go test -test.v ./... + CGO_ENABLED=0 xx-go test -test.v ${TESTFLAGS} ./... FROM base AS test-noroot RUN mkdir /go/pkg && chmod 0777 /go/pkg USER 1000:1000 RUN --mount=target=. \ --mount=target=/tmp/.cache,type=cache \ - GOCACHE=/tmp/gocache go test -test.v ./... + CGO_ENABLED=0 GOCACHE=/tmp/gocache xx-go test -test.v ./... FROM build diff --git a/vendor/github.com/tonistiigi/fsutil/chtimes_linux.go b/vendor/github.com/tonistiigi/fsutil/chtimes_linux.go index 74f08a15caa7..dd65a49ad106 100644 --- a/vendor/github.com/tonistiigi/fsutil/chtimes_linux.go +++ b/vendor/github.com/tonistiigi/fsutil/chtimes_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package fsutil diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy.go b/vendor/github.com/tonistiigi/fsutil/copy/copy.go index 41b82c32daa4..65b79724058d 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/copy.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy.go @@ -369,13 +369,12 @@ func (c *copier) copy(ctx context.Context, src, srcComponents, target string, ov if err := os.Symlink(link, target); err != nil { return errors.Wrapf(err, "failed to create symlink: %s", target) } - case (fi.Mode() & os.ModeDevice) == os.ModeDevice: + case (fi.Mode() & os.ModeDevice) == os.ModeDevice, + (fi.Mode() & os.ModeNamedPipe) == os.ModeNamedPipe, + (fi.Mode() & os.ModeSocket) == os.ModeSocket: if err := copyDevice(target, fi); err != nil { return errors.Wrapf(err, "failed to create device") } - default: - // TODO: Support pipes and sockets - return errors.Wrapf(err, "unsupported mode %s", fi.Mode()) } if copyFileInfo { diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy_darwin.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_darwin.go index 0d8149693a17..bc93b21cedaf 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/copy_darwin.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_darwin.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package fs @@ -40,3 +41,7 @@ func copyFileContent(dst, src *os.File) error { return err } + +func mknod(dst string, mode uint32, rDev int) error { + return unix.Mknod(dst, uint32(mode), rDev) +} diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy_freebsd.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_freebsd.go index 297a2c0335f0..1b9dbb3d00ee 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/copy_freebsd.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_freebsd.go @@ -1,3 +1,4 @@ +//go:build freebsd // +build freebsd package fs @@ -7,6 +8,7 @@ import ( "os" "github.com/pkg/errors" + "golang.org/x/sys/unix" ) func copyFile(source, target string) error { @@ -30,3 +32,7 @@ func copyFileContent(dst, src *os.File) error { bufferPool.Put(buf) return err } + +func mknod(dst string, mode uint32, rDev int) error { + return unix.Mknod(dst, uint32(mode), uint64(rDev)) +} diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy_linux.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_linux.go index 01878525cf79..2ac813eea994 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/copy_linux.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_linux.go @@ -109,10 +109,6 @@ func copyFileContent(dst, src *os.File) error { return nil } -func copyDevice(dst string, fi os.FileInfo) error { - st, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return errors.New("unsupported stat type") - } - return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev)) +func mknod(dst string, mode uint32, rDev int) error { + return unix.Mknod(dst, uint32(mode), rDev) } diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy_nowindows.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_nowindows.go index cbd784e5f570..382fe201c1ae 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/copy_nowindows.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_nowindows.go @@ -1,8 +1,12 @@ +//go:build !windows // +build !windows package fs import ( + "os" + "syscall" + "github.com/pkg/errors" "github.com/containerd/continuity/sysx" @@ -26,3 +30,17 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { return nil } + +func copyDevice(dst string, fi os.FileInfo) error { + st, ok := fi.Sys().(*syscall.Stat_t) + if !ok { + return errors.New("unsupported stat type") + } + var rDev int + if fi.Mode()&os.ModeDevice == os.ModeDevice || fi.Mode()&os.ModeCharDevice == os.ModeCharDevice { + rDev = int(st.Rdev) + } + mode := st.Mode + mode &^= syscall.S_IFSOCK // socket copied as stub + return mknod(dst, uint32(mode), rDev) +} diff --git a/vendor/github.com/tonistiigi/fsutil/copy/device_darwin.go b/vendor/github.com/tonistiigi/fsutil/copy/device_darwin.go deleted file mode 100644 index 8a06d242a489..000000000000 --- a/vendor/github.com/tonistiigi/fsutil/copy/device_darwin.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build darwin -// +build darwin - -package fs - -import ( - "os" - "syscall" - - "github.com/pkg/errors" - "golang.org/x/sys/unix" -) - -func copyDevice(dst string, fi os.FileInfo) error { - st, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return errors.New("unsupported stat type") - } - return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev)) -} diff --git a/vendor/github.com/tonistiigi/fsutil/copy/device_freebsd.go b/vendor/github.com/tonistiigi/fsutil/copy/device_freebsd.go deleted file mode 100644 index 64a2fe4da35f..000000000000 --- a/vendor/github.com/tonistiigi/fsutil/copy/device_freebsd.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build freebsd || solaris -// +build freebsd solaris - -package fs - -import ( - "os" - "syscall" - - "github.com/pkg/errors" - "golang.org/x/sys/unix" -) - -func copyDevice(dst string, fi os.FileInfo) error { - st, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return errors.New("unsupported stat type") - } - return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev) -} diff --git a/vendor/github.com/tonistiigi/fsutil/copy/hardlink_unix.go b/vendor/github.com/tonistiigi/fsutil/copy/hardlink_unix.go index 3b825c940bf7..a02c5a5857f0 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/hardlink_unix.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/hardlink_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package fs diff --git a/vendor/github.com/tonistiigi/fsutil/copy/mkdir_unix.go b/vendor/github.com/tonistiigi/fsutil/copy/mkdir_unix.go index 8fb0f6bc604b..f6d196b784d3 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/mkdir_unix.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/mkdir_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package fs diff --git a/vendor/github.com/tonistiigi/fsutil/copy/stat_sysv.go b/vendor/github.com/tonistiigi/fsutil/copy/stat_sysv.go index 59accf054d31..31ea3d9419a3 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/stat_sysv.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/stat_sysv.go @@ -1,3 +1,4 @@ +//go:build dragonfly || linux || solaris // +build dragonfly linux solaris package fs diff --git a/vendor/github.com/tonistiigi/fsutil/diskwriter.go b/vendor/github.com/tonistiigi/fsutil/diskwriter.go index 786432264f0f..8f2574b5078d 100644 --- a/vendor/github.com/tonistiigi/fsutil/diskwriter.go +++ b/vendor/github.com/tonistiigi/fsutil/diskwriter.go @@ -323,10 +323,6 @@ func (lfw *lazyFileWriter) Close() error { return err } -func mkdev(major int64, minor int64) uint32 { - return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) -} - // Random number state. // We generate random temporary file names so that there's a good // chance the file doesn't exist yet - keeps the number of tries in diff --git a/vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go b/vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go index 6ca00618a16d..ed6356fabeab 100644 --- a/vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go +++ b/vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go @@ -1,3 +1,4 @@ +//go:build freebsd // +build freebsd package fsutil @@ -8,7 +9,9 @@ import ( ) func createSpecialFile(path string, mode uint32, stat *types.Stat) error { - dev := unix.Mkdev(uint32(stat.Devmajor), uint32(stat.Devminor)) + return unix.Mknod(path, mode, mkdev(stat.Devmajor, stat.Devminor)) +} - return unix.Mknod(path, mode, dev) +func mkdev(major int64, minor int64) uint64 { + return unix.Mkdev(uint32(major), uint32(minor)) } diff --git a/vendor/github.com/tonistiigi/fsutil/diskwriter_unix.go b/vendor/github.com/tonistiigi/fsutil/diskwriter_unix.go index 36bb78895cfd..1d97d6f9d7ca 100644 --- a/vendor/github.com/tonistiigi/fsutil/diskwriter_unix.go +++ b/vendor/github.com/tonistiigi/fsutil/diskwriter_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package fsutil diff --git a/vendor/github.com/tonistiigi/fsutil/diskwriter_unixnobsd.go b/vendor/github.com/tonistiigi/fsutil/diskwriter_unixnobsd.go index 9f55ad88322a..927dba460236 100644 --- a/vendor/github.com/tonistiigi/fsutil/diskwriter_unixnobsd.go +++ b/vendor/github.com/tonistiigi/fsutil/diskwriter_unixnobsd.go @@ -1,13 +1,17 @@ +//go:build !windows && !freebsd // +build !windows,!freebsd package fsutil import ( - "syscall" - "github.com/tonistiigi/fsutil/types" + "golang.org/x/sys/unix" ) func createSpecialFile(path string, mode uint32, stat *types.Stat) error { - return syscall.Mknod(path, mode, int(mkdev(stat.Devmajor, stat.Devminor))) + return unix.Mknod(path, mode, mkdev(stat.Devmajor, stat.Devminor)) +} + +func mkdev(major int64, minor int64) int { + return int(unix.Mkdev(uint32(major), uint32(minor))) } diff --git a/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl b/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl index 0d3c54172fc2..3d7d182c3cc4 100644 --- a/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl +++ b/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl @@ -1,5 +1,5 @@ variable "GO_VERSION" { - default = "1.16" + default = "1.18" } group "default" { @@ -63,5 +63,5 @@ target "shfmt" { target "cross" { inherits = ["build"] - platforms = ["linux/amd64", "linux/386", "linux/arm64", "linux/arm", "linux/ppc64le", "linux/s390x", "darwin/amd64", "darwin/arm64", "windows/amd64", "freebsd/amd64", "freebsd/arm64"] + platforms = ["linux/amd64", "linux/386", "linux/arm64", "linux/arm", "linux/ppc64le", "linux/s390x", "darwin/amd64", "darwin/arm64", "windows/amd64", "windows/arm64", "freebsd/amd64", "freebsd/arm64"] } diff --git a/vendor/github.com/tonistiigi/fsutil/stat_unix.go b/vendor/github.com/tonistiigi/fsutil/stat_unix.go index dd0ed455166f..5923aefef165 100644 --- a/vendor/github.com/tonistiigi/fsutil/stat_unix.go +++ b/vendor/github.com/tonistiigi/fsutil/stat_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package fsutil diff --git a/vendor/github.com/tonistiigi/fsutil/walker.go b/vendor/github.com/tonistiigi/fsutil/walker.go index d0b5114b4038..83045bec850f 100644 --- a/vendor/github.com/tonistiigi/fsutil/walker.go +++ b/vendor/github.com/tonistiigi/fsutil/walker.go @@ -123,7 +123,13 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return nil } - var dir visitedDir + var ( + dir visitedDir + isDir bool + ) + if fi != nil { + isDir = fi.IsDir() + } if includeMatcher != nil || excludeMatcher != nil { for len(parentDirs) != 0 { @@ -134,7 +140,7 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err parentDirs = parentDirs[:len(parentDirs)-1] } - if fi.IsDir() { + if isDir { dir = visitedDir{ fi: fi, path: path, @@ -156,12 +162,12 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return errors.Wrap(err, "failed to match includepatterns") } - if fi.IsDir() { + if isDir { dir.includeMatchInfo = matchInfo } if !m { - if fi.IsDir() && onlyPrefixIncludes { + if isDir && onlyPrefixIncludes { // Optimization: we can skip walking this dir if no include // patterns could match anything inside it. dirSlash := path + string(filepath.Separator) @@ -191,12 +197,12 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return errors.Wrap(err, "failed to match excludepatterns") } - if fi.IsDir() { + if isDir { dir.excludeMatchInfo = matchInfo } if m { - if fi.IsDir() && onlyPrefixExcludeExceptions { + if isDir && onlyPrefixExcludeExceptions { // Optimization: we can skip walking this dir if no // exceptions to exclude patterns could match anything // inside it. @@ -230,7 +236,7 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err if includeMatcher != nil || excludeMatcher != nil { defer func() { - if fi.IsDir() { + if isDir { parentDirs = append(parentDirs, dir) } }() diff --git a/vendor/modules.txt b/vendor/modules.txt index 3bfb8330e07e..1edef8a0e900 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -449,7 +449,7 @@ github.com/sirupsen/logrus ## explicit; go 1.13 github.com/stretchr/testify/assert github.com/stretchr/testify/require -# github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274 +# github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994 ## explicit; go 1.13 github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/copy From 9a75f58595943849a86667bdd2daffeef75e543e Mon Sep 17 00:00:00 2001 From: Nick Santos Date: Tue, 10 May 2022 12:36:39 -0400 Subject: [PATCH 02/21] vendor: upgrade github.com/tonistiigi/fsutil fixes https://github.com/moby/buildkit/issues/2837 Signed-off-by: Nick Santos (cherry picked from commit 844618f5060a45853df77ec2081d8b8fc2c52ede) Signed-off-by: Sebastiaan van Stijn --- client/solve.go | 5 ++-- exporter/local/export.go | 6 ++-- exporter/tar/export.go | 6 ++-- go.mod | 2 +- go.sum | 4 +-- session/filesync/filesync.go | 2 +- vendor/github.com/tonistiigi/fsutil/walker.go | 30 +++++++++++++++++-- vendor/modules.txt | 2 +- 8 files changed, 41 insertions(+), 16 deletions(-) diff --git a/client/solve.go b/client/solve.go index f14d9c410d79..e58905044c7b 100644 --- a/client/solve.go +++ b/client/solve.go @@ -24,6 +24,7 @@ import ( "github.com/moby/buildkit/util/entitlements" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" + "github.com/tonistiigi/fsutil" fstypes "github.com/tonistiigi/fsutil/types" "go.opentelemetry.io/otel/trace" "golang.org/x/sync/errgroup" @@ -342,10 +343,10 @@ func prepareSyncedDirs(def *llb.Definition, localDirs map[string]string) ([]file return nil, errors.Errorf("%s not a directory", d) } } - resetUIDAndGID := func(p string, st *fstypes.Stat) bool { + resetUIDAndGID := func(p string, st *fstypes.Stat) fsutil.MapResult { st.Uid = 0 st.Gid = 0 - return true + return fsutil.MapResultKeep } dirs := make([]filesync.SyncedDir, 0, len(localDirs)) diff --git a/exporter/local/export.go b/exporter/local/export.go index 5daa4aa4268c..b9169ac5b20c 100644 --- a/exporter/local/export.go +++ b/exporter/local/export.go @@ -93,17 +93,17 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source, walkOpt := &fsutil.WalkOpt{} if idmap != nil { - walkOpt.Map = func(p string, st *fstypes.Stat) bool { + walkOpt.Map = func(p string, st *fstypes.Stat) fsutil.MapResult { uid, gid, err := idmap.ToContainer(idtools.Identity{ UID: int(st.Uid), GID: int(st.Gid), }) if err != nil { - return false + return fsutil.MapResultExclude } st.Uid = uint32(uid) st.Gid = uint32(gid) - return true + return fsutil.MapResultKeep } } diff --git a/exporter/tar/export.go b/exporter/tar/export.go index 0febefd0b023..13540b947de7 100644 --- a/exporter/tar/export.go +++ b/exporter/tar/export.go @@ -109,17 +109,17 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source, walkOpt := &fsutil.WalkOpt{} if idmap != nil { - walkOpt.Map = func(p string, st *fstypes.Stat) bool { + walkOpt.Map = func(p string, st *fstypes.Stat) fsutil.MapResult { uid, gid, err := idmap.ToContainer(idtools.Identity{ UID: int(st.Uid), GID: int(st.Gid), }) if err != nil { - return false + return fsutil.MapResultExclude } st.Uid = uint32(uid) st.Gid = uint32(gid) - return true + return fsutil.MapResultKeep } } diff --git a/go.mod b/go.mod index 6356c368f45c..8441530d5f3e 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 - github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994 + github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58 github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 github.com/tonistiigi/go-archvariant v1.0.0 github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea diff --git a/go.sum b/go.sum index 375197e74531..2758499d4da5 100644 --- a/go.sum +++ b/go.sum @@ -1241,8 +1241,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= -github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994 h1:kui3WK5NgTQUD0NdxsCohHLXaN43AzLBI0BES0uoaYQ= -github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= +github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58 h1:rNya5ozLqz0lK46XhmsmqJuxmQLM8dAWabiT+5gZqLY= +github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc= github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0= diff --git a/session/filesync/filesync.go b/session/filesync/filesync.go index ae3f29f86c3d..be8cf9b8b62c 100644 --- a/session/filesync/filesync.go +++ b/session/filesync/filesync.go @@ -36,7 +36,7 @@ type SyncedDir struct { Name string Dir string Excludes []string - Map func(string, *fstypes.Stat) bool + Map func(string, *fstypes.Stat) fsutil.MapResult } // NewFSSyncProvider creates a new provider for sending files from client diff --git a/vendor/github.com/tonistiigi/fsutil/walker.go b/vendor/github.com/tonistiigi/fsutil/walker.go index 83045bec850f..c206b1a6aea8 100644 --- a/vendor/github.com/tonistiigi/fsutil/walker.go +++ b/vendor/github.com/tonistiigi/fsutil/walker.go @@ -19,9 +19,29 @@ type WalkOpt struct { // FollowPaths contains symlinks that are resolved into include patterns // before performing the fs walk FollowPaths []string - Map FilterFunc + Map MapFunc } +type MapFunc func(string, *types.Stat) MapResult + +// The result of the walk function controls +// both how WalkDir continues and whether the path is kept. +type MapResult int + +const ( + // Keep the current path and continue. + MapResultKeep MapResult = iota + + // Exclude the current path and continue. + MapResultExclude + + // Exclude the current path, and skip the rest of the dir. + // If path is a dir, skip the current directory. + // If path is a file, skip the rest of the parent directory. + // (This matches the semantics of fs.SkipDir.) + MapResultSkipDir +) + func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) error { root, err := filepath.EvalSymlinks(p) if err != nil { @@ -258,7 +278,10 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return ctx.Err() default: if opt != nil && opt.Map != nil { - if allowed := opt.Map(stat.Path, stat); !allowed { + result := opt.Map(stat.Path, stat) + if result == MapResultSkipDir { + return filepath.SkipDir + } else if result == MapResultExclude { return nil } } @@ -277,7 +300,8 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err default: } if opt != nil && opt.Map != nil { - if allowed := opt.Map(parentStat.Path, parentStat); !allowed { + result := opt.Map(parentStat.Path, parentStat) + if result == MapResultSkipDir || result == MapResultExclude { continue } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 1edef8a0e900..172374d334fb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -449,7 +449,7 @@ github.com/sirupsen/logrus ## explicit; go 1.13 github.com/stretchr/testify/assert github.com/stretchr/testify/require -# github.com/tonistiigi/fsutil v0.0.0-20220413024721-3c5c7e848994 +# github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58 ## explicit; go 1.13 github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/copy From d8640b9bdbf475eecfa7c9d1c757e6bb459b5be2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 10 Mar 2022 00:57:07 +0100 Subject: [PATCH 03/21] Remove uses of deprecated io/ioutil Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 21e9e9641ef16772d1ffd9a81b705a3345ece241) Signed-off-by: Sebastiaan van Stijn --- cache/contenthash/checksum_test.go | 37 +- cache/manager_test.go | 75 ++-- cache/metadata/metadata_test.go | 7 +- cache/refs.go | 3 +- cache/util/fsutil.go | 5 +- client/build_test.go | 11 +- client/client.go | 4 +- client/client_test.go | 239 +++++++------ client/llb/marshal.go | 3 +- client/ociindex/ociindex.go | 6 +- cmd/buildctl/build_test.go | 11 +- cmd/buildctl/buildctl_test.go | 3 +- cmd/buildctl/debug/dumpmetadata.go | 3 +- cmd/buildkitd/main.go | 3 +- examples/dockerfile2llb/main.go | 4 +- examples/kubernetes/consistenthash/main.go | 4 +- executor/containerdexecutor/executor.go | 5 +- executor/oci/hosts.go | 3 +- executor/oci/resolvconf.go | 3 +- executor/oci/resolvconf_test.go | 5 +- exporter/local/export.go | 3 +- exporter/tar/export.go | 3 +- .../dockerfile/dockerfile_buildinfo_test.go | 11 +- .../dockerfile/dockerfile_heredoc_test.go | 49 ++- frontend/dockerfile/dockerfile_mount_test.go | 13 +- frontend/dockerfile/dockerfile_ssh_test.go | 5 +- frontend/dockerfile/dockerfile_test.go | 331 +++++++++--------- .../dockerignore/dockerignore_test.go | 5 +- frontend/dockerfile/parser/parser_test.go | 3 +- frontend/frontend_test.go | 5 +- session/auth/authprovider/tokenseed.go | 5 +- session/content/content_test.go | 3 +- session/filesync/filesync_test.go | 14 +- session/secrets/secretsprovider/store.go | 3 +- session/sshforward/ssh.go | 3 +- .../sshforward/sshprovider/agentprovider.go | 3 +- snapshot/localmounter_unix.go | 3 +- snapshot/snapshotter_test.go | 3 +- solver/bboltcachestorage/storage_test.go | 3 +- solver/jobs_test.go | 3 +- solver/llbsolver/file/backend.go | 3 +- solver/llbsolver/mounts/mount.go | 5 +- solver/llbsolver/mounts/mount_test.go | 11 +- solver/llbsolver/ops/exec_binfmt.go | 3 +- source/git/gitsource.go | 5 +- source/git/gitsource_test.go | 47 ++- source/http/httpsource_test.go | 11 +- util/archutil/check_unix.go | 3 +- util/contentutil/buffer.go | 4 +- util/imageutil/schema1.go | 4 +- util/overlay/overlay_linux.go | 3 +- util/overlay/overlay_linux_test.go | 9 +- util/resolver/resolver.go | 5 +- util/testutil/integration/containerd.go | 5 +- util/testutil/integration/dockerd.go | 5 +- util/testutil/integration/frombinary.go | 3 +- util/testutil/integration/registry.go | 7 +- util/testutil/integration/run.go | 7 +- util/testutil/integration/sandbox.go | 3 +- util/testutil/tar.go | 3 +- util/winlayers/applier.go | 5 +- worker/base/worker.go | 5 +- worker/base/worker_test.go | 3 +- worker/containerd/containerd_test.go | 3 +- worker/runc/runc_test.go | 7 +- worker/tests/common.go | 3 +- 66 files changed, 509 insertions(+), 568 deletions(-) diff --git a/cache/contenthash/checksum_test.go b/cache/contenthash/checksum_test.go index 713c7a560913..0055298bad67 100644 --- a/cache/contenthash/checksum_test.go +++ b/cache/contenthash/checksum_test.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "path/filepath" "runtime" @@ -43,7 +42,7 @@ const ( func TestChecksumSymlinkNoParentScan(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -72,7 +71,7 @@ func TestChecksumSymlinkNoParentScan(t *testing.T) { func TestChecksumHardlinks(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -155,7 +154,7 @@ func TestChecksumHardlinks(t *testing.T) { func TestChecksumWildcardOrFilter(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -212,7 +211,7 @@ func TestChecksumWildcardOrFilter(t *testing.T) { func TestChecksumWildcardWithBadMountable(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -232,7 +231,7 @@ func TestChecksumWildcardWithBadMountable(t *testing.T) { func TestSymlinksNoFollow(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -291,7 +290,7 @@ func TestSymlinksNoFollow(t *testing.T) { func TestChecksumBasicFile(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -449,7 +448,7 @@ func TestChecksumIncludeExclude(t *testing.T) { func testChecksumIncludeExclude(t *testing.T, wildcard bool) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -584,7 +583,7 @@ func testChecksumIncludeExclude(t *testing.T, wildcard bool) { func TestChecksumIncludeDoubleStar(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -652,7 +651,7 @@ func TestChecksumIncludeDoubleStar(t *testing.T) { func TestChecksumIncludeSymlink(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -725,7 +724,7 @@ func TestChecksumIncludeSymlink(t *testing.T) { func TestHandleChange(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -803,7 +802,7 @@ func TestHandleChange(t *testing.T) { func TestHandleRecursiveDir(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -852,7 +851,7 @@ func TestHandleRecursiveDir(t *testing.T) { func TestChecksumUnorderedFiles(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -905,7 +904,7 @@ func TestChecksumUnorderedFiles(t *testing.T) { func TestSymlinkInPathScan(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -936,7 +935,7 @@ func TestSymlinkInPathScan(t *testing.T) { func TestSymlinkNeedsScan(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -969,7 +968,7 @@ func TestSymlinkNeedsScan(t *testing.T) { func TestSymlinkAbsDirSuffix(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -996,7 +995,7 @@ func TestSymlinkAbsDirSuffix(t *testing.T) { func TestSymlinkThroughParent(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1051,7 +1050,7 @@ func TestSymlinkThroughParent(t *testing.T) { func TestSymlinkInPathHandleChange(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1114,7 +1113,7 @@ func TestSymlinkInPathHandleChange(t *testing.T) { func TestPersistence(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) diff --git a/cache/manager_test.go b/cache/manager_test.go index 6dff7c177b78..ecd26de32120 100644 --- a/cache/manager_test.go +++ b/cache/manager_test.go @@ -8,7 +8,6 @@ import ( "encoding/binary" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -75,7 +74,7 @@ func newCacheManager(ctx context.Context, opt cmOpt) (co *cmOut, cleanup func() opt.snapshotterName = "native" } - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") if err != nil { return nil, nil, err } @@ -167,14 +166,14 @@ func TestSharableMountPoolCleanup(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) // Emulate the situation where the pool dir is dirty mountPoolDir := filepath.Join(tmpdir, "cachemounts") require.NoError(t, os.MkdirAll(mountPoolDir, 0700)) - _, err = ioutil.TempDir(mountPoolDir, "buildkit") + _, err = os.MkdirTemp(mountPoolDir, "buildkit") require.NoError(t, err) // Initialize cache manager and check if pool is cleaned up @@ -194,7 +193,7 @@ func TestManager(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -317,7 +316,7 @@ func TestManager(t *testing.T) { err = cm.Close() require.NoError(t, err) - dirs, err := ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err := os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 0, len(dirs)) } @@ -326,7 +325,7 @@ func TestLazyGetByBlob(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -371,7 +370,7 @@ func TestMergeBlobchainID(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -444,7 +443,7 @@ func TestSnapshotExtract(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -487,7 +486,7 @@ func TestSnapshotExtract(t *testing.T) { require.Equal(t, false, !snap2.(*immutableRef).getBlobOnly()) - dirs, err := ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err := os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 0, len(dirs)) @@ -499,7 +498,7 @@ func TestSnapshotExtract(t *testing.T) { require.Equal(t, true, !snap.(*immutableRef).getBlobOnly()) require.Equal(t, true, !snap2.(*immutableRef).getBlobOnly()) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 2, len(dirs)) @@ -512,7 +511,7 @@ func TestSnapshotExtract(t *testing.T) { require.Equal(t, len(buf.all), 0) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 2, len(dirs)) @@ -530,7 +529,7 @@ func TestSnapshotExtract(t *testing.T) { checkDiskUsage(ctx, t, cm, 2, 0) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 2, len(dirs)) @@ -553,7 +552,7 @@ func TestSnapshotExtract(t *testing.T) { require.Equal(t, len(buf.all), 1) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 1, len(dirs)) @@ -569,7 +568,7 @@ func TestSnapshotExtract(t *testing.T) { checkDiskUsage(ctx, t, cm, 0, 0) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 0, len(dirs)) @@ -584,7 +583,7 @@ func TestExtractOnMutable(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -643,7 +642,7 @@ func TestExtractOnMutable(t *testing.T) { require.NoError(t, err) require.Equal(t, int64(len(b2)), size) - dirs, err := ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err := os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 1, len(dirs)) @@ -664,7 +663,7 @@ func TestExtractOnMutable(t *testing.T) { require.Equal(t, len(buf.all), 0) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 2, len(dirs)) @@ -682,7 +681,7 @@ func TestExtractOnMutable(t *testing.T) { require.Equal(t, len(buf.all), 2) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 0, len(dirs)) @@ -693,7 +692,7 @@ func TestSetBlob(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -866,7 +865,7 @@ func TestPrune(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -896,7 +895,7 @@ func TestPrune(t *testing.T) { checkDiskUsage(ctx, t, cm, 2, 0) - dirs, err := ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err := os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 2, len(dirs)) @@ -909,7 +908,7 @@ func TestPrune(t *testing.T) { checkDiskUsage(ctx, t, cm, 2, 0) require.Equal(t, len(buf.all), 0) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 2, len(dirs)) @@ -927,7 +926,7 @@ func TestPrune(t *testing.T) { checkDiskUsage(ctx, t, cm, 1, 0) require.Equal(t, len(buf.all), 1) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 1, len(dirs)) @@ -967,7 +966,7 @@ func TestPrune(t *testing.T) { checkDiskUsage(ctx, t, cm, 0, 0) require.Equal(t, len(buf.all), 2) - dirs, err = ioutil.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) + dirs, err = os.ReadDir(filepath.Join(tmpdir, "snapshots/snapshots")) require.NoError(t, err) require.Equal(t, 0, len(dirs)) } @@ -977,7 +976,7 @@ func TestLazyCommit(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1135,7 +1134,7 @@ func TestLoopLeaseContent(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1252,7 +1251,7 @@ func TestSharingCompressionVariant(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1520,7 +1519,7 @@ func TestConversion(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1617,7 +1616,7 @@ func TestGetRemotes(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1917,7 +1916,7 @@ func TestNondistributableBlobs(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -2048,7 +2047,7 @@ func TestMergeOp(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -2168,7 +2167,7 @@ func TestDiffOp(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -2272,7 +2271,7 @@ func TestLoadHalfFinalizedRef(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -2352,7 +2351,7 @@ func TestMountReadOnly(t *testing.T) { ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -2658,7 +2657,7 @@ func fileToBlob(file *os.File, compress bool) ([]byte, ocispecs.Descriptor, erro } func mapToSystemTarBlob(m map[string]string) ([]byte, ocispecs.Descriptor, error) { - tmpdir, err := ioutil.TempDir("", "tarcreation") + tmpdir, err := os.MkdirTemp("", "tarcreation") if err != nil { return nil, ocispecs.Descriptor{}, err } @@ -2667,7 +2666,7 @@ func mapToSystemTarBlob(m map[string]string) ([]byte, ocispecs.Descriptor, error expected := map[string]string{} for k, v := range m { expected[k] = v - if err := ioutil.WriteFile(filepath.Join(tmpdir, k), []byte(v), 0600); err != nil { + if err := os.WriteFile(filepath.Join(tmpdir, k), []byte(v), 0600); err != nil { return nil, ocispecs.Descriptor{}, err } } @@ -2696,7 +2695,7 @@ func mapToSystemTarBlob(m map[string]string) ([]byte, ocispecs.Descriptor, error return nil, ocispecs.Descriptor{}, errors.Errorf("unexpected file %s", h.Name) } delete(expected, k) - gotV, err := ioutil.ReadAll(tr) + gotV, err := io.ReadAll(tr) if err != nil { return nil, ocispecs.Descriptor{}, err } diff --git a/cache/metadata/metadata_test.go b/cache/metadata/metadata_test.go index 7e3d5b055df6..aa129cb2e2d2 100644 --- a/cache/metadata/metadata_test.go +++ b/cache/metadata/metadata_test.go @@ -1,7 +1,6 @@ package metadata import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -13,7 +12,7 @@ import ( func TestGetSetSearch(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-storage") + tmpdir, err := os.MkdirTemp("", "buildkit-storage") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -112,7 +111,7 @@ func TestGetSetSearch(t *testing.T) { func TestIndexes(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-storage") + tmpdir, err := os.MkdirTemp("", "buildkit-storage") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -172,7 +171,7 @@ func TestIndexes(t *testing.T) { func TestExternalData(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "buildkit-storage") + tmpdir, err := os.MkdirTemp("", "buildkit-storage") require.NoError(t, err) defer os.RemoveAll(tmpdir) diff --git a/cache/refs.go b/cache/refs.go index 0eee8fd47a06..013a2804d96a 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -3,7 +3,6 @@ package cache import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -1631,7 +1630,7 @@ func (sm *sharableMountable) Mount() (_ []mount.Mount, _ func() error, retErr er // Don't need temporary mount wrapper for non-overlayfs mounts return mounts, release, nil } - dir, err := ioutil.TempDir(sm.mountPoolRoot, "buildkit") + dir, err := os.MkdirTemp(sm.mountPoolRoot, "buildkit") if err != nil { return nil, nil, err } diff --git a/cache/util/fsutil.go b/cache/util/fsutil.go index b425a002a542..e90ed45f77f4 100644 --- a/cache/util/fsutil.go +++ b/cache/util/fsutil.go @@ -3,7 +3,6 @@ package util import ( "context" "io" - "io/ioutil" "os" "path/filepath" @@ -59,7 +58,7 @@ func ReadFile(ctx context.Context, mount snapshot.Mountable, req ReadRequest) ([ } if req.Range == nil { - dt, err = ioutil.ReadFile(fp) + dt, err = os.ReadFile(fp) if err != nil { return errors.WithStack(err) } @@ -68,7 +67,7 @@ func ReadFile(ctx context.Context, mount snapshot.Mountable, req ReadRequest) ([ if err != nil { return errors.WithStack(err) } - dt, err = ioutil.ReadAll(io.NewSectionReader(f, int64(req.Range.Offset), int64(req.Range.Length))) + dt, err = io.ReadAll(io.NewSectionReader(f, int64(req.Range.Offset), int64(req.Range.Length))) f.Close() if err != nil { return errors.WithStack(err) diff --git a/client/build_test.go b/client/build_test.go index 23642de80f60..95091bdb4936 100644 --- a/client/build_test.go +++ b/client/build_test.go @@ -7,7 +7,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strconv" @@ -134,7 +133,7 @@ func testClientGatewaySolve(t *testing.T, sb integration.Sandbox) { return r, nil } - tmpdir, err := ioutil.TempDir("", "buildkit") + tmpdir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -153,7 +152,7 @@ func testClientGatewaySolve(t *testing.T, sb integration.Sandbox) { }, product, b, nil) require.NoError(t, err) - read, err := ioutil.ReadFile(filepath.Join(tmpdir, "foo")) + read, err := os.ReadFile(filepath.Join(tmpdir, "foo")) require.NoError(t, err) require.Equal(t, testStr, string(read)) @@ -476,7 +475,7 @@ func testClientGatewayContainerExecPipe(t *testing.T, sb integration.Sandbox) { Args: []string{"cat"}, Cwd: "/", Tty: false, - Stdin: ioutil.NopCloser(stdin2), + Stdin: io.NopCloser(stdin2), Stdout: stdout2, }) @@ -688,11 +687,11 @@ func testClientGatewayContainerMounts(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) defer c.Close() - tmpdir, err := ioutil.TempDir("", "buildkit-buildctl") + tmpdir, err := os.MkdirTemp("", "buildkit-buildctl") require.NoError(t, err) defer os.RemoveAll(tmpdir) - err = ioutil.WriteFile(filepath.Join(tmpdir, "local-file"), []byte("local"), 0644) + err = os.WriteFile(filepath.Join(tmpdir, "local-file"), []byte("local"), 0644) require.NoError(t, err) a := agent.NewKeyring() diff --git a/client/client.go b/client/client.go index 8c9259a4a9d1..da0bc0e018ab 100644 --- a/client/client.go +++ b/client/client.go @@ -4,9 +4,9 @@ import ( "context" "crypto/tls" "crypto/x509" - "io/ioutil" "net" "net/url" + "os" "strings" "github.com/containerd/containerd/defaults" @@ -212,7 +212,7 @@ func WithCredentials(serverName, ca, cert, key string) ClientOpt { } func loadCredentials(opts *withCredentials) (grpc.DialOption, error) { - ca, err := ioutil.ReadFile(opts.CACert) + ca, err := os.ReadFile(opts.CACert) if err != nil { return nil, errors.Wrap(err, "could not read ca certificate") } diff --git a/client/client_test.go b/client/client_test.go index 425fbeb667df..9f41cad1ad35 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -12,7 +12,6 @@ import ( "encoding/pem" "fmt" "io" - "io/ioutil" "net" "net/http" "os" @@ -199,11 +198,11 @@ func testCacheExportCacheKeyLoop(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) defer c.Close() - tmpdir, err := ioutil.TempDir("", "buildkit-buildctl") + tmpdir, err := os.MkdirTemp("", "buildkit-buildctl") require.NoError(t, err) defer os.RemoveAll(tmpdir) - err = ioutil.WriteFile(filepath.Join(tmpdir, "foo"), []byte("foodata"), 0600) + err = os.WriteFile(filepath.Join(tmpdir, "foo"), []byte("foodata"), 0600) require.NoError(t, err) for _, mode := range []bool{false, true} { @@ -298,7 +297,7 @@ func testExportBusyboxLocal(t *testing.T, sb integration.Sandbox) { def, err := llb.Image("busybox").Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -440,7 +439,7 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { def, err = out.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -455,11 +454,11 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "sock")) + dt, err := os.ReadFile(filepath.Join(destDir, "sock")) require.NoError(t, err) require.Equal(t, "/run/buildkit/ssh_agent.0", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err = os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Contains(t, string(dt), "2048") require.Contains(t, string(dt), "(RSA)") @@ -487,7 +486,7 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err = os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Contains(t, string(dt), "agent refused operation") @@ -511,11 +510,11 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { }, ) - tmpDir, err := ioutil.TempDir("", "buildkit") + tmpDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(tmpDir) - err = ioutil.WriteFile(filepath.Join(tmpDir, "key"), dt, 0600) + err = os.WriteFile(filepath.Join(tmpDir, "key"), dt, 0600) require.NoError(t, err) ssh, err = sshprovider.NewSSHAgentProvider([]sshprovider.AgentConfig{{ @@ -523,7 +522,7 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { }}) require.NoError(t, err) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -538,7 +537,7 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err = os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Contains(t, string(dt), "1024") require.Contains(t, string(dt), "(RSA)") @@ -573,7 +572,7 @@ func testShmSize(t *testing.T, sb integration.Sandbox) { def, err := out.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -587,7 +586,7 @@ func testShmSize(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Contains(t, string(dt), `size=131072k`) } @@ -610,7 +609,7 @@ func testUlimit(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -624,11 +623,11 @@ func testUlimit(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "first")) + dt, err := os.ReadFile(filepath.Join(destDir, "first")) require.NoError(t, err) require.Equal(t, `1062`, strings.TrimSpace(string(dt))) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "second")) + dt2, err := os.ReadFile(filepath.Join(destDir, "second")) require.NoError(t, err) require.NotEqual(t, `1062`, strings.TrimSpace(string(dt2))) } @@ -655,7 +654,7 @@ func testCgroupParent(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -669,11 +668,11 @@ func testCgroupParent(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "first")) + dt, err := os.ReadFile(filepath.Join(destDir, "first")) require.NoError(t, err) require.Contains(t, strings.TrimSpace(string(dt)), `/foocgroup/buildkit/`) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "second")) + dt2, err := os.ReadFile(filepath.Join(destDir, "second")) require.NoError(t, err) require.NotContains(t, strings.TrimSpace(string(dt2)), `/foocgroup/buildkit/`) } @@ -797,7 +796,7 @@ func testSecurityMode(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -813,7 +812,7 @@ func testSecurityMode(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) - contents, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + contents, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) caps, err := strconv.ParseUint(strings.TrimSpace(string(contents)), 16, 64) @@ -918,7 +917,7 @@ func testFrontendImageNaming(t *testing.T, sb integration.Sandbox) { require.Contains(t, exporterResponse, "image.name") require.Equal(t, exporterResponse["image.name"], "docker.io/library/"+imageName) - dt, err := ioutil.ReadFile(out) + dt, err := os.ReadFile(out) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -990,7 +989,7 @@ func testFrontendImageNaming(t *testing.T, sb integration.Sandbox) { for _, exp := range []string{ExporterOCI, ExporterDocker, ExporterImage} { exp := exp // capture loop variable. t.Run(exp, func(t *testing.T) { - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1256,7 +1255,7 @@ func testRelativeWorkDir(t *testing.T, sb integration.Sandbox) { def, err := pwd.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1270,7 +1269,7 @@ func testRelativeWorkDir(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "pwd")) + dt, err := os.ReadFile(filepath.Join(destDir, "pwd")) require.NoError(t, err) require.Equal(t, []byte("/test1/test2\n"), dt) } @@ -1287,7 +1286,7 @@ func testFileOpMkdirMkfile(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1305,7 +1304,7 @@ func testFileOpMkdirMkfile(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) require.Equal(t, true, fi.IsDir()) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, []byte("contents"), dt) } @@ -1341,7 +1340,7 @@ func testFileOpCopyRm(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1359,7 +1358,7 @@ func testFileOpCopyRm(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "myfile2")) + dt, err := os.ReadFile(filepath.Join(destDir, "myfile2")) require.NoError(t, err) require.Equal(t, []byte("data0"), dt) @@ -1367,14 +1366,14 @@ func testFileOpCopyRm(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) require.Equal(t, true, fi.IsDir()) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out/bar")) + dt, err = os.ReadFile(filepath.Join(destDir, "out/bar")) require.NoError(t, err) require.Equal(t, []byte("bar0"), dt) _, err = os.Stat(filepath.Join(destDir, "out/foo")) require.ErrorIs(t, err, os.ErrNotExist) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "file2")) + dt, err = os.ReadFile(filepath.Join(destDir, "file2")) require.NoError(t, err) require.Equal(t, []byte("file2"), dt) } @@ -1412,7 +1411,7 @@ func testFileOpCopyIncludeExclude(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1429,7 +1428,7 @@ func testFileOpCopyIncludeExclude(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "sub", "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "sub", "foo")) require.NoError(t, err) require.Equal(t, []byte("foo0"), dt) @@ -1438,7 +1437,7 @@ func testFileOpCopyIncludeExclude(t *testing.T, sb integration.Sandbox) { require.ErrorIs(t, err, os.ErrNotExist) } - randBytes, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + randBytes, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) // Create additional file which doesn't match the include pattern, and make @@ -1461,7 +1460,7 @@ func testFileOpCopyIncludeExclude(t *testing.T, sb integration.Sandbox) { def, err = st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1478,7 +1477,7 @@ func testFileOpCopyIncludeExclude(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - randBytes2, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + randBytes2, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) require.Equal(t, randBytes, randBytes2) @@ -1544,7 +1543,7 @@ func testLocalSourceWithDiffer(t *testing.T, sb integration.Sandbox, d llb.DiffT def, err := st.Marshal(context.TODO()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1561,11 +1560,11 @@ func testLocalSourceWithDiffer(t *testing.T, sb integration.Sandbox, d llb.DiffT }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, []byte("foo"), dt) - err = ioutil.WriteFile(filepath.Join(dir, "foo"), []byte("bar"), 0600) + err = os.WriteFile(filepath.Join(dir, "foo"), []byte("bar"), 0600) require.NoError(t, err) err = syscall.UtimesNano(filepath.Join(dir, "foo"), []syscall.Timespec{tv, tv}) @@ -1584,7 +1583,7 @@ func testLocalSourceWithDiffer(t *testing.T, sb integration.Sandbox, d llb.DiffT }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) if d == llb.DiffMetadata { require.Equal(t, []byte("foo"), dt) @@ -1619,7 +1618,7 @@ func testFileOpRmWildcard(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1636,7 +1635,7 @@ func testFileOpRmWildcard(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar/remaining")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar/remaining")) require.NoError(t, err) require.Equal(t, []byte("bar1"), dt) @@ -1720,7 +1719,7 @@ func testBuildHTTPSource(t *testing.T, sb integration.Sandbox) { require.Equal(t, server.Stats("/foo").AllRequests, 1) require.Equal(t, server.Stats("/foo").CachedRequests, 0) - tmpdir, err := ioutil.TempDir("", "buildkit") + tmpdir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -1737,7 +1736,7 @@ func testBuildHTTPSource(t *testing.T, sb integration.Sandbox) { require.Equal(t, server.Stats("/foo").AllRequests, 2) require.Equal(t, server.Stats("/foo").CachedRequests, 1) - dt, err := ioutil.ReadFile(filepath.Join(tmpdir, "foo")) + dt, err := os.ReadFile(filepath.Join(tmpdir, "foo")) require.NoError(t, err) require.Equal(t, []byte("content1"), dt) @@ -1760,7 +1759,7 @@ func testBuildHTTPSource(t *testing.T, sb integration.Sandbox) { require.Equal(t, server.Stats("/foo").AllRequests, 3) require.Equal(t, server.Stats("/foo").CachedRequests, 1) - dt, err = ioutil.ReadFile(filepath.Join(tmpdir, "bar")) + dt, err = os.ReadFile(filepath.Join(tmpdir, "bar")) require.NoError(t, err) require.Equal(t, []byte("content1"), dt) @@ -1793,7 +1792,7 @@ func testResolveAndHosts(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1807,11 +1806,11 @@ func testResolveAndHosts(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "resolv.conf")) + dt, err := os.ReadFile(filepath.Join(destDir, "resolv.conf")) require.NoError(t, err) require.Contains(t, string(dt), "nameserver") - dt, err = ioutil.ReadFile(filepath.Join(destDir, "hosts")) + dt, err = os.ReadFile(filepath.Join(destDir, "hosts")) require.NoError(t, err) require.Contains(t, string(dt), "127.0.0.1 localhost") } @@ -1847,7 +1846,7 @@ func testUser(t *testing.T, sb integration.Sandbox) { def, err := out.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1861,32 +1860,32 @@ func testUser(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "user")) + dt, err := os.ReadFile(filepath.Join(destDir, "user")) require.NoError(t, err) require.Equal(t, "daemon", strings.TrimSpace(string(dt))) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "group")) + dt, err = os.ReadFile(filepath.Join(destDir, "group")) require.NoError(t, err) require.Equal(t, "daemon", strings.TrimSpace(string(dt))) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "nobody")) + dt, err = os.ReadFile(filepath.Join(destDir, "nobody")) require.NoError(t, err) require.Equal(t, "nobody", strings.TrimSpace(string(dt))) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "userone")) + dt, err = os.ReadFile(filepath.Join(destDir, "userone")) require.NoError(t, err) require.Equal(t, "1", strings.TrimSpace(string(dt))) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "root_supplementary")) + dt, err = os.ReadFile(filepath.Join(destDir, "root_supplementary")) require.NoError(t, err) require.True(t, strings.HasPrefix(string(dt), "root ")) require.True(t, strings.Contains(string(dt), "wheel")) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "default_supplementary")) + dt2, err := os.ReadFile(filepath.Join(destDir, "default_supplementary")) require.NoError(t, err) require.Equal(t, string(dt), string(dt2)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "default_uid")) + dt, err = os.ReadFile(filepath.Join(destDir, "default_uid")) require.NoError(t, err) require.Equal(t, "0", strings.TrimSpace(string(dt))) @@ -1914,7 +1913,7 @@ func testOCIExporter(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) for _, exp := range []string{ExporterOCI, ExporterDocker} { - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1937,7 +1936,7 @@ func testOCIExporter(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(out) + dt, err := os.ReadFile(out) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -2084,7 +2083,7 @@ func testFrontendUseSolveResults(t *testing.T, sb integration.Sandbox) { }) } - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2098,7 +2097,7 @@ func testFrontendUseSolveResults(t *testing.T, sb integration.Sandbox) { }, "", frontend, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo2")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo2")) require.NoError(t, err) require.Equal(t, dt, []byte("data")) } @@ -2152,7 +2151,7 @@ func testTarExporterWithSocket(t *testing.T, sb integration.Sandbox) { Type: ExporterTar, Attrs: map[string]string{}, Output: func(m map[string]string) (io.WriteCloser, error) { - return nopWriteCloser{ioutil.Discard}, nil + return nopWriteCloser{io.Discard}, nil }, }, }, @@ -2539,7 +2538,7 @@ func testBuildExportZstd(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2566,7 +2565,7 @@ func testBuildExportZstd(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(out) + dt, err := os.ReadFile(out) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -2604,7 +2603,7 @@ func testBuildExportZstd(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(out) + dt, err = os.ReadFile(out) require.NoError(t, err) m, err = testutil.ReadTarToMap(dt, false) @@ -2674,7 +2673,7 @@ func testPullZstdImage(t *testing.T, sb integration.Sandbox) { def, err = st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2688,7 +2687,7 @@ func testPullZstdImage(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "zdata")) + dt, err := os.ReadFile(filepath.Join(destDir, "zdata")) require.NoError(t, err) require.Equal(t, dt, []byte("zstd")) } @@ -2740,7 +2739,7 @@ func testBuildPushAndValidate(t *testing.T, sb integration.Sandbox) { def, err = firstBuild.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2754,11 +2753,11 @@ func testBuildPushAndValidate(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo/sub/bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo/sub/bar")) require.NoError(t, err) require.Equal(t, dt, []byte("first")) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foo/sub/baz")) + dt, err = os.ReadFile(filepath.Join(destDir, "foo/sub/baz")) require.NoError(t, err) require.Equal(t, dt, []byte("second")) @@ -2920,7 +2919,7 @@ func testStargzLazyRegistryCacheImportExport(t *testing.T, sb integration.Sandbo require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3160,7 +3159,7 @@ func testStargzLazyInlineCacheImportExport(t *testing.T, sb integration.Sandbox) checkAllReleasable(t, c, sb, true) // stargz layers should be exportable - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) out := filepath.Join(destDir, "out.tar") @@ -3292,7 +3291,7 @@ func testStargzLazyPull(t *testing.T, sb integration.Sandbox) { checkAllReleasable(t, c, sb, true) // stargz layers should be exportable - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) out := filepath.Join(destDir, "out.tar") @@ -3466,11 +3465,11 @@ func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) - destOutDir, err := ioutil.TempDir("", "buildkit") + destOutDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destOutDir) @@ -3495,13 +3494,13 @@ func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) var index ocispecs.Index - dt, err := ioutil.ReadFile(filepath.Join(destDir, "index.json")) + dt, err := os.ReadFile(filepath.Join(destDir, "index.json")) require.NoError(t, err) err = json.Unmarshal(dt, &index) require.NoError(t, err) var layerIndex ocispecs.Index - dt, err = ioutil.ReadFile(filepath.Join(destDir, "blobs/sha256/"+index.Manifests[0].Digest.Hex())) + dt, err = os.ReadFile(filepath.Join(destDir, "blobs/sha256/"+index.Manifests[0].Digest.Hex())) require.NoError(t, err) err = json.Unmarshal(dt, &layerIndex) require.NoError(t, err) @@ -3510,14 +3509,14 @@ func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) { require.Equal(t, ocispecs.MediaTypeImageLayer+"+zstd", lastLayer.MediaType) zstdLayerDigest := lastLayer.Digest.Hex() - dt, err = ioutil.ReadFile(filepath.Join(destDir, "blobs/sha256/"+zstdLayerDigest)) + dt, err = os.ReadFile(filepath.Join(destDir, "blobs/sha256/"+zstdLayerDigest)) require.NoError(t, err) require.Equal(t, dt[:4], []byte{0x28, 0xb5, 0x2f, 0xfd}) } func testUncompressedLocalCacheImportExport(t *testing.T, sb integration.Sandbox) { integration.SkipIfDockerd(t, sb, "remote cache export") - dir, err := ioutil.TempDir("", "buildkit") + dir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(dir) im := CacheOptionsEntry{ @@ -3568,7 +3567,7 @@ func testZstdLocalCacheImportExport(t *testing.T, sb integration.Sandbox) { // containerd 1.4 doesn't support zstd compression return } - dir, err := ioutil.TempDir("", "buildkit") + dir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(dir) im := CacheOptionsEntry{ @@ -3638,7 +3637,7 @@ func testBasicCacheImportExport(t *testing.T, sb integration.Sandbox, cacheOptio def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3653,16 +3652,16 @@ func testBasicCacheImportExport(t *testing.T, sb integration.Sandbox, cacheOptio }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "const")) + dt, err := os.ReadFile(filepath.Join(destDir, "const")) require.NoError(t, err) require.Equal(t, string(dt), "foobar") - dt, err = ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt, err = os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) ensurePruneAll(t, c, sb) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3676,11 +3675,11 @@ func testBasicCacheImportExport(t *testing.T, sb integration.Sandbox, cacheOptio }, nil) require.NoError(t, err) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "const")) + dt2, err := os.ReadFile(filepath.Join(destDir, "const")) require.NoError(t, err) require.Equal(t, string(dt2), "foobar") - dt2, err = ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt2, err = os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) require.Equal(t, string(dt), string(dt2)) } @@ -3727,7 +3726,7 @@ func testMultipleRegistryCacheImportExport(t *testing.T, sb integration.Sandbox) func testBasicLocalCacheImportExport(t *testing.T, sb integration.Sandbox) { integration.SkipIfDockerd(t, sb, "remote cache export") - dir, err := ioutil.TempDir("", "buildkit") + dir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(dir) im := CacheOptionsEntry{ @@ -3910,7 +3909,7 @@ func readFileInImage(ctx context.Context, c *Client, ref, path string) ([]byte, if err != nil { return nil, err } - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") if err != nil { return nil, err } @@ -3927,7 +3926,7 @@ func readFileInImage(ctx context.Context, c *Client, ref, path string) ([]byte, if err != nil { return nil, err } - return ioutil.ReadFile(filepath.Join(destDir, filepath.Clean(path))) + return os.ReadFile(filepath.Join(destDir, filepath.Clean(path))) } func testCachedMounts(t *testing.T, sb integration.Sandbox) { @@ -3963,7 +3962,7 @@ func testCachedMounts(t *testing.T, sb integration.Sandbox) { st.AddMount("/src0", llb.Scratch(), llb.AsPersistentCacheDir("mycache1", llb.CacheMountShared)) st.AddMount("/src1", base, llb.AsPersistentCacheDir("mycache2", llb.CacheMountShared)) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3980,15 +3979,15 @@ func testCachedMounts(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, string(dt), "first") - dt, err = ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err = os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, string(dt), "second") - dt, err = ioutil.ReadFile(filepath.Join(destDir, "baz")) + dt, err = os.ReadFile(filepath.Join(destDir, "baz")) require.NoError(t, err) require.Equal(t, string(dt), "base") @@ -4208,7 +4207,7 @@ func testDuplicateWhiteouts(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4226,7 +4225,7 @@ func testDuplicateWhiteouts(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(out) + dt, err := os.ReadFile(out) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -4280,7 +4279,7 @@ func testWhiteoutParentDir(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4297,7 +4296,7 @@ func testWhiteoutParentDir(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(out) + dt, err := os.ReadFile(out) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -4346,7 +4345,7 @@ func testMoveParentDir(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4363,7 +4362,7 @@ func testMoveParentDir(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(out) + dt, err := os.ReadFile(out) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -4606,7 +4605,7 @@ func testRmSymlink(t *testing.T, sb integration.Sandbox) { def, err := mnt.File(llb.Rm("link")).Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4642,7 +4641,7 @@ func testProxyEnv(t *testing.T, sb integration.Sandbox) { def, err := out.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4656,7 +4655,7 @@ func testProxyEnv(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "env")) + dt, err := os.ReadFile(filepath.Join(destDir, "env")) require.NoError(t, err) require.Equal(t, string(dt), "httpvalue-httpsvalue-noproxyvalue-noproxyvalue-allproxyvalue-allproxyvalue") @@ -4670,7 +4669,7 @@ func testProxyEnv(t *testing.T, sb integration.Sandbox) { def, err = out.Marshal(sb.Context()) require.NoError(t, err) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4684,7 +4683,7 @@ func testProxyEnv(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "env")) + dt, err = os.ReadFile(filepath.Join(destDir, "env")) require.NoError(t, err) require.Equal(t, string(dt), "httpvalue-httpsvalue-noproxyvalue-noproxyvalue-allproxyvalue-allproxyvalue") } @@ -4955,7 +4954,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { } // get the random value at /bar/2 - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4969,7 +4968,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { }, nil) require.NoError(t, err) - bar2Contents, err := ioutil.ReadFile(filepath.Join(destDir, "bar", "2")) + bar2Contents, err := os.ReadFile(filepath.Join(destDir, "bar", "2")) require.NoError(t, err) // clear all local state out @@ -5061,7 +5060,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { } // check the random value at /bar/2 didn't change - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5076,7 +5075,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { }, nil) require.NoError(t, err) - newBar2Contents, err := ioutil.ReadFile(filepath.Join(destDir, "bar", "2")) + newBar2Contents, err := os.ReadFile(filepath.Join(destDir, "bar", "2")) require.NoError(t, err) require.Equalf(t, bar2Contents, newBar2Contents, "bar/2 contents changed") @@ -5110,7 +5109,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { require.NoError(t, err) // check the random value at /bar/2 didn't change - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5125,7 +5124,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { }, nil) require.NoError(t, err) - newBar2Contents, err = ioutil.ReadFile(filepath.Join(destDir, "bar", "2")) + newBar2Contents, err = os.ReadFile(filepath.Join(destDir, "bar", "2")) require.NoError(t, err) require.Equalf(t, bar2Contents, newBar2Contents, "bar/2 contents changed") @@ -5171,7 +5170,7 @@ func requireContents(ctx context.Context, t *testing.T, c *Client, sb integratio def, err := state.Marshal(ctx) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5221,7 +5220,7 @@ func requireEqualContents(ctx context.Context, t *testing.T, c *Client, stateA, defA, err := stateA.Marshal(ctx) require.NoError(t, err) - destDirA, err := ioutil.TempDir("", "buildkit") + destDirA, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDirA) @@ -5238,7 +5237,7 @@ func requireEqualContents(ctx context.Context, t *testing.T, c *Client, stateA, defB, err := stateB.Marshal(ctx) require.NoError(t, err) - destDirB, err := ioutil.TempDir("", "buildkit") + destDirB, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDirB) @@ -5387,7 +5386,7 @@ func testInvalidExporter(t *testing.T, sb integration.Sandbox) { def, err := llb.Image("busybox:latest").Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5472,7 +5471,7 @@ func testParallelLocalBuilds(t *testing.T, sb integration.Sandbox) { def, err := llb.Local("source").Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5489,7 +5488,7 @@ func testParallelLocalBuilds(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - act, err := ioutil.ReadFile(filepath.Join(destDir, fn)) + act, err := os.ReadFile(filepath.Join(destDir, fn)) require.NoError(t, err) require.Equal(t, "contents", string(act)) @@ -5521,7 +5520,7 @@ func testRelativeMountpoint(t *testing.T, sb integration.Sandbox) { def, err := st.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5535,7 +5534,7 @@ func testRelativeMountpoint(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "data")) + dt, err := os.ReadFile(filepath.Join(destDir, "data")) require.NoError(t, err) require.Equal(t, dt, []byte(id)) } @@ -5729,7 +5728,7 @@ func testBuildInfoNoExport(t *testing.T, sb integration.Sandbox) { } func tmpdir(appliers ...fstest.Applier) (string, error) { - tmpdir, err := ioutil.TempDir("", "buildkit-client") + tmpdir, err := os.MkdirTemp("", "buildkit-client") if err != nil { return "", err } @@ -5740,7 +5739,7 @@ func tmpdir(appliers ...fstest.Applier) (string, error) { } func makeSSHAgentSock(agent agent.Agent) (p string, cleanup func() error, err error) { - tmpDir, err := ioutil.TempDir("", "buildkit") + tmpDir, err := os.MkdirTemp("", "buildkit") if err != nil { return "", nil, err } diff --git a/client/llb/marshal.go b/client/llb/marshal.go index e59e560ee95c..553df11b3572 100644 --- a/client/llb/marshal.go +++ b/client/llb/marshal.go @@ -2,7 +2,6 @@ package llb import ( "io" - "io/ioutil" "github.com/containerd/containerd/platforms" "github.com/moby/buildkit/solver/pb" @@ -67,7 +66,7 @@ func WriteTo(def *Definition, w io.Writer) error { } func ReadFrom(r io.Reader) (*Definition, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, err } diff --git a/client/ociindex/ociindex.go b/client/ociindex/ociindex.go index a9c100a95bcd..ef1e1cf4c65e 100644 --- a/client/ociindex/ociindex.go +++ b/client/ociindex/ociindex.go @@ -2,7 +2,7 @@ package ociindex import ( "encoding/json" - "io/ioutil" + "io" "os" "github.com/gofrs/flock" @@ -62,7 +62,7 @@ func PutDescToIndexJSONFileLocked(indexJSONPath string, desc ocispecs.Descriptor } defer f.Close() var idx ocispecs.Index - b, err := ioutil.ReadAll(f) + b, err := io.ReadAll(f) if err != nil { return errors.Wrapf(err, "could not read %s", indexJSONPath) } @@ -101,7 +101,7 @@ func ReadIndexJSONFileLocked(indexJSONPath string) (*ocispecs.Index, error) { lock.Unlock() os.RemoveAll(lockPath) }() - b, err := ioutil.ReadFile(indexJSONPath) + b, err := os.ReadFile(indexJSONPath) if err != nil { return nil, errors.Wrapf(err, "could not read %s", indexJSONPath) } diff --git a/cmd/buildctl/build_test.go b/cmd/buildctl/build_test.go index bde880c9095c..1ce1f88cb107 100644 --- a/cmd/buildctl/build_test.go +++ b/cmd/buildctl/build_test.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -55,7 +54,7 @@ func testBuildLocalExporter(t *testing.T, sb integration.Sandbox) { rdr, err := marshal(sb.Context(), out) require.NoError(t, err) - tmpdir, err := ioutil.TempDir("", "buildkit-buildctl") + tmpdir, err := os.MkdirTemp("", "buildkit-buildctl") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -65,7 +64,7 @@ func testBuildLocalExporter(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(tmpdir, "foo")) + dt, err := os.ReadFile(filepath.Join(tmpdir, "foo")) require.NoError(t, err) require.Equal(t, string(dt), "bar") } @@ -121,7 +120,7 @@ func testBuildMetadataFile(t *testing.T, sb integration.Sandbox) { rdr, err := marshal(sb.Context(), st.Root()) require.NoError(t, err) - tmpDir, err := ioutil.TempDir("", "buildkit-buildctl") + tmpDir, err := os.MkdirTemp("", "buildkit-buildctl") require.NoError(t, err) defer os.RemoveAll(tmpDir) @@ -140,7 +139,7 @@ func testBuildMetadataFile(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) require.FileExists(t, metadataFile) - metadataBytes, err := ioutil.ReadFile(metadataFile) + metadataBytes, err := os.ReadFile(metadataFile) require.NoError(t, err) var metadata map[string]interface{} @@ -193,7 +192,7 @@ func marshal(ctx context.Context, st llb.State) (io.Reader, error) { } func tmpdir(appliers ...fstest.Applier) (string, error) { - tmpdir, err := ioutil.TempDir("", "buildkit-buildctl") + tmpdir, err := os.MkdirTemp("", "buildkit-buildctl") if err != nil { return "", err } diff --git a/cmd/buildctl/buildctl_test.go b/cmd/buildctl/buildctl_test.go index 66fef818f919..44ac5622c67c 100644 --- a/cmd/buildctl/buildctl_test.go +++ b/cmd/buildctl/buildctl_test.go @@ -2,7 +2,6 @@ package main import ( "encoding/json" - "io/ioutil" "os" "path" "testing" @@ -120,7 +119,7 @@ func TestWriteMetadataFile(t *testing.T) { t.Run(tt.name, func(t *testing.T) { fname := path.Join(tmpdir, "metadata_"+tt.name) require.NoError(t, writeMetadataFile(fname, tt.exporterResponse)) - current, err := ioutil.ReadFile(fname) + current, err := os.ReadFile(fname) require.NoError(t, err) var raw map[string]interface{} require.NoError(t, json.Unmarshal(current, &raw)) diff --git a/cmd/buildctl/debug/dumpmetadata.go b/cmd/buildctl/debug/dumpmetadata.go index 3b7e948b3990..b53fc25fd578 100644 --- a/cmd/buildctl/debug/dumpmetadata.go +++ b/cmd/buildctl/debug/dumpmetadata.go @@ -2,7 +2,6 @@ package debug import ( "fmt" - "io/ioutil" "os" "path/filepath" "time" @@ -41,7 +40,7 @@ var DumpMetadataCommand = cli.Command{ } func findMetadataDBFiles(root string) ([]string, error) { - dirs, err := ioutil.ReadDir(root) + dirs, err := os.ReadDir(root) if err != nil { return nil, err } diff --git a/cmd/buildkitd/main.go b/cmd/buildkitd/main.go index 126ba0dbe2c8..cdccc7cbf106 100644 --- a/cmd/buildkitd/main.go +++ b/cmd/buildkitd/main.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "io/ioutil" "net" "os" "os/user" @@ -594,7 +593,7 @@ func serverCredentials(cfg config.TLSConfig) (*tls.Config, error) { } if caFile != "" { certPool := x509.NewCertPool() - ca, err := ioutil.ReadFile(caFile) + ca, err := os.ReadFile(caFile) if err != nil { return nil, errors.Wrap(err, "could not read ca certificate") } diff --git a/examples/dockerfile2llb/main.go b/examples/dockerfile2llb/main.go index 94455565b1ec..284c649cbab1 100644 --- a/examples/dockerfile2llb/main.go +++ b/examples/dockerfile2llb/main.go @@ -3,7 +3,7 @@ package main import ( "context" "flag" - "io/ioutil" + "io" "log" "os" @@ -23,7 +23,7 @@ func main() { flag.StringVar(&opt.target, "target", "", "target stage") flag.Parse() - df, err := ioutil.ReadAll(os.Stdin) + df, err := io.ReadAll(os.Stdin) if err != nil { panic(err) } diff --git a/examples/kubernetes/consistenthash/main.go b/examples/kubernetes/consistenthash/main.go index ebe5f64f2840..4b100777ce3c 100644 --- a/examples/kubernetes/consistenthash/main.go +++ b/examples/kubernetes/consistenthash/main.go @@ -16,7 +16,7 @@ package main import ( "fmt" - "io/ioutil" + "io" "os" "strings" @@ -38,7 +38,7 @@ func xmain() error { return errors.New("should not reach here") } key := os.Args[1] - stdin, err := ioutil.ReadAll(os.Stdin) + stdin, err := io.ReadAll(os.Stdin) if err != nil { return err } diff --git a/executor/containerdexecutor/executor.go b/executor/containerdexecutor/executor.go index 43a05cccefe9..9336a64894be 100644 --- a/executor/containerdexecutor/executor.go +++ b/executor/containerdexecutor/executor.go @@ -3,7 +3,6 @@ package containerdexecutor import ( "context" "io" - "io/ioutil" "os" "path/filepath" "sync" @@ -315,10 +314,10 @@ func fixProcessOutput(process *executor.ProcessInfo) { // failed to start io pipe copy: unable to copy pipes: containerd-shim: opening file "" failed: open : no such file or directory: unknown // So just stub out any missing output if process.Stdout == nil { - process.Stdout = &nopCloser{ioutil.Discard} + process.Stdout = &nopCloser{io.Discard} } if process.Stderr == nil { - process.Stderr = &nopCloser{ioutil.Discard} + process.Stderr = &nopCloser{io.Discard} } } diff --git a/executor/oci/hosts.go b/executor/oci/hosts.go index d0505c28ccd9..0d193555c941 100644 --- a/executor/oci/hosts.go +++ b/executor/oci/hosts.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "io/ioutil" "os" "path/filepath" @@ -56,7 +55,7 @@ func makeHostsFile(stateDir string, extraHosts []executor.HostIP, idmap *idtools } tmpPath := p + ".tmp" - if err := ioutil.WriteFile(tmpPath, b.Bytes(), 0644); err != nil { + if err := os.WriteFile(tmpPath, b.Bytes(), 0644); err != nil { return "", nil, err } diff --git a/executor/oci/resolvconf.go b/executor/oci/resolvconf.go index da7745697645..3ac0feda7aea 100644 --- a/executor/oci/resolvconf.go +++ b/executor/oci/resolvconf.go @@ -2,7 +2,6 @@ package oci import ( "context" - "io/ioutil" "os" "path/filepath" @@ -100,7 +99,7 @@ func GetResolvConf(ctx context.Context, stateDir string, idmap *idtools.Identity } tmpPath := p + ".tmp" - if err := ioutil.WriteFile(tmpPath, f.Content, 0644); err != nil { + if err := os.WriteFile(tmpPath, f.Content, 0644); err != nil { return "", err } diff --git a/executor/oci/resolvconf_test.go b/executor/oci/resolvconf_test.go index 316bcefda283..578abb81328c 100644 --- a/executor/oci/resolvconf_test.go +++ b/executor/oci/resolvconf_test.go @@ -2,7 +2,6 @@ package oci import ( "context" - "io/ioutil" "os" "testing" @@ -27,13 +26,13 @@ nameserver 8.8.4.4 nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844` - dir, err := ioutil.TempDir("", "buildkit-test") + dir, err := os.MkdirTemp("", "buildkit-test") require.NoError(t, err) defer os.RemoveAll(dir) ctx := context.Background() p, err := GetResolvConf(ctx, dir, nil, nil) require.NoError(t, err) - b, err := ioutil.ReadFile(p) + b, err := os.ReadFile(p) require.NoError(t, err) require.Equal(t, string(b), defaultResolvConf) } diff --git a/exporter/local/export.go b/exporter/local/export.go index b9169ac5b20c..2ff194ca55c1 100644 --- a/exporter/local/export.go +++ b/exporter/local/export.go @@ -2,7 +2,6 @@ package local import ( "context" - "io/ioutil" "os" "strings" "time" @@ -67,7 +66,7 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source, var err error var idmap *idtools.IdentityMapping if ref == nil { - src, err = ioutil.TempDir("", "buildkit") + src, err = os.MkdirTemp("", "buildkit") if err != nil { return err } diff --git a/exporter/tar/export.go b/exporter/tar/export.go index 13540b947de7..e4ffccf572b5 100644 --- a/exporter/tar/export.go +++ b/exporter/tar/export.go @@ -2,7 +2,6 @@ package local import ( "context" - "io/ioutil" "os" "strconv" "strings" @@ -83,7 +82,7 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source, var err error var idmap *idtools.IdentityMapping if ref == nil { - src, err = ioutil.TempDir("", "buildkit") + src, err = os.MkdirTemp("", "buildkit") if err != nil { return nil, err } diff --git a/frontend/dockerfile/dockerfile_buildinfo_test.go b/frontend/dockerfile/dockerfile_buildinfo_test.go index 87cd8c70813f..ae06ea094ae9 100644 --- a/frontend/dockerfile/dockerfile_buildinfo_test.go +++ b/frontend/dockerfile/dockerfile_buildinfo_test.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -48,7 +47,7 @@ func testBuildInfoSources(t *testing.T, sb integration.Sandbox) { f := getFrontend(t, sb) f.RequiresBuildctl(t) - gitDir, err := ioutil.TempDir("", "buildkit") + gitDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(gitDir) @@ -59,7 +58,7 @@ ADD https://raw.githubusercontent.com/moby/moby/master/README.md / COPY --from=alpine /bin/busybox /alpine-busybox ` - err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte(dockerfile), 0600) + err = os.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte(dockerfile), 0600) require.NoError(t, err) err = runShell(gitDir, @@ -554,7 +553,7 @@ COPY --from=build /foo /out / return res, nil } - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -700,7 +699,7 @@ COPY --from=build /foo /out / return res, nil } - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -831,7 +830,7 @@ RUN echo "foo is $FOO" > /foo return res, nil } - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) diff --git a/frontend/dockerfile/dockerfile_heredoc_test.go b/frontend/dockerfile/dockerfile_heredoc_test.go index 09f067540d99..6671fe436406 100644 --- a/frontend/dockerfile/dockerfile_heredoc_test.go +++ b/frontend/dockerfile/dockerfile_heredoc_test.go @@ -2,7 +2,6 @@ package dockerfile import ( "fmt" - "io/ioutil" "os" "path/filepath" "testing" @@ -78,7 +77,7 @@ COPY --from=build /dest / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -104,7 +103,7 @@ COPY --from=build /dest / } for name, content := range contents { - dt, err := ioutil.ReadFile(filepath.Join(destDir, name)) + dt, err := os.ReadFile(filepath.Join(destDir, name)) require.NoError(t, err) require.Equal(t, content, string(dt)) } @@ -151,7 +150,7 @@ EOF require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -169,31 +168,31 @@ EOF }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "quotefile")) + dt, err := os.ReadFile(filepath.Join(destDir, "quotefile")) require.NoError(t, err) require.Equal(t, "\"quotes in file\"\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "slashfile1")) + dt, err = os.ReadFile(filepath.Join(destDir, "slashfile1")) require.NoError(t, err) require.Equal(t, "\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "slashfile2")) + dt, err = os.ReadFile(filepath.Join(destDir, "slashfile2")) require.NoError(t, err) require.Equal(t, "\\\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "slashfile3")) + dt, err = os.ReadFile(filepath.Join(destDir, "slashfile3")) require.NoError(t, err) require.Equal(t, "$\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "rawslashfile1")) + dt, err = os.ReadFile(filepath.Join(destDir, "rawslashfile1")) require.NoError(t, err) require.Equal(t, "\\\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "rawslashfile2")) + dt, err = os.ReadFile(filepath.Join(destDir, "rawslashfile2")) require.NoError(t, err) require.Equal(t, "\\\\\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "rawslashfile3")) + dt, err = os.ReadFile(filepath.Join(destDir, "rawslashfile3")) require.NoError(t, err) require.Equal(t, "\\$\n", string(dt)) } @@ -223,7 +222,7 @@ COPY --from=build /dest /dest require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -241,7 +240,7 @@ COPY --from=build /dest /dest }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest")) require.NoError(t, err) require.Equal(t, "i am\nroot\n", string(dt)) } @@ -273,7 +272,7 @@ COPY --from=build /dest /dest require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -291,7 +290,7 @@ COPY --from=build /dest /dest }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest")) require.NoError(t, err) require.Equal(t, "foo\n", string(dt)) } @@ -324,7 +323,7 @@ COPY --from=build /dest /dest require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -342,7 +341,7 @@ COPY --from=build /dest /dest }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest")) require.NoError(t, err) require.Equal(t, "hello\nworld\n", string(dt)) } @@ -389,7 +388,7 @@ COPY --from=build /dest / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -415,7 +414,7 @@ COPY --from=build /dest / } for name, content := range contents { - dt, err := ioutil.ReadFile(filepath.Join(destDir, name)) + dt, err := os.ReadFile(filepath.Join(destDir, name)) require.NoError(t, err) require.Equal(t, content, string(dt)) } @@ -481,7 +480,7 @@ COPY --from=build /dest / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -511,7 +510,7 @@ COPY --from=build /dest / } for name, content := range contents { - dt, err := ioutil.ReadFile(filepath.Join(destDir, name)) + dt, err := os.ReadFile(filepath.Join(destDir, name)) require.NoError(t, err) require.Equal(t, content, string(dt)) } @@ -577,7 +576,7 @@ COPY --from=build /dest / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -610,7 +609,7 @@ COPY --from=build /dest / } for name, content := range contents { - dt, err := ioutil.ReadFile(filepath.Join(destDir, name)) + dt, err := os.ReadFile(filepath.Join(destDir, name)) require.NoError(t, err) require.Equal(t, content, string(dt)) } @@ -683,7 +682,7 @@ EOF require.NoError(t, err) defer os.RemoveAll(dir) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -701,7 +700,7 @@ EOF }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest")) require.NoError(t, err) require.Equal(t, "hello world\n", string(dt)) } diff --git a/frontend/dockerfile/dockerfile_mount_test.go b/frontend/dockerfile/dockerfile_mount_test.go index 731d5f2d78dc..f3b383ecb16b 100644 --- a/frontend/dockerfile/dockerfile_mount_test.go +++ b/frontend/dockerfile/dockerfile_mount_test.go @@ -1,7 +1,6 @@ package dockerfile import ( - "io/ioutil" "os" "path/filepath" "strconv" @@ -187,7 +186,7 @@ COPY --from=second /unique /unique require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -205,7 +204,7 @@ COPY --from=second /unique /unique }, nil) require.NoError(t, err) - dt1, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt1, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) // repeat with changed file that should be still cached by content @@ -216,7 +215,7 @@ COPY --from=second /unique /unique require.NoError(t, err) defer os.RemoveAll(dir) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -234,7 +233,7 @@ COPY --from=second /unique /unique }, nil) require.NoError(t, err) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt2, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) require.Equal(t, dt1, dt2) } @@ -474,7 +473,7 @@ COPY --from=base /tmpfssize / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -492,7 +491,7 @@ COPY --from=base /tmpfssize / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "tmpfssize")) + dt, err := os.ReadFile(filepath.Join(destDir, "tmpfssize")) require.NoError(t, err) require.Contains(t, string(dt), `size=131072k`) } diff --git a/frontend/dockerfile/dockerfile_ssh_test.go b/frontend/dockerfile/dockerfile_ssh_test.go index 9515aad12882..9728c496c2dc 100644 --- a/frontend/dockerfile/dockerfile_ssh_test.go +++ b/frontend/dockerfile/dockerfile_ssh_test.go @@ -5,7 +5,6 @@ import ( "crypto/rsa" "crypto/x509" "encoding/pem" - "io/ioutil" "os" "path/filepath" "testing" @@ -55,11 +54,11 @@ RUN --mount=type=ssh,mode=741,uid=100,gid=102 [ "$(stat -c "%u %g %f" $SSH_AUTH_ }, ) - tmpDir, err := ioutil.TempDir("", "buildkit") + tmpDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(tmpDir) - err = ioutil.WriteFile(filepath.Join(tmpDir, "key"), dt, 0600) + err = os.WriteFile(filepath.Join(tmpDir, "key"), dt, 0600) require.NoError(t, err) ssh, err := sshprovider.NewSSHAgentProvider([]sshprovider.AgentConfig{{ diff --git a/frontend/dockerfile/dockerfile_test.go b/frontend/dockerfile/dockerfile_test.go index 0f2864089ec3..056e1a75ed7c 100644 --- a/frontend/dockerfile/dockerfile_test.go +++ b/frontend/dockerfile/dockerfile_test.go @@ -8,7 +8,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -242,7 +241,7 @@ echo -n $my_arg $1 > /out require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -271,7 +270,7 @@ echo -n $my_arg $1 > /out }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, x.expected, string(dt)) }) @@ -297,7 +296,7 @@ RUN [ "$myenv" = 'foo%sbar' ] require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -434,7 +433,7 @@ COPY --from=base2 /foo /f require.NoError(t, err) defer os.RemoveAll(dir) - cacheDir, err := ioutil.TempDir("", "buildkit") + cacheDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(cacheDir) @@ -584,7 +583,7 @@ WORKDIR / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -790,7 +789,7 @@ COPY --from=base unique / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -808,13 +807,13 @@ COPY --from=base unique / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) - err = ioutil.WriteFile(filepath.Join(dir, "bar"), []byte("bar-data-mod"), 0600) + err = os.WriteFile(filepath.Join(dir, "bar"), []byte("bar-data-mod"), 0600) require.NoError(t, err) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -832,14 +831,14 @@ COPY --from=base unique / }, nil) require.NoError(t, err) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt2, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) require.Equal(t, string(dt), string(dt2)) - err = ioutil.WriteFile(filepath.Join(dir, "foo2"), []byte("foo2-data-mod"), 0600) + err = os.WriteFile(filepath.Join(dir, "foo2"), []byte("foo2-data-mod"), 0600) require.NoError(t, err) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -857,7 +856,7 @@ COPY --from=base unique / }, nil) require.NoError(t, err) - dt2, err = ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt2, err = os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) require.NotEqual(t, string(dt), string(dt2)) } @@ -881,7 +880,7 @@ COPY foo nomatch* / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -899,7 +898,7 @@ COPY foo nomatch* / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "contents0", string(dt)) } @@ -1068,7 +1067,7 @@ COPY link/foo . require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1089,7 +1088,7 @@ COPY link/foo . }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "contents", string(dt)) } @@ -1116,7 +1115,7 @@ COPY --from=build /sub2/foo bar require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1137,7 +1136,7 @@ COPY --from=build /sub2/foo bar }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "data", string(dt)) } @@ -1162,7 +1161,7 @@ COPY . / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1241,7 +1240,7 @@ COPY --from=build /out . require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1259,7 +1258,7 @@ COPY --from=build /out . }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, "bar-box-foo", string(dt)) } @@ -1287,7 +1286,7 @@ COPY --from=build /out . require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1305,7 +1304,7 @@ COPY --from=build /out . }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, "foo bar:box-foo:123 456", string(dt)) } @@ -1330,7 +1329,7 @@ COPY Dockerfile . require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1355,7 +1354,7 @@ COPY Dockerfile . }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out.tar")) + dt, err := os.ReadFile(filepath.Join(destDir, "out.tar")) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -1426,7 +1425,7 @@ COPY arch-$TARGETARCH whoami require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1447,21 +1446,21 @@ COPY arch-$TARGETARCH whoami }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "windows_amd64/whoami")) + dt, err := os.ReadFile(filepath.Join(destDir, "windows_amd64/whoami")) require.NoError(t, err) require.Equal(t, "i am amd64", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "linux_arm_v7/whoami")) + dt, err = os.ReadFile(filepath.Join(destDir, "linux_arm_v7/whoami")) require.NoError(t, err) require.Equal(t, "i am arm", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "linux_s390x/whoami")) + dt, err = os.ReadFile(filepath.Join(destDir, "linux_s390x/whoami")) require.NoError(t, err) require.Equal(t, "i am s390x", string(dt)) // repeat with oci exporter - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1486,7 +1485,7 @@ COPY arch-$TARGETARCH whoami }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out.tar")) + dt, err = os.ReadFile(filepath.Join(destDir, "out.tar")) require.NoError(t, err) m, err := testutil.ReadTarToMap(dt, false) @@ -1580,7 +1579,7 @@ COPY foo / require.NoError(t, err) defer os.RemoveAll(dir) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1601,7 +1600,7 @@ COPY foo / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "contents2", string(dt)) } @@ -1681,7 +1680,7 @@ COPY foo/sub bar require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1726,7 +1725,7 @@ COPY sub/l* alllinks/ require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1747,19 +1746,19 @@ COPY sub/l* alllinks/ }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "bar-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "alllinks/l0")) + dt, err = os.ReadFile(filepath.Join(destDir, "alllinks/l0")) require.NoError(t, err) require.Equal(t, "subfile-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "alllinks/lfile")) + dt, err = os.ReadFile(filepath.Join(destDir, "alllinks/lfile")) require.NoError(t, err) require.Equal(t, "lfile-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "alllinks/l1")) + dt, err = os.ReadFile(filepath.Join(destDir, "alllinks/l1")) require.NoError(t, err) require.Equal(t, "baz-contents", string(dt)) } @@ -1774,11 +1773,11 @@ FROM scratch COPY --from=0 /foo /foo `) - srcDir, err := ioutil.TempDir("", "buildkit") + srcDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(srcDir) - err = ioutil.WriteFile(filepath.Join(srcDir, "Dockerfile"), dockerfile, 0600) + err = os.WriteFile(filepath.Join(srcDir, "Dockerfile"), dockerfile, 0600) require.NoError(t, err) resp := httpserver.Response{ @@ -1791,7 +1790,7 @@ COPY --from=0 /foo /foo }) defer server.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -1813,7 +1812,7 @@ COPY --from=0 /foo /foo }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) } @@ -2015,7 +2014,7 @@ COPY foo . def, err := echo.Marshal(sb.Context()) require.NoError(t, err) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2033,7 +2032,7 @@ COPY foo . }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "foo0", string(dt)) } @@ -2237,7 +2236,7 @@ ADD %s /dest/ err = cmd.Run() require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest/foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest/foo")) require.NoError(t, err) require.Equal(t, []byte("content1"), dt) @@ -2265,7 +2264,7 @@ ADD %s /dest/ require.NoError(t, err) destFile := filepath.Join(destDir, "dest/__unnamed__") - dt, err = ioutil.ReadFile(destFile) + dt, err = os.ReadFile(destFile) require.NoError(t, err) require.Equal(t, []byte("content2"), dt) @@ -2315,7 +2314,7 @@ ADD t.tar / cmd := sb.Cmd(args + fmt.Sprintf(" --exporter=local --exporter-opt output=%s", destDir)) require.NoError(t, cmd.Run()) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, expectedContent, dt) @@ -2349,7 +2348,7 @@ ADD t.tar.gz / cmd = sb.Cmd(args + fmt.Sprintf(" --exporter=local --exporter-opt output=%s", destDir)) require.NoError(t, cmd.Run()) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, expectedContent, dt) @@ -2376,7 +2375,7 @@ COPY t.tar.gz / cmd = sb.Cmd(args + fmt.Sprintf(" --exporter=local --exporter-opt output=%s", destDir)) require.NoError(t, cmd.Run()) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "t.tar.gz")) + dt, err = os.ReadFile(filepath.Join(destDir, "t.tar.gz")) require.NoError(t, err) require.Equal(t, buf2.Bytes(), dt) @@ -2412,7 +2411,7 @@ ADD %s / cmd = sb.Cmd(args + fmt.Sprintf(" --exporter=local --exporter-opt output=%s", destDir)) require.NoError(t, cmd.Run()) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "t.tar.gz")) + dt, err = os.ReadFile(filepath.Join(destDir, "t.tar.gz")) require.NoError(t, err) require.Equal(t, buf2.Bytes(), dt) @@ -2438,7 +2437,7 @@ ADD %s /newname.tar.gz cmd = sb.Cmd(args + fmt.Sprintf(" --exporter=local --exporter-opt output=%s", destDir)) require.NoError(t, cmd.Run()) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "newname.tar.gz")) + dt, err = os.ReadFile(filepath.Join(destDir, "newname.tar.gz")) require.NoError(t, err) require.Equal(t, buf2.Bytes(), dt) } @@ -2489,7 +2488,7 @@ ADD *.tar /dest require.NoError(t, err) defer os.RemoveAll(dir) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2511,11 +2510,11 @@ ADD *.tar /dest }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest/foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest/foo")) require.NoError(t, err) require.Equal(t, "content0", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "dest/bar")) + dt, err = os.ReadFile(filepath.Join(destDir, "dest/bar")) require.NoError(t, err) require.Equal(t, "content1", string(dt)) } @@ -2597,7 +2596,7 @@ COPY foo /symlink/ cmd := sb.Cmd(args + fmt.Sprintf(" --exporter=local --exporter-opt output=%s", destDir)) require.NoError(t, cmd.Run()) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "tmp/symlink-target/foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "tmp/symlink-target/foo")) require.NoError(t, err) require.Equal(t, expectedContent, dt) } @@ -2775,7 +2774,7 @@ Dockerfile require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -2793,7 +2792,7 @@ Dockerfile }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) @@ -2813,7 +2812,7 @@ Dockerfile require.Error(t, err) require.True(t, errors.Is(err, os.ErrNotExist)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "bay")) + dt, err = os.ReadFile(filepath.Join(destDir, "bay")) require.NoError(t, err) require.Equal(t, "bay-contents", string(dt)) } @@ -3037,7 +3036,7 @@ USER nobody require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3055,11 +3054,11 @@ USER nobody }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "rootuser")) + dt, err := os.ReadFile(filepath.Join(destDir, "rootuser")) require.NoError(t, err) require.Equal(t, "root\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "daemonuser")) + dt, err = os.ReadFile(filepath.Join(destDir, "daemonuser")) require.NoError(t, err) require.Equal(t, "daemon\n", string(dt)) @@ -3140,7 +3139,7 @@ COPY --from=base /out / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3162,15 +3161,15 @@ COPY --from=base /out / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "fooowner")) + dt, err := os.ReadFile(filepath.Join(destDir, "fooowner")) require.NoError(t, err) require.Equal(t, "daemon daemon\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subowner")) + dt, err = os.ReadFile(filepath.Join(destDir, "subowner")) require.NoError(t, err) require.Equal(t, "1000 nobody\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foobisowner")) + dt, err = os.ReadFile(filepath.Join(destDir, "foobisowner")) require.NoError(t, err) require.Equal(t, "1000 nobody\n", string(dt)) } @@ -3207,7 +3206,7 @@ COPY --from=base /out / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3233,15 +3232,15 @@ COPY --from=base /out / } require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "fooperm")) + dt, err := os.ReadFile(filepath.Join(destDir, "fooperm")) require.NoError(t, err) require.Equal(t, "0644\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "barperm")) + dt, err = os.ReadFile(filepath.Join(destDir, "barperm")) require.NoError(t, err) require.Equal(t, "0777\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foobisperm")) + dt, err = os.ReadFile(filepath.Join(destDir, "foobisperm")) require.NoError(t, err) require.Equal(t, "0000\n", string(dt)) } @@ -3275,7 +3274,7 @@ COPY files dest require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3296,11 +3295,11 @@ COPY files dest }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "sub/dir1/dir2/foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "sub/dir1/dir2/foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "dest/foo.go")) + dt, err = os.ReadFile(filepath.Join(destDir, "dest/foo.go")) require.NoError(t, err) require.Equal(t, "foo.go-contents", string(dt)) } @@ -3327,7 +3326,7 @@ COPY $FOO baz require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3348,7 +3347,7 @@ COPY $FOO baz }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "baz")) + dt, err := os.ReadFile(filepath.Join(destDir, "baz")) require.NoError(t, err) require.Equal(t, "bar-contents", string(dt)) } @@ -3386,7 +3385,7 @@ COPY sub/dir1 subdest6 require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3407,45 +3406,45 @@ COPY sub/dir1 subdest6 }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "gofiles/foo.go")) + dt, err := os.ReadFile(filepath.Join(destDir, "gofiles/foo.go")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "gofiles/bar.go")) + dt, err = os.ReadFile(filepath.Join(destDir, "gofiles/bar.go")) require.NoError(t, err) require.Equal(t, "bar-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foo2.go")) + dt, err = os.ReadFile(filepath.Join(destDir, "foo2.go")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) if isFileOp { // non-fileop implementation is historically buggy - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subdest/dir2/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "subdest/dir2/foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) } - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subdest2/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "subdest2/foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subdest3/bar")) + dt, err = os.ReadFile(filepath.Join(destDir, "subdest3/bar")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "all/foo.go")) + dt, err = os.ReadFile(filepath.Join(destDir, "all/foo.go")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subdest4/dir2/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "subdest4/dir2/foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subdest5/dir2/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "subdest5/dir2/foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "subdest6/dir2/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "subdest6/dir2/foo")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) } @@ -3555,7 +3554,7 @@ COPY --from=build /dest /dest }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "dest")) + dt, err := os.ReadFile(filepath.Join(destDir, "dest")) require.NoError(t, err) require.Equal(t, []byte("0644\n0755\n0413\n"), dt) } @@ -3563,7 +3562,7 @@ COPY --from=build /dest /dest func testDockerfileFromGit(t *testing.T, sb integration.Sandbox) { f := getFrontend(t, sb) - gitDir, err := ioutil.TempDir("", "buildkit") + gitDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(gitDir) @@ -3574,7 +3573,7 @@ FROM scratch COPY --from=build foo bar ` - err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte(dockerfile), 0600) + err = os.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte(dockerfile), 0600) require.NoError(t, err) err = runShell(gitDir, @@ -3591,7 +3590,7 @@ COPY --from=build foo bar COPY --from=build foo bar2 ` - err = ioutil.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte(dockerfile), 0600) + err = os.WriteFile(filepath.Join(gitDir, "Dockerfile"), []byte(dockerfile), 0600) require.NoError(t, err) err = runShell(gitDir, @@ -3604,7 +3603,7 @@ COPY --from=build foo bar2 server := httptest.NewServer(http.FileServer(http.Dir(filepath.Join(gitDir)))) defer server.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3625,7 +3624,7 @@ COPY --from=build foo bar2 }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, "fromgit", string(dt)) @@ -3634,7 +3633,7 @@ COPY --from=build foo bar2 require.True(t, errors.Is(err, os.ErrNotExist)) // second request from master branch contains both files - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3651,11 +3650,11 @@ COPY --from=build foo bar2 }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err = os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, "fromgit", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "bar2")) + dt, err = os.ReadFile(filepath.Join(destDir, "bar2")) require.NoError(t, err) require.Equal(t, "fromgit", string(dt)) } @@ -3696,7 +3695,7 @@ COPY foo bar }) defer server.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3718,7 +3717,7 @@ COPY foo bar }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, "foo-contents", string(dt)) } @@ -3741,7 +3740,7 @@ COPY --from=busybox /etc/passwd test require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3759,7 +3758,7 @@ COPY --from=busybox /etc/passwd test }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "test")) + dt, err := os.ReadFile(filepath.Join(destDir, "test")) require.NoError(t, err) require.Contains(t, string(dt), "root") @@ -3779,7 +3778,7 @@ COPY --from=golang /usr/bin/go go require.NoError(t, err) defer os.RemoveAll(dir) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3797,7 +3796,7 @@ COPY --from=golang /usr/bin/go go }, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "go")) + dt, err = os.ReadFile(filepath.Join(destDir, "go")) require.NoError(t, err) require.Contains(t, string(dt), "foo") } @@ -3824,7 +3823,7 @@ COPY --from=stage1 baz bax require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3845,7 +3844,7 @@ COPY --from=stage1 baz bax }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "baz")) + dt, err := os.ReadFile(filepath.Join(destDir, "baz")) require.NoError(t, err) require.Contains(t, string(dt), "foo-contents") } @@ -3868,7 +3867,7 @@ LABEL foo=bar require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -3945,7 +3944,7 @@ RUN ls /files/file1 require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4055,7 +4054,7 @@ ONBUILD RUN mkdir -p /out && echo -n 11 >> /out/foo require.NoError(t, err) defer os.RemoveAll(dir) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4073,7 +4072,7 @@ ONBUILD RUN mkdir -p /out && echo -n 11 >> /out/foo }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "11", string(dt)) } @@ -4232,7 +4231,7 @@ COPY --from=base unique / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4258,16 +4257,16 @@ COPY --from=base unique / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "const")) + dt, err := os.ReadFile(filepath.Join(destDir, "const")) require.NoError(t, err) require.Equal(t, "foobar", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt, err = os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) ensurePruneAll(t, c, sb) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4288,15 +4287,15 @@ COPY --from=base unique / }, nil) require.NoError(t, err) - dt2, err := ioutil.ReadFile(filepath.Join(destDir, "const")) + dt2, err := os.ReadFile(filepath.Join(destDir, "const")) require.NoError(t, err) require.Equal(t, "foobar", string(dt2)) - dt2, err = ioutil.ReadFile(filepath.Join(destDir, "unique")) + dt2, err = os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) require.Equal(t, string(dt), string(dt2)) - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) } @@ -4322,7 +4321,7 @@ RUN echo bar > bar require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4403,7 +4402,7 @@ RUN echo bar > bar require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4484,7 +4483,7 @@ COPY --from=s1 unique2 / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4505,7 +4504,7 @@ COPY --from=s1 unique2 / _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - destDir2, err := ioutil.TempDir("", "buildkit") + destDir2, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4515,22 +4514,22 @@ COPY --from=s1 unique2 / _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - unique1Dir1, err := ioutil.ReadFile(filepath.Join(destDir, "unique")) + unique1Dir1, err := os.ReadFile(filepath.Join(destDir, "unique")) require.NoError(t, err) - unique1Dir2, err := ioutil.ReadFile(filepath.Join(destDir2, "unique")) + unique1Dir2, err := os.ReadFile(filepath.Join(destDir2, "unique")) require.NoError(t, err) - unique2Dir1, err := ioutil.ReadFile(filepath.Join(destDir, "unique2")) + unique2Dir1, err := os.ReadFile(filepath.Join(destDir, "unique2")) require.NoError(t, err) - unique2Dir2, err := ioutil.ReadFile(filepath.Join(destDir2, "unique2")) + unique2Dir2, err := os.ReadFile(filepath.Join(destDir2, "unique2")) require.NoError(t, err) require.NotEqual(t, string(unique1Dir1), string(unique1Dir2)) require.NotEqual(t, string(unique2Dir1), string(unique2Dir2)) - destDir3, err := ioutil.TempDir("", "buildkit") + destDir3, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4540,10 +4539,10 @@ COPY --from=s1 unique2 / _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - unique1Dir3, err := ioutil.ReadFile(filepath.Join(destDir3, "unique")) + unique1Dir3, err := os.ReadFile(filepath.Join(destDir3, "unique")) require.NoError(t, err) - unique2Dir3, err := ioutil.ReadFile(filepath.Join(destDir3, "unique2")) + unique2Dir3, err := os.ReadFile(filepath.Join(destDir3, "unique2")) require.NoError(t, err) require.Equal(t, string(unique1Dir2), string(unique1Dir3)) @@ -4572,7 +4571,7 @@ COPY foo2 bar2 require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4592,11 +4591,11 @@ COPY foo2 bar2 _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, "d0", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "bar2")) + dt, err = os.ReadFile(filepath.Join(destDir, "bar2")) require.NoError(t, err) require.Equal(t, "d1", string(dt)) } @@ -4623,7 +4622,7 @@ COPY --from=build out . require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4647,11 +4646,11 @@ COPY --from=build out . _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "platform")) + dt, err := os.ReadFile(filepath.Join(destDir, "platform")) require.NoError(t, err) require.Equal(t, "darwin/ppc64le", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "os")) + dt, err = os.ReadFile(filepath.Join(destDir, "os")) require.NoError(t, err) require.Equal(t, "freebsd", string(dt)) } @@ -4679,7 +4678,7 @@ COPY --from=build /out / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4704,12 +4703,12 @@ COPY --from=build /out / _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, "hpvalue::npvalue::foocontents::::bazcontent", string(dt)) // repeat with changed default args should match the old cache - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4733,12 +4732,12 @@ COPY --from=build /out / _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err = os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, "hpvalue::npvalue::foocontents::::bazcontent", string(dt)) // changing actual value invalidates cache - destDir, err = ioutil.TempDir("", "buildkit") + destDir, err = os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4762,7 +4761,7 @@ COPY --from=build /out / _, err = f.Solve(sb.Context(), c, opt, nil) require.NoError(t, err) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err = os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, "hpvalue2::::foocontents2::::bazcontent", string(dt)) } @@ -4856,7 +4855,7 @@ COPY foo bar url := up.Add(buf) // repeat with changed default args should match the old cache - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4880,7 +4879,7 @@ COPY foo bar }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar")) require.NoError(t, err) require.Equal(t, string(dt), "contents") } @@ -4933,7 +4932,7 @@ COPY foo foo2 }) } - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4951,7 +4950,7 @@ COPY foo foo2 }, "", frontend, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "foo3")) + dt, err := os.ReadFile(filepath.Join(destDir, "foo3")) require.NoError(t, err) require.Equal(t, dt, []byte("data")) } @@ -4963,7 +4962,7 @@ func testFrontendInputs(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -4984,7 +4983,7 @@ func testFrontendInputs(t *testing.T, sb integration.Sandbox) { }, nil) require.NoError(t, err) - expected, err := ioutil.ReadFile(filepath.Join(destDir, "foo")) + expected, err := os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) dockerfile := []byte(` @@ -5014,7 +5013,7 @@ COPY foo foo2 }, nil) require.NoError(t, err) - actual, err := ioutil.ReadFile(filepath.Join(destDir, "foo2")) + actual, err := os.ReadFile(filepath.Join(destDir, "foo2")) require.NoError(t, err) require.Equal(t, expected, actual) } @@ -5176,7 +5175,7 @@ COPY --from=base /shmsize / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5197,7 +5196,7 @@ COPY --from=base /shmsize / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "shmsize")) + dt, err := os.ReadFile(filepath.Join(destDir, "shmsize")) require.NoError(t, err) require.Contains(t, string(dt), `size=131072k`) } @@ -5221,7 +5220,7 @@ COPY --from=base /ulimit / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5242,7 +5241,7 @@ COPY --from=base /ulimit / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "ulimit")) + dt, err := os.ReadFile(filepath.Join(destDir, "ulimit")) require.NoError(t, err) require.Equal(t, `1062`, strings.TrimSpace(string(dt))) } @@ -5270,7 +5269,7 @@ COPY --from=base /out / require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5291,7 +5290,7 @@ COPY --from=base /out / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Contains(t, strings.TrimSpace(string(dt)), `/foocgroup/buildkit/`) } @@ -5318,7 +5317,7 @@ COPY --from=base /out / f := getFrontend(t, sb) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5340,7 +5339,7 @@ COPY --from=base /out / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.True(t, len(dt) > 0) @@ -5625,7 +5624,7 @@ COPY --from=base /o* / f := getFrontend(t, sb) - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5647,11 +5646,11 @@ COPY --from=base /o* / }, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.True(t, len(dt) > 0) - _, err = ioutil.ReadFile(filepath.Join(destDir, "out2")) + _, err = os.ReadFile(filepath.Join(destDir, "out2")) require.Error(t, err) require.True(t, errors.Is(err, os.ErrNotExist)) } @@ -5739,7 +5738,7 @@ COPY --from=build /foo /out / product := "buildkit_test" - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5758,11 +5757,11 @@ COPY --from=build /foo /out / }, product, b, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "out")) + dt, err := os.ReadFile(filepath.Join(destDir, "out")) require.NoError(t, err) require.Equal(t, "first\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "foo")) require.NoError(t, err) require.Equal(t, "foo is bar\n", string(dt)) } @@ -5881,7 +5880,7 @@ COPY --from=build /foo /out / product := "buildkit_test" - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -5900,25 +5899,25 @@ COPY --from=build /foo /out / }, product, b, nil) require.NoError(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "linux_amd64/out")) + dt, err := os.ReadFile(filepath.Join(destDir, "linux_amd64/out")) require.NoError(t, err) require.Equal(t, "foo amd64\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "linux_amd64/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "linux_amd64/foo")) require.NoError(t, err) require.Equal(t, "foo is bar-amd64\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "linux_arm64/out")) + dt, err = os.ReadFile(filepath.Join(destDir, "linux_arm64/out")) require.NoError(t, err) require.Equal(t, "foo arm64\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(destDir, "linux_arm64/foo")) + dt, err = os.ReadFile(filepath.Join(destDir, "linux_arm64/foo")) require.NoError(t, err) require.Equal(t, "foo is bar-arm64\n", string(dt)) } func tmpdir(appliers ...fstest.Applier) (string, error) { - tmpdir, err := ioutil.TempDir("", "buildkit-dockerfile") + tmpdir, err := os.MkdirTemp("", "buildkit-dockerfile") if err != nil { return "", err } diff --git a/frontend/dockerfile/dockerignore/dockerignore_test.go b/frontend/dockerfile/dockerignore/dockerignore_test.go index 40824367a762..7327c268f234 100644 --- a/frontend/dockerfile/dockerignore/dockerignore_test.go +++ b/frontend/dockerfile/dockerignore/dockerignore_test.go @@ -2,14 +2,13 @@ package dockerignore import ( "fmt" - "io/ioutil" "os" "path/filepath" "testing" ) func TestReadAll(t *testing.T) { - tmpDir, err := ioutil.TempDir("", "dockerignore-test") + tmpDir, err := os.MkdirTemp("", "dockerignore-test") if err != nil { t.Fatal(err) } @@ -26,7 +25,7 @@ func TestReadAll(t *testing.T) { diName := filepath.Join(tmpDir, ".dockerignore") content := fmt.Sprintf("test1\n/test2\n/a/file/here\n\nlastfile\n# this is a comment\n! /inverted/abs/path\n!\n! \n") - err = ioutil.WriteFile(diName, []byte(content), 0777) + err = os.WriteFile(diName, []byte(content), 0777) if err != nil { t.Fatal(err) } diff --git a/frontend/dockerfile/parser/parser_test.go b/frontend/dockerfile/parser/parser_test.go index 676188f1ea5f..70ae7e64b559 100644 --- a/frontend/dockerfile/parser/parser_test.go +++ b/frontend/dockerfile/parser/parser_test.go @@ -4,7 +4,6 @@ import ( "bufio" "bytes" "fmt" - "io/ioutil" "os" "path/filepath" "runtime" @@ -56,7 +55,7 @@ func TestParseCases(t *testing.T) { result, err := Parse(df) require.NoError(t, err, dockerfile) - content, err := ioutil.ReadFile(resultfile) + content, err := os.ReadFile(resultfile) require.NoError(t, err, resultfile) if runtime.GOOS == "windows" { diff --git a/frontend/frontend_test.go b/frontend/frontend_test.go index 29a77f03482f..8d8903019b85 100644 --- a/frontend/frontend_test.go +++ b/frontend/frontend_test.go @@ -2,7 +2,6 @@ package frontend import ( "context" - "io/ioutil" "os" "path/filepath" "testing" @@ -43,7 +42,7 @@ func testReturnNil(t *testing.T, sb integration.Sandbox) { require.NoError(t, err) defer c.Close() - destDir, err := ioutil.TempDir("", "buildkit") + destDir, err := os.MkdirTemp("", "buildkit") require.NoError(t, err) defer os.RemoveAll(destDir) @@ -297,7 +296,7 @@ func testRefStatFile(t *testing.T, sb integration.Sandbox) { } func tmpdir(appliers ...fstest.Applier) (string, error) { - tmpdir, err := ioutil.TempDir("", "buildkit-frontend") + tmpdir, err := os.MkdirTemp("", "buildkit-frontend") if err != nil { return "", err } diff --git a/session/auth/authprovider/tokenseed.go b/session/auth/authprovider/tokenseed.go index d626e5989c30..0fdcea4c3968 100644 --- a/session/auth/authprovider/tokenseed.go +++ b/session/auth/authprovider/tokenseed.go @@ -3,7 +3,6 @@ package authprovider import ( "crypto/rand" "encoding/json" - "io/ioutil" "os" "path/filepath" "sync" @@ -47,7 +46,7 @@ func (ts *tokenSeeds) getSeed(host string) ([]byte, error) { fp := filepath.Join(ts.dir, ".token_seed") // we include client side randomness to avoid chosen plaintext attack from the daemon side - dt, err := ioutil.ReadFile(fp) + dt, err := os.ReadFile(fp) if err != nil { if !errors.Is(err, os.ErrNotExist) && !errors.Is(err, syscall.ENOTDIR) && !errors.Is(err, os.ErrPermission) { return nil, err @@ -68,7 +67,7 @@ func (ts *tokenSeeds) getSeed(host string) ([]byte, error) { return nil, err } - if err := ioutil.WriteFile(fp, dt, 0600); err != nil { + if err := os.WriteFile(fp, dt, 0600); err != nil { if !errors.Is(err, syscall.EROFS) && !errors.Is(err, os.ErrPermission) { return nil, err } diff --git a/session/content/content_test.go b/session/content/content_test.go index 65960ac6360b..549292b14202 100644 --- a/session/content/content_test.go +++ b/session/content/content_test.go @@ -2,7 +2,6 @@ package content import ( "context" - "io/ioutil" "os" "testing" @@ -24,7 +23,7 @@ func TestContentAttachable(t *testing.T) { attachableStores := make(map[string]content.Store) testBlobs := make(map[string]map[digest.Digest][]byte) for _, id := range ids { - tmpDir, err := ioutil.TempDir("", "contenttest") + tmpDir, err := os.MkdirTemp("", "contenttest") require.NoError(t, err) defer os.RemoveAll(tmpDir) store, err := local.NewStore(tmpDir) diff --git a/session/filesync/filesync_test.go b/session/filesync/filesync_test.go index b569d173166c..b80cb7ccbff9 100644 --- a/session/filesync/filesync_test.go +++ b/session/filesync/filesync_test.go @@ -2,7 +2,7 @@ package filesync import ( "context" - "io/ioutil" + "os" "path/filepath" "testing" @@ -16,16 +16,16 @@ import ( func TestFileSyncIncludePatterns(t *testing.T) { ctx := context.TODO() t.Parallel() - tmpDir, err := ioutil.TempDir("", "fsynctest") + tmpDir, err := os.MkdirTemp("", "fsynctest") require.NoError(t, err) - destDir, err := ioutil.TempDir("", "fsynctest") + destDir, err := os.MkdirTemp("", "fsynctest") require.NoError(t, err) - err = ioutil.WriteFile(filepath.Join(tmpDir, "foo"), []byte("content1"), 0600) + err = os.WriteFile(filepath.Join(tmpDir, "foo"), []byte("content1"), 0600) require.NoError(t, err) - err = ioutil.WriteFile(filepath.Join(tmpDir, "bar"), []byte("content2"), 0600) + err = os.WriteFile(filepath.Join(tmpDir, "bar"), []byte("content2"), 0600) require.NoError(t, err) s, err := session.NewSession(ctx, "foo", "bar") @@ -58,10 +58,10 @@ func TestFileSyncIncludePatterns(t *testing.T) { return err } - _, err = ioutil.ReadFile(filepath.Join(destDir, "foo")) + _, err = os.ReadFile(filepath.Join(destDir, "foo")) assert.Error(t, err) - dt, err := ioutil.ReadFile(filepath.Join(destDir, "bar")) + dt, err := os.ReadFile(filepath.Join(destDir, "bar")) if err != nil { return err } diff --git a/session/secrets/secretsprovider/store.go b/session/secrets/secretsprovider/store.go index 3a846f84e2b9..922036aed67b 100644 --- a/session/secrets/secretsprovider/store.go +++ b/session/secrets/secretsprovider/store.go @@ -2,7 +2,6 @@ package secretsprovider import ( "context" - "io/ioutil" "os" "github.com/moby/buildkit/session/secrets" @@ -57,7 +56,7 @@ func (fs *fileStore) GetSecret(ctx context.Context, id string) ([]byte, error) { if v.Env != "" { return []byte(os.Getenv(v.Env)), nil } - dt, err := ioutil.ReadFile(v.FilePath) + dt, err := os.ReadFile(v.FilePath) if err != nil { return nil, err } diff --git a/session/sshforward/ssh.go b/session/sshforward/ssh.go index a7a4c2e228a3..42307d4f6ab9 100644 --- a/session/sshforward/ssh.go +++ b/session/sshforward/ssh.go @@ -1,7 +1,6 @@ package sshforward import ( - "io/ioutil" "net" "os" "path/filepath" @@ -64,7 +63,7 @@ type SocketOpt struct { } func MountSSHSocket(ctx context.Context, c session.Caller, opt SocketOpt) (sockPath string, closer func() error, err error) { - dir, err := ioutil.TempDir("", ".buildkit-ssh-sock") + dir, err := os.MkdirTemp("", ".buildkit-ssh-sock") if err != nil { return "", nil, errors.WithStack(err) } diff --git a/session/sshforward/sshprovider/agentprovider.go b/session/sshforward/sshprovider/agentprovider.go index 981eb96f5628..f6501113d710 100644 --- a/session/sshforward/sshprovider/agentprovider.go +++ b/session/sshforward/sshprovider/agentprovider.go @@ -3,7 +3,6 @@ package sshprovider import ( "context" "io" - "io/ioutil" "net" "os" "runtime" @@ -166,7 +165,7 @@ func toAgentSource(paths []string) (source, error) { if err != nil { return source{}, errors.Wrapf(err, "failed to open %s", p) } - dt, err := ioutil.ReadAll(&io.LimitedReader{R: f, N: 100 * 1024}) + dt, err := io.ReadAll(&io.LimitedReader{R: f, N: 100 * 1024}) if err != nil { return source{}, errors.Wrapf(err, "failed to read %s", p) } diff --git a/snapshot/localmounter_unix.go b/snapshot/localmounter_unix.go index ef73e263fc91..27cff3ebdf8c 100644 --- a/snapshot/localmounter_unix.go +++ b/snapshot/localmounter_unix.go @@ -4,7 +4,6 @@ package snapshot import ( - "io/ioutil" "os" "syscall" @@ -38,7 +37,7 @@ func (lm *localMounter) Mount() (string, error) { } } - dir, err := ioutil.TempDir("", "buildkit-mount") + dir, err := os.MkdirTemp("", "buildkit-mount") if err != nil { return "", errors.Wrap(err, "failed to create temp dir") } diff --git a/snapshot/snapshotter_test.go b/snapshot/snapshotter_test.go index c2eb0577fabf..e625d8a3a62e 100644 --- a/snapshot/snapshotter_test.go +++ b/snapshot/snapshotter_test.go @@ -6,7 +6,6 @@ package snapshot import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -48,7 +47,7 @@ func newSnapshotter(ctx context.Context, snapshotterName string) (_ context.Cont } }() - tmpdir, err := ioutil.TempDir("", "buildkit-test") + tmpdir, err := os.MkdirTemp("", "buildkit-test") if err != nil { return nil, nil, nil, err } diff --git a/solver/bboltcachestorage/storage_test.go b/solver/bboltcachestorage/storage_test.go index 5e72c889b47d..dd98a486c034 100644 --- a/solver/bboltcachestorage/storage_test.go +++ b/solver/bboltcachestorage/storage_test.go @@ -1,7 +1,6 @@ package bboltcachestorage import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -13,7 +12,7 @@ import ( func TestBoltCacheStorage(t *testing.T) { testutil.RunCacheStorageTests(t, func() (solver.CacheKeyStorage, func()) { - tmpDir, err := ioutil.TempDir("", "storage") + tmpDir, err := os.MkdirTemp("", "storage") require.NoError(t, err) cleanup := func() { diff --git a/solver/jobs_test.go b/solver/jobs_test.go index 091bd2f8e927..880c605ee160 100644 --- a/solver/jobs_test.go +++ b/solver/jobs_test.go @@ -1,7 +1,6 @@ package solver import ( - "io/ioutil" "os" "testing" "time" @@ -62,7 +61,7 @@ func testParallelism(t *testing.T, sb integration.Sandbox) { timeStart := time.Now() eg, egCtx := errgroup.WithContext(ctx) - tmpDir, err := ioutil.TempDir("", "solver-jobs-test-") + tmpDir, err := os.MkdirTemp("", "solver-jobs-test-") require.NoError(t, err) defer os.RemoveAll(tmpDir) solveOpt := client.SolveOpt{ diff --git a/solver/llbsolver/file/backend.go b/solver/llbsolver/file/backend.go index 732e67474144..974c2e04e877 100644 --- a/solver/llbsolver/file/backend.go +++ b/solver/llbsolver/file/backend.go @@ -2,7 +2,6 @@ package file import ( "context" - "io/ioutil" "log" "os" "path/filepath" @@ -110,7 +109,7 @@ func mkfile(ctx context.Context, d string, action pb.FileActionMkFile, user *cop return err } - if err := ioutil.WriteFile(p, action.Data, os.FileMode(action.Mode)&0777); err != nil { + if err := os.WriteFile(p, action.Data, os.FileMode(action.Mode)&0777); err != nil { return err } diff --git a/solver/llbsolver/mounts/mount.go b/solver/llbsolver/mounts/mount.go index ffa4df5da367..dd758aecdac8 100644 --- a/solver/llbsolver/mounts/mount.go +++ b/solver/llbsolver/mounts/mount.go @@ -3,7 +3,6 @@ package mounts import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "sync" @@ -282,7 +281,7 @@ type secretMountInstance struct { } func (sm *secretMountInstance) Mount() ([]mount.Mount, func() error, error) { - dir, err := ioutil.TempDir("", "buildkit-secrets") + dir, err := os.MkdirTemp("", "buildkit-secrets") if err != nil { return nil, nil, errors.Wrap(err, "failed to create temp dir") } @@ -320,7 +319,7 @@ func (sm *secretMountInstance) Mount() ([]mount.Mount, func() error, error) { randID := identity.NewID() fp := filepath.Join(dir, randID) - if err := ioutil.WriteFile(fp, sm.sm.data, 0600); err != nil { + if err := os.WriteFile(fp, sm.sm.data, 0600); err != nil { cleanup() return nil, nil, err } diff --git a/solver/llbsolver/mounts/mount_test.go b/solver/llbsolver/mounts/mount_test.go index 7469aef55861..ed3861356a95 100644 --- a/solver/llbsolver/mounts/mount_test.go +++ b/solver/llbsolver/mounts/mount_test.go @@ -2,7 +2,6 @@ package mounts import ( "context" - "io/ioutil" "os" "path/filepath" "sync" @@ -53,7 +52,7 @@ func newCacheManager(ctx context.Context, opt cmOpt) (co *cmOut, cleanup func() opt.snapshotterName = "native" } - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") if err != nil { return nil, nil, err } @@ -153,7 +152,7 @@ func TestCacheMountPrivateRefs(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -220,7 +219,7 @@ func TestCacheMountSharedRefs(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -270,7 +269,7 @@ func TestCacheMountLockedRefs(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -333,7 +332,7 @@ func TestCacheMountSharedRefsDeadlock(t *testing.T) { // not parallel ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "cachemanager") + tmpdir, err := os.MkdirTemp("", "cachemanager") require.NoError(t, err) defer os.RemoveAll(tmpdir) diff --git a/solver/llbsolver/ops/exec_binfmt.go b/solver/llbsolver/ops/exec_binfmt.go index 56433d49fdec..829e84205950 100644 --- a/solver/llbsolver/ops/exec_binfmt.go +++ b/solver/llbsolver/ops/exec_binfmt.go @@ -2,7 +2,6 @@ package ops import ( "context" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -47,7 +46,7 @@ type staticEmulatorMount struct { } func (m *staticEmulatorMount) Mount() ([]mount.Mount, func() error, error) { - tmpdir, err := ioutil.TempDir("", "buildkit-qemu-emulator") + tmpdir, err := os.MkdirTemp("", "buildkit-qemu-emulator") if err != nil { return nil, nil, err } diff --git a/source/git/gitsource.go b/source/git/gitsource.go index 9169992f7ad9..5f11b04e94f8 100644 --- a/source/git/gitsource.go +++ b/source/git/gitsource.go @@ -6,7 +6,6 @@ import ( "encoding/base64" "fmt" "io" - "io/ioutil" "net/url" "os" "os/exec" @@ -273,7 +272,7 @@ func (gs *gitSourceHandler) mountKnownHosts(ctx context.Context) (string, func() if gs.src.KnownSSHHosts == "" { return "", nil, errors.Errorf("no configured known hosts forwarded from the client") } - knownHosts, err := ioutil.TempFile("", "") + knownHosts, err := os.CreateTemp("", "") if err != nil { return "", nil, err } @@ -543,7 +542,7 @@ func (gs *gitSourceHandler) Snapshot(ctx context.Context, g session.Group) (out } else { cd := checkoutDir if subdir != "." { - cd, err = ioutil.TempDir(cd, "checkout") + cd, err = os.MkdirTemp(cd, "checkout") if err != nil { return nil, errors.Wrapf(err, "failed to create temporary checkout dir") } diff --git a/source/git/gitsource_test.go b/source/git/gitsource_test.go index 6af1e4a4841c..088137b42467 100644 --- a/source/git/gitsource_test.go +++ b/source/git/gitsource_test.go @@ -2,7 +2,6 @@ package git import ( "context" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -52,13 +51,13 @@ func testRepeatedFetch(t *testing.T, keepGitDir bool) { t.Parallel() ctx := context.TODO() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) gs := setupGitSource(t, tmpdir) - repodir, err := ioutil.TempDir("", "buildkit-gitsource") + repodir, err := os.MkdirTemp("", "buildkit-gitsource") require.NoError(t, err) defer os.RemoveAll(repodir) @@ -94,7 +93,7 @@ func testRepeatedFetch(t *testing.T, keepGitDir bool) { require.NoError(t, err) defer lm.Unmount() - dt, err := ioutil.ReadFile(filepath.Join(dir, "def")) + dt, err := os.ReadFile(filepath.Join(dir, "def")) require.NoError(t, err) require.Equal(t, "bar\n", string(dt)) @@ -145,12 +144,12 @@ func testRepeatedFetch(t *testing.T, keepGitDir bool) { require.NoError(t, err) defer lm.Unmount() - dt, err = ioutil.ReadFile(filepath.Join(dir, "ghi")) + dt, err = os.ReadFile(filepath.Join(dir, "ghi")) require.NoError(t, err) require.Equal(t, "baz\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(dir, "sub/subfile")) + dt, err = os.ReadFile(filepath.Join(dir, "sub/subfile")) require.NoError(t, err) require.Equal(t, "subcontents\n", string(dt)) @@ -171,13 +170,13 @@ func testFetchBySHA(t *testing.T, keepGitDir bool) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) gs := setupGitSource(t, tmpdir) - repodir, err := ioutil.TempDir("", "buildkit-gitsource") + repodir, err := os.MkdirTemp("", "buildkit-gitsource") require.NoError(t, err) defer os.RemoveAll(repodir) @@ -222,12 +221,12 @@ func testFetchBySHA(t *testing.T, keepGitDir bool) { require.NoError(t, err) defer lm.Unmount() - dt, err := ioutil.ReadFile(filepath.Join(dir, "ghi")) + dt, err := os.ReadFile(filepath.Join(dir, "ghi")) require.NoError(t, err) require.Equal(t, "baz\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(dir, "sub/subfile")) + dt, err = os.ReadFile(filepath.Join(dir, "sub/subfile")) require.NoError(t, err) require.Equal(t, "subcontents\n", string(dt)) @@ -257,13 +256,13 @@ func testFetchByTag(t *testing.T, tag, expectedCommitSubject string, isAnnotated t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) gs := setupGitSource(t, tmpdir) - repodir, err := ioutil.TempDir("", "buildkit-gitsource") + repodir, err := os.MkdirTemp("", "buildkit-gitsource") require.NoError(t, err) defer os.RemoveAll(repodir) @@ -299,11 +298,11 @@ func testFetchByTag(t *testing.T, tag, expectedCommitSubject string, isAnnotated require.NoError(t, err) defer lm.Unmount() - dt, err := ioutil.ReadFile(filepath.Join(dir, "def")) + dt, err := os.ReadFile(filepath.Join(dir, "def")) require.NoError(t, err) require.Equal(t, "bar\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(dir, "foo13")) + dt, err = os.ReadFile(filepath.Join(dir, "foo13")) if hasFoo13File { require.Nil(t, err) require.Equal(t, "sbb\n", string(dt)) @@ -351,20 +350,20 @@ func testMultipleRepos(t *testing.T, keepGitDir bool) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) gs := setupGitSource(t, tmpdir) - repodir, err := ioutil.TempDir("", "buildkit-gitsource") + repodir, err := os.MkdirTemp("", "buildkit-gitsource") require.NoError(t, err) defer os.RemoveAll(repodir) repodir, err = setupGitRepo(repodir) require.NoError(t, err) - repodir2, err := ioutil.TempDir("", "buildkit-gitsource") + repodir2, err := os.MkdirTemp("", "buildkit-gitsource") require.NoError(t, err) defer os.RemoveAll(repodir2) @@ -429,12 +428,12 @@ func testMultipleRepos(t *testing.T, keepGitDir bool) { require.NoError(t, err) defer lm.Unmount() - dt, err := ioutil.ReadFile(filepath.Join(dir, "def")) + dt, err := os.ReadFile(filepath.Join(dir, "def")) require.NoError(t, err) require.Equal(t, "bar\n", string(dt)) - dt, err = ioutil.ReadFile(filepath.Join(dir2, "xyz")) + dt, err = os.ReadFile(filepath.Join(dir2, "xyz")) require.NoError(t, err) require.Equal(t, "xyz\n", string(dt)) @@ -448,7 +447,7 @@ func TestCredentialRedaction(t *testing.T) { t.Parallel() ctx := namespaces.WithNamespace(context.Background(), "buildkit-test") - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -480,13 +479,13 @@ func testSubdir(t *testing.T, keepGitDir bool) { t.Parallel() ctx := context.TODO() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) gs := setupGitSource(t, tmpdir) - repodir, err := ioutil.TempDir("", "buildkit-gitsource") + repodir, err := os.MkdirTemp("", "buildkit-gitsource") require.NoError(t, err) defer os.RemoveAll(repodir) @@ -531,12 +530,12 @@ func testSubdir(t *testing.T, keepGitDir bool) { require.NoError(t, err) defer lm.Unmount() - fis, err := ioutil.ReadDir(dir) + fis, err := os.ReadDir(dir) require.NoError(t, err) require.Equal(t, 1, len(fis)) - dt, err := ioutil.ReadFile(filepath.Join(dir, "bar")) + dt, err := os.ReadFile(filepath.Join(dir, "bar")) require.NoError(t, err) require.Equal(t, "abc\n", string(dt)) diff --git a/source/http/httpsource_test.go b/source/http/httpsource_test.go index a8f90949fd9a..5066d8cb3cff 100644 --- a/source/http/httpsource_test.go +++ b/source/http/httpsource_test.go @@ -2,7 +2,6 @@ package http import ( "context" - "io/ioutil" "os" "path/filepath" "runtime" @@ -36,7 +35,7 @@ func TestHTTPSource(t *testing.T) { t.Parallel() ctx := context.TODO() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -159,7 +158,7 @@ func TestHTTPDefaultName(t *testing.T) { t.Parallel() ctx := context.TODO() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -209,7 +208,7 @@ func TestHTTPInvalidURL(t *testing.T) { t.Parallel() ctx := context.TODO() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -237,7 +236,7 @@ func TestHTTPChecksum(t *testing.T) { t.Parallel() ctx := context.TODO() - tmpdir, err := ioutil.TempDir("", "buildkit-state") + tmpdir, err := os.MkdirTemp("", "buildkit-state") require.NoError(t, err) defer os.RemoveAll(tmpdir) @@ -328,7 +327,7 @@ func readFile(ctx context.Context, ref cache.ImmutableRef, fp string) ([]byte, e defer lm.Unmount() - dt, err := ioutil.ReadFile(filepath.Join(dir, fp)) + dt, err := os.ReadFile(filepath.Join(dir, fp)) if err != nil { return nil, err } diff --git a/util/archutil/check_unix.go b/util/archutil/check_unix.go index 8b558a31765f..f6f90589fc1d 100644 --- a/util/archutil/check_unix.go +++ b/util/archutil/check_unix.go @@ -7,7 +7,6 @@ import ( "bytes" "compress/gzip" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -23,7 +22,7 @@ func withChroot(cmd *exec.Cmd, dir string) { } func check(arch, bin string) (string, error) { - tmpdir, err := ioutil.TempDir("", "qemu-check") + tmpdir, err := os.MkdirTemp("", "qemu-check") if err != nil { return "", err } diff --git a/util/contentutil/buffer.go b/util/contentutil/buffer.go index 31d2be6867ff..7555fb4792c4 100644 --- a/util/contentutil/buffer.go +++ b/util/contentutil/buffer.go @@ -3,7 +3,7 @@ package contentutil import ( "bytes" "context" - "io/ioutil" + "io" "sync" "time" @@ -64,7 +64,7 @@ func (b *buffer) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (conten if err != nil { return nil, err } - return &readerAt{Reader: r, Closer: ioutil.NopCloser(r), size: int64(r.Len())}, nil + return &readerAt{Reader: r, Closer: io.NopCloser(r), size: int64(r.Len())}, nil } func (b *buffer) getBytesReader(ctx context.Context, dgst digest.Digest) (*bytes.Reader, error) { diff --git a/util/imageutil/schema1.go b/util/imageutil/schema1.go index 10838bf50d9a..e2dc1440a71e 100644 --- a/util/imageutil/schema1.go +++ b/util/imageutil/schema1.go @@ -3,7 +3,7 @@ package imageutil import ( "context" "encoding/json" - "io/ioutil" + "io" "strings" "time" @@ -19,7 +19,7 @@ func readSchema1Config(ctx context.Context, ref string, desc ocispecs.Descriptor return "", nil, err } defer rc.Close() - dt, err := ioutil.ReadAll(rc) + dt, err := io.ReadAll(rc) if err != nil { return "", nil, errors.Wrap(err, "failed to fetch schema1 manifest") } diff --git a/util/overlay/overlay_linux.go b/util/overlay/overlay_linux.go index 12f153f0b641..1e68150a3040 100644 --- a/util/overlay/overlay_linux.go +++ b/util/overlay/overlay_linux.go @@ -8,7 +8,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -114,7 +113,7 @@ func GetOverlayLayers(m mount.Mount) ([]string, error) { // WriteUpperdir writes a layer tar archive into the specified writer, based on // the diff information stored in the upperdir. func WriteUpperdir(ctx context.Context, w io.Writer, upperdir string, lower []mount.Mount) error { - emptyLower, err := ioutil.TempDir("", "buildkit") // empty directory used for the lower of diff view + emptyLower, err := os.MkdirTemp("", "buildkit") // empty directory used for the lower of diff view if err != nil { return errors.Wrapf(err, "failed to create temp dir") } diff --git a/util/overlay/overlay_linux_test.go b/util/overlay/overlay_linux_test.go index 013263bf4d26..fe91261159c5 100644 --- a/util/overlay/overlay_linux_test.go +++ b/util/overlay/overlay_linux_test.go @@ -6,7 +6,6 @@ package overlay import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -337,7 +336,7 @@ func TestLchtimes(t *testing.T) { } func testDiffWithBase(base, diff fstest.Applier, expected []TestChange, opts ...string) error { - t1, err := ioutil.TempDir("", "diff-with-base-lower-") + t1, err := os.MkdirTemp("", "diff-with-base-lower-") if err != nil { return errors.Wrap(err, "failed to create temp dir") } @@ -347,13 +346,13 @@ func testDiffWithBase(base, diff fstest.Applier, expected []TestChange, opts ... return errors.Wrap(err, "failed to apply base filesystem") } - tupper, err := ioutil.TempDir("", "diff-with-base-upperdir-") + tupper, err := os.MkdirTemp("", "diff-with-base-upperdir-") if err != nil { return errors.Wrap(err, "failed to create temp dir") } defer os.RemoveAll(tupper) - workdir, err := ioutil.TempDir("", "diff-with-base-workdir-") + workdir, err := os.MkdirTemp("", "diff-with-base-workdir-") if err != nil { return errors.Wrap(err, "failed to create temp dir") } @@ -420,7 +419,7 @@ func collectAndCheckChanges(base, upperdir string, expected []TestChange) error ctx := context.Background() changes := []TestChange{} - emptyLower, err := ioutil.TempDir("", "buildkit-test-emptylower") // empty directory used for the lower of diff view + emptyLower, err := os.MkdirTemp("", "buildkit-test-emptylower") // empty directory used for the lower of diff view if err != nil { return errors.Wrapf(err, "failed to create temp dir") } diff --git a/util/resolver/resolver.go b/util/resolver/resolver.go index a23f4b15cfed..0639a1b623de 100644 --- a/util/resolver/resolver.go +++ b/util/resolver/resolver.go @@ -3,7 +3,6 @@ package resolver import ( "crypto/tls" "crypto/x509" - "io/ioutil" "net" "net/http" "os" @@ -67,7 +66,7 @@ func fillInsecureOpts(host string, c config.RegistryConfig, h docker.RegistryHos func loadTLSConfig(c config.RegistryConfig) (*tls.Config, error) { for _, d := range c.TLSConfigDir { - fs, err := ioutil.ReadDir(d) + fs, err := os.ReadDir(d) if err != nil && !errors.Is(err, os.ErrNotExist) && !errors.Is(err, os.ErrPermission) { return nil, errors.WithStack(err) } @@ -98,7 +97,7 @@ func loadTLSConfig(c config.RegistryConfig) (*tls.Config, error) { } for _, p := range c.RootCAs { - dt, err := ioutil.ReadFile(p) + dt, err := os.ReadFile(p) if err != nil { return nil, errors.Wrapf(err, "failed to read %s", p) } diff --git a/util/testutil/integration/containerd.go b/util/testutil/integration/containerd.go index 3fb3aa5e33cb..be1b7e9bd711 100644 --- a/util/testutil/integration/containerd.go +++ b/util/testutil/integration/containerd.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "io/ioutil" "log" "os" "os/exec" @@ -110,7 +109,7 @@ func (c *containerd) New(ctx context.Context, cfg *BackendConfig) (b Backend, cl rootless = true } - tmpdir, err := ioutil.TempDir("", "bktest_containerd") + tmpdir, err := os.MkdirTemp("", "bktest_containerd") if err != nil { return nil, nil, err } @@ -158,7 +157,7 @@ disabled_plugins = ["cri"] } configFile := filepath.Join(tmpdir, "config.toml") - if err := ioutil.WriteFile(configFile, []byte(config), 0644); err != nil { + if err := os.WriteFile(configFile, []byte(config), 0644); err != nil { return nil, nil, err } diff --git a/util/testutil/integration/dockerd.go b/util/testutil/integration/dockerd.go index 93b656615782..eeccbe44d132 100644 --- a/util/testutil/integration/dockerd.go +++ b/util/testutil/integration/dockerd.go @@ -3,7 +3,6 @@ package integration import ( "context" "io" - "io/ioutil" "net" "os" "os/exec" @@ -54,7 +53,7 @@ func (c dockerd) New(ctx context.Context, cfg *BackendConfig) (b Backend, cl fun var proxyGroup errgroup.Group deferF.append(proxyGroup.Wait) - workDir, err := ioutil.TempDir("", "integration") + workDir, err := os.MkdirTemp("", "integration") if err != nil { return nil, nil, err } @@ -122,7 +121,7 @@ func (c dockerd) New(ctx context.Context, cfg *BackendConfig) (b Backend, cl fun // Create a file descriptor to be used as a Unix domain socket. // Remove it immediately (the name will still be valid for the socket) so that // we don't leave files all over the users tmp tree. - f, err := ioutil.TempFile("", "buildkit-integration") + f, err := os.CreateTemp("", "buildkit-integration") if err != nil { return } diff --git a/util/testutil/integration/frombinary.go b/util/testutil/integration/frombinary.go index 3f2139ec5d91..4bf68193c548 100644 --- a/util/testutil/integration/frombinary.go +++ b/util/testutil/integration/frombinary.go @@ -3,7 +3,6 @@ package integration import ( "context" "encoding/json" - "io/ioutil" "os" "github.com/containerd/containerd/content" @@ -15,7 +14,7 @@ import ( func providerFromBinary(fn string) (_ ocispecs.Descriptor, _ content.Provider, _ func(), err error) { ctx := context.TODO() - tmpDir, err := ioutil.TempDir("", "buildkit-state") + tmpDir, err := os.MkdirTemp("", "buildkit-state") if err != nil { return ocispecs.Descriptor{}, nil, nil, err } diff --git a/util/testutil/integration/registry.go b/util/testutil/integration/registry.go index 06d1adf355ef..5e380621d9f7 100644 --- a/util/testutil/integration/registry.go +++ b/util/testutil/integration/registry.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -31,7 +30,7 @@ func NewRegistry(dir string) (url string, cl func() error, err error) { }() if dir == "" { - tmpdir, err := ioutil.TempDir("", "test-registry") + tmpdir, err := os.MkdirTemp("", "test-registry") if err != nil { return "", nil, err } @@ -52,7 +51,7 @@ http: addr: 127.0.0.1:0 `, filepath.Join(dir, "data")) - if err := ioutil.WriteFile(filepath.Join(dir, "config.yaml"), []byte(template), 0600); err != nil { + if err := os.WriteFile(filepath.Join(dir, "config.yaml"), []byte(template), 0600); err != nil { return "", nil, err } } @@ -84,7 +83,7 @@ func detectPort(ctx context.Context, rc io.ReadCloser) (string, error) { found := make(chan struct{}) defer func() { close(found) - go io.Copy(ioutil.Discard, rc) + go io.Copy(io.Discard, rc) }() go func() { diff --git a/util/testutil/integration/run.go b/util/testutil/integration/run.go index 50d355e41104..b54b21e77327 100644 --- a/util/testutil/integration/run.go +++ b/util/testutil/integration/run.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "io/ioutil" "math/rand" "os" "os/exec" @@ -295,7 +294,7 @@ mirrors=["%s"] } func writeConfig(updaters []ConfigUpdater) (string, error) { - tmpdir, err := ioutil.TempDir("", "bktest_config") + tmpdir, err := os.MkdirTemp("", "bktest_config") if err != nil { return "", err } @@ -308,7 +307,7 @@ func writeConfig(updaters []ConfigUpdater) (string, error) { s = upt.UpdateConfigFile(s) } - if err := ioutil.WriteFile(filepath.Join(tmpdir, buildkitdConfigFile), []byte(s), 0644); err != nil { + if err := os.WriteFile(filepath.Join(tmpdir, buildkitdConfigFile), []byte(s), 0644); err != nil { return "", err } return tmpdir, nil @@ -428,7 +427,7 @@ func runStargzSnapshotter(cfg *BackendConfig) (address string, cl func() error, } }() - tmpStargzDir, err := ioutil.TempDir("", "bktest_containerd_stargz_grpc") + tmpStargzDir, err := os.MkdirTemp("", "bktest_containerd_stargz_grpc") if err != nil { return "", nil, err } diff --git a/util/testutil/integration/sandbox.go b/util/testutil/integration/sandbox.go index 51936c7d299a..a72efddb8137 100644 --- a/util/testutil/integration/sandbox.go +++ b/util/testutil/integration/sandbox.go @@ -5,7 +5,6 @@ import ( "bytes" "context" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -168,7 +167,7 @@ func runBuildkitd(ctx context.Context, conf *BackendConfig, args []string, logs args = append(args, "--config="+conf.ConfigFile) } - tmpdir, err := ioutil.TempDir("", "bktest_buildkitd") + tmpdir, err := os.MkdirTemp("", "bktest_buildkitd") if err != nil { return "", nil, err } diff --git a/util/testutil/tar.go b/util/testutil/tar.go index e7a9b41fa3b8..a519026b6a45 100644 --- a/util/testutil/tar.go +++ b/util/testutil/tar.go @@ -5,7 +5,6 @@ import ( "bytes" "compress/gzip" "io" - "io/ioutil" "github.com/pkg/errors" ) @@ -41,7 +40,7 @@ func ReadTarToMap(dt []byte, compressed bool) (map[string]*TarItem, error) { var dt []byte if h.Typeflag == tar.TypeReg { - dt, err = ioutil.ReadAll(tr) + dt, err = io.ReadAll(tr) if err != nil { return nil, errors.Wrapf(err, "error reading file") } diff --git a/util/winlayers/applier.go b/util/winlayers/applier.go index c9c76b27dfb9..a5de66df224d 100644 --- a/util/winlayers/applier.go +++ b/util/winlayers/applier.go @@ -4,7 +4,6 @@ import ( "archive/tar" "context" "io" - "io/ioutil" "runtime" "strings" "sync" @@ -87,7 +86,7 @@ func (s *winApplier) Apply(ctx context.Context, desc ocispecs.Descriptor, mounts } // Read any trailing data - if _, err := io.Copy(ioutil.Discard, rc); err != nil { + if _, err := io.Copy(io.Discard, rc); err != nil { discard(err) return err } @@ -144,7 +143,7 @@ func filter(in io.Reader, f func(*tar.Header) bool) (io.Reader, func(error)) { } } else { if h.Size > 0 { - if _, err := io.Copy(ioutil.Discard, tarReader); err != nil { + if _, err := io.Copy(io.Discard, tarReader); err != nil { return err } } diff --git a/worker/base/worker.go b/worker/base/worker.go index fa8b7692d9fd..7db6dc29a622 100644 --- a/worker/base/worker.go +++ b/worker/base/worker.go @@ -3,7 +3,6 @@ package base import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "time" @@ -468,11 +467,11 @@ func (w *Worker) FromRemote(ctx context.Context, remote *solver.Remote) (ref cac // If not exist, it creates a random one, func ID(root string) (string, error) { f := filepath.Join(root, "workerid") - b, err := ioutil.ReadFile(f) + b, err := os.ReadFile(f) if err != nil { if errors.Is(err, os.ErrNotExist) { id := identity.NewID() - err := ioutil.WriteFile(f, []byte(id), 0400) + err := os.WriteFile(f, []byte(id), 0400) return id, err } return "", err diff --git a/worker/base/worker_test.go b/worker/base/worker_test.go index a80372baaaf0..a903c2b90314 100644 --- a/worker/base/worker_test.go +++ b/worker/base/worker_test.go @@ -1,7 +1,6 @@ package base import ( - "io/ioutil" "os" "testing" @@ -10,7 +9,7 @@ import ( func TestID(t *testing.T) { t.Parallel() - tmpdir, err := ioutil.TempDir("", "worker-base-test-id") + tmpdir, err := os.MkdirTemp("", "worker-base-test-id") require.NoError(t, err) id0, err := ID(tmpdir) diff --git a/worker/containerd/containerd_test.go b/worker/containerd/containerd_test.go index c3c5286b027d..bf2fc2561e86 100644 --- a/worker/containerd/containerd_test.go +++ b/worker/containerd/containerd_test.go @@ -5,7 +5,6 @@ package containerd import ( "context" - "io/ioutil" "os" "testing" @@ -29,7 +28,7 @@ func TestContainerdWorkerIntegration(t *testing.T) { } func newWorkerOpt(t *testing.T, addr string) (base.WorkerOpt, func()) { - tmpdir, err := ioutil.TempDir("", "workertest") + tmpdir, err := os.MkdirTemp("", "workertest") require.NoError(t, err) cleanup := func() { os.RemoveAll(tmpdir) } rootless := false diff --git a/worker/runc/runc_test.go b/worker/runc/runc_test.go index bcaaf812df6d..0bb9c0334ac8 100644 --- a/worker/runc/runc_test.go +++ b/worker/runc/runc_test.go @@ -8,7 +8,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -30,7 +29,7 @@ import ( ) func newWorkerOpt(t *testing.T, processMode oci.ProcessMode) (base.WorkerOpt, func()) { - tmpdir, err := ioutil.TempDir("", "workertest") + tmpdir, err := os.MkdirTemp("", "workertest") require.NoError(t, err) cleanup := func() { os.RemoveAll(tmpdir) } @@ -143,7 +142,7 @@ func TestRuncWorker(t *testing.T) { require.NoError(t, err) //Verifies fix for issue https://github.com/moby/buildkit/issues/429 - dt, err := ioutil.ReadFile(filepath.Join(target, "run", "bar")) + dt, err := os.ReadFile(filepath.Join(target, "run", "bar")) require.NoError(t, err) require.Equal(t, string(dt), "foo\n") @@ -199,7 +198,7 @@ func TestRuncWorkerNoProcessSandbox(t *testing.T) { // ensure the procfs is shared selfPID := os.Getpid() - selfCmdline, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cmdline", selfPID)) + selfCmdline, err := os.ReadFile(fmt.Sprintf("/proc/%d/cmdline", selfPID)) require.NoError(t, err) meta := executor.Meta{ Args: []string{"/bin/cat", fmt.Sprintf("/proc/%d/cmdline", selfPID)}, diff --git a/worker/tests/common.go b/worker/tests/common.go index 67e362283c61..46c99561d989 100644 --- a/worker/tests/common.go +++ b/worker/tests/common.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "io" - "io/ioutil" "testing" "time" @@ -126,7 +125,7 @@ func TestWorkerExec(t *testing.T, w *base.Worker) { Meta: executor.Meta{ Args: []string{"sh", "-c", "cat > /tmp/msg"}, }, - Stdin: ioutil.NopCloser(stdin), + Stdin: io.NopCloser(stdin), Stdout: &nopCloser{stdout}, Stderr: &nopCloser{stderr}, }) From ec2f1c8b2734bde485e706cc05390ed44f7c42b2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 10 Mar 2022 00:58:32 +0100 Subject: [PATCH 04/21] golangci-lint: prevent io/ioutil from being used The package has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 9bcd3f6648696085d6f4ceb878c2523c72722df8) Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 28911415b7d0..2093a75454ac 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,6 +11,7 @@ run: linters: enable: - deadcode + - depguard - gofmt - goimports - revive @@ -30,6 +31,13 @@ linters: disable-all: true linters-settings: + depguard: + list-type: blacklist + include-go-root: true + packages: + # The io/ioutil package has been deprecated. + # https://go.dev/doc/go1.16#ioutil + - io/ioutil importas: alias: - pkg: "github.com/opencontainers/image-spec/specs-go/v1" From a7f8e3774700cc42657093aaafa39af16514bfd0 Mon Sep 17 00:00:00 2001 From: Vasek - Tom C Date: Thu, 10 Mar 2022 11:30:30 +0100 Subject: [PATCH 05/21] Bump Golang version from 1.16 to 1.17 in windows build CI Since go1.17 is set on all other containers, using go1.16 in only one pipeline can lead to unexpected behavior and difference during test. Signed-off-by: Vasek - Tom C (cherry picked from commit 679b60c455af87fd7b593fe81865866413758969) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 489eef5f6bae..27e6ea18725d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,7 +143,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Cache Go modules uses: actions/cache@v2 From 71b7280019ffff2faeb7f8dd37fe4ec2537c9c8f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 22 Mar 2022 18:45:53 +0100 Subject: [PATCH 06/21] update to go 1.18 Signed-off-by: CrazyMax (cherry picked from commit ebdcd31aba04f8420330fc26efe9797df5e9fcc3) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/build.yml | 2 +- Dockerfile | 2 +- examples/buildkit0/buildkit.go | 2 +- examples/buildkit1/buildkit.go | 2 +- examples/buildkit2/buildkit.go | 2 +- examples/buildkit3/buildkit.go | 2 +- examples/buildkit4/buildkit.go | 2 +- examples/nested-llb/main.go | 2 +- frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile | 2 +- hack/dockerfiles/generated-files.Dockerfile | 2 +- hack/dockerfiles/lint.Dockerfile | 2 +- hack/dockerfiles/vendor.Dockerfile | 2 +- util/archutil/Dockerfile | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27e6ea18725d..595bae7343f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,7 +143,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: Cache Go modules uses: actions/cache@v2 diff --git a/Dockerfile b/Dockerfile index 35246d42dbab..c1074f90d985 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN apk add --no-cache git # xx is a helper for cross-compilation FROM --platform=$BUILDPLATFORM tonistiigi/xx@sha256:1e96844fadaa2f9aea021b2b05299bc02fe4c39a92d8e735b93e8e2b15610128 AS xx -FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS golatest +FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS golatest # gobuild is base stage for compiling go/cgo FROM golatest AS gobuild-base diff --git a/examples/buildkit0/buildkit.go b/examples/buildkit0/buildkit.go index 78f988d8584d..1a524347427d 100644 --- a/examples/buildkit0/buildkit.go +++ b/examples/buildkit0/buildkit.go @@ -33,7 +33,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.17-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit1/buildkit.go b/examples/buildkit1/buildkit.go index 98793d0ab6e2..9bbee5f84c21 100644 --- a/examples/buildkit1/buildkit.go +++ b/examples/buildkit1/buildkit.go @@ -33,7 +33,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.17-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit2/buildkit.go b/examples/buildkit2/buildkit.go index 7a88562cf72e..fed66079783f 100644 --- a/examples/buildkit2/buildkit.go +++ b/examples/buildkit2/buildkit.go @@ -33,7 +33,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.17-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit3/buildkit.go b/examples/buildkit3/buildkit.go index fa985f18eb84..ac1c18ecdc07 100644 --- a/examples/buildkit3/buildkit.go +++ b/examples/buildkit3/buildkit.go @@ -34,7 +34,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.17-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit4/buildkit.go b/examples/buildkit4/buildkit.go index c20f13ea0c05..399a7ac5a07e 100644 --- a/examples/buildkit4/buildkit.go +++ b/examples/buildkit4/buildkit.go @@ -37,7 +37,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.17-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/nested-llb/main.go b/examples/nested-llb/main.go index 74eb58864af1..180282e6eb19 100644 --- a/examples/nested-llb/main.go +++ b/examples/nested-llb/main.go @@ -32,7 +32,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.17-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile b/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile index 7f181948816b..6c4428a06533 100644 --- a/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile +++ b/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile @@ -3,7 +3,7 @@ # xx is a helper for cross-compilation FROM --platform=$BUILDPLATFORM tonistiigi/xx:golang@sha256:810dc54d5144f133a218e88e319184bf8b9ce01d37d46ddb37573e90decd9eef AS xx -FROM --platform=$BUILDPLATFORM golang:1.17-alpine AS base +FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS base RUN apk add git bash COPY --from=xx / / WORKDIR /src diff --git a/hack/dockerfiles/generated-files.Dockerfile b/hack/dockerfiles/generated-files.Dockerfile index a9f6f0bb9212..0bc0897e7ebc 100644 --- a/hack/dockerfiles/generated-files.Dockerfile +++ b/hack/dockerfiles/generated-files.Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile-upstream:master # protoc is dynamically linked to glibc to can't use golang:1.10-alpine -FROM golang:1.17-buster AS gobuild-base +FROM golang:1.18-buster AS gobuild-base RUN apt-get update && apt-get --no-install-recommends install -y \ unzip \ diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 62c3c290b51e..7628cb270368 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile-upstream:master -FROM golang:1.17-alpine +FROM golang:1.18-alpine RUN apk add --no-cache gcc musl-dev yamllint RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.43.0 WORKDIR /go/src/github.com/moby/buildkit diff --git a/hack/dockerfiles/vendor.Dockerfile b/hack/dockerfiles/vendor.Dockerfile index a0d0607e4243..4387099d6895 100644 --- a/hack/dockerfiles/vendor.Dockerfile +++ b/hack/dockerfiles/vendor.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile-upstream:master -FROM golang:1.17-alpine AS vendored +FROM golang:1.18-alpine AS vendored RUN apk add --no-cache git WORKDIR /src RUN --mount=target=/src,rw \ diff --git a/util/archutil/Dockerfile b/util/archutil/Dockerfile index 6ac641f06dcb..985d980bf165 100644 --- a/util/archutil/Dockerfile +++ b/util/archutil/Dockerfile @@ -48,7 +48,7 @@ FROM base AS exit-mips64 COPY fixtures/exit.mips64.s . RUN mips64-linux-gnuabi64-as --noexecstack -o exit.o exit.mips64.s && mips64-linux-gnuabi64-ld -o exit -s exit.o -FROM golang:1.17-alpine AS generate +FROM golang:1.18-alpine AS generate WORKDIR /src COPY --from=exit-amd64 /src/exit amd64 COPY --from=exit-386 /src/exit 386 From 4d9cc38e7804ca1da62cb028b22d5f52e67d5871 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 22 Mar 2022 10:30:18 +0100 Subject: [PATCH 07/21] hack/dockerfiles: upgrade golangci-lint version to v1.45.0 Signed-off-by: CrazyMax (cherry picked from commit 6676f306e029b4fcb15020660d566fc32e6f82e2) Signed-off-by: Sebastiaan van Stijn --- hack/dockerfiles/lint.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 7628cb270368..9de6fbfc5b50 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.18-alpine RUN apk add --no-cache gcc musl-dev yamllint -RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.43.0 +RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.45.0 WORKDIR /go/src/github.com/moby/buildkit RUN --mount=target=/go/src/github.com/moby/buildkit --mount=target=/root/.cache,type=cache \ GOARCH=amd64 golangci-lint run && \ From 513c42459509848bf82b2c763dcf0c8a875bd8d6 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 22 Mar 2022 10:37:34 +0100 Subject: [PATCH 08/21] dockerfile: disable go module to build containerd Signed-off-by: CrazyMax (cherry picked from commit a633fa469c15a748347a78844eeaa29fed7f82d9) Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c1074f90d985..4b4160ce6003 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,7 +123,7 @@ RUN git clone https://github.com/containerd/containerd.git containerd FROM gobuild-base AS containerd-base WORKDIR /go/src/github.com/containerd/containerd ARG TARGETPLATFORM -ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs +ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off RUN xx-apk add musl-dev gcc && xx-go --wrap FROM containerd-base AS containerd From af3d3e846fcf94429caae721f74457d646656080 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 25 Mar 2022 09:06:27 +0100 Subject: [PATCH 09/21] lint: fix issues with go 1.18 Signed-off-by: CrazyMax (cherry picked from commit 8679e2364763a59daa8619739acabd5b3ca93577) Signed-off-by: Sebastiaan van Stijn --- frontend/dockerfile/instructions/parse.go | 2 +- hack/dockerfiles/lint.Dockerfile | 1 + solver/testutil/cachestorage_testsuite.go | 2 +- util/resolver/retryhandler/retry.go | 2 +- util/testutil/integration/run.go | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/dockerfile/instructions/parse.go b/frontend/dockerfile/instructions/parse.go index d3b7326ce250..a04e9b9d4f48 100644 --- a/frontend/dockerfile/instructions/parse.go +++ b/frontend/dockerfile/instructions/parse.go @@ -725,7 +725,7 @@ func errExactlyOneArgument(command string) error { } func errNoDestinationArgument(command string) error { - return errors.Errorf("%s requires at least two arguments, but only one was provided. Destination could not be determined.", command) + return errors.Errorf("%s requires at least two arguments, but only one was provided. Destination could not be determined", command) } func errBadHeredoc(command string, option string) error { diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 9de6fbfc5b50..06b8fab90540 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -1,6 +1,7 @@ # syntax=docker/dockerfile-upstream:master FROM golang:1.18-alpine +ENV GOFLAGS="-buildvcs=false" RUN apk add --no-cache gcc musl-dev yamllint RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.45.0 WORKDIR /go/src/github.com/moby/buildkit diff --git a/solver/testutil/cachestorage_testsuite.go b/solver/testutil/cachestorage_testsuite.go index e883ddd2a6eb..10abee7e7c61 100644 --- a/solver/testutil/cachestorage_testsuite.go +++ b/solver/testutil/cachestorage_testsuite.go @@ -387,7 +387,7 @@ func testWalkIDsByResult(t *testing.T, st solver.CacheKeyStorage) { func getFunctionName(i interface{}) string { fullname := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() dot := strings.LastIndex(fullname, ".") + 1 - return strings.Title(fullname[dot:]) + return strings.Title(fullname[dot:]) //nolint:staticcheck // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support } func rootKey(dgst digest.Digest, output solver.Index) digest.Digest { diff --git a/util/resolver/retryhandler/retry.go b/util/resolver/retryhandler/retry.go index 554076b07b41..255485dffec0 100644 --- a/util/resolver/retryhandler/retry.go +++ b/util/resolver/retryhandler/retry.go @@ -60,7 +60,7 @@ func retryError(err error) bool { return true } // catches TLS timeout or other network-related temporary errors - if ne, ok := errors.Cause(err).(net.Error); ok && ne.Temporary() { + if ne, ok := errors.Cause(err).(net.Error); ok && ne.Temporary() { //nolint:staticcheck // ignoring "SA1019: Temporary is deprecated", continue to propagate net.Error through the "temporary" status return true } // https://github.com/containerd/containerd/pull/4724 diff --git a/util/testutil/integration/run.go b/util/testutil/integration/run.go index b54b21e77327..23207ca5d054 100644 --- a/util/testutil/integration/run.go +++ b/util/testutil/integration/run.go @@ -210,7 +210,7 @@ func Run(t *testing.T, testCases []Test, opt ...TestOpt) { func getFunctionName(i interface{}) string { fullname := runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() dot := strings.LastIndex(fullname, ".") + 1 - return strings.Title(fullname[dot:]) + return strings.Title(fullname[dot:]) //nolint:staticcheck // ignoring "SA1019: strings.Title is deprecated", as for our use we don't need full unicode support } var localImageCache map[string]map[string]struct{} From a06060e037f7538bba3707e7a67f92d539943486 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 6 Apr 2022 11:17:13 +0200 Subject: [PATCH 10/21] ci: set buildx 0.8.2 version Signed-off-by: CrazyMax (cherry picked from commit dec823fbba408bf80931bebd7c13f370fc4a1a3a) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/dockerd.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dockerd.yml b/.github/workflows/dockerd.yml index 04ece8563be4..03d2c359748b 100644 --- a/.github/workflows/dockerd.yml +++ b/.github/workflows/dockerd.yml @@ -13,6 +13,7 @@ env: REPO_SLUG_ORIGIN: "moby/buildkit:latest" CACHE_GHA_SCOPE_IT: "integration-tests" CACHE_GHA_SCOPE_BINARIES: "binaries" + BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment jobs: prepare: @@ -43,6 +44,7 @@ jobs: name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 with: + version: ${{ env.BUILDX_VERSION }} driver-opts: image=${{ env.REPO_SLUG_ORIGIN }} buildkitd-flags: --debug - @@ -107,6 +109,7 @@ jobs: name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 with: + version: ${{ env.BUILDX_VERSION }} driver-opts: image=${{ env.REPO_SLUG_ORIGIN }} buildkitd-flags: --debug - From be539c13e300c107088c87a714efaa1fc8e9bdd0 Mon Sep 17 00:00:00 2001 From: Pranav Pandit Date: Thu, 11 Aug 2022 16:44:56 -0700 Subject: [PATCH 11/21] Remove deprecated function call to fix lint error Signed-off-by: Pranav Pandit (cherry picked from commit 4ebb56e0fe1c4f377bb1fc8622619c0bb460dcae) Signed-off-by: Sebastiaan van Stijn --- client/client.go | 1 - hack/dockerfiles/lint.Dockerfile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index da0bc0e018ab..e97363a4e312 100644 --- a/client/client.go +++ b/client/client.go @@ -234,7 +234,6 @@ func loadCredentials(opts *withCredentials) (grpc.DialOption, error) { return nil, errors.Wrap(err, "could not read certificate/key") } cfg.Certificates = []tls.Certificate{cert} - cfg.BuildNameToCertificate() } return grpc.WithTransportCredentials(credentials.NewTLS(cfg)), nil diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 06b8fab90540..5b7e0c158364 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.18-alpine ENV GOFLAGS="-buildvcs=false" RUN apk add --no-cache gcc musl-dev yamllint -RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.45.0 +RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.47.3 WORKDIR /go/src/github.com/moby/buildkit RUN --mount=target=/go/src/github.com/moby/buildkit --mount=target=/root/.cache,type=cache \ GOARCH=amd64 golangci-lint run && \ From 6ffe8157359a8a6f9175bb5842b7274b3ab8c6d1 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 11 Aug 2022 15:57:35 +0200 Subject: [PATCH 12/21] update to go 1.19 Signed-off-by: CrazyMax (cherry picked from commit 1353f411d9040365da6f8f1c653dae046cc02ded) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/build.yml | 3 ++- Dockerfile | 2 +- examples/buildkit0/buildkit.go | 2 +- examples/buildkit1/buildkit.go | 2 +- examples/buildkit2/buildkit.go | 2 +- examples/buildkit3/buildkit.go | 2 +- examples/buildkit4/buildkit.go | 2 +- examples/nested-llb/main.go | 2 +- frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile | 2 +- frontend/gateway/pb/gateway.pb.go | 2 ++ hack/dockerfiles/generated-files.Dockerfile | 2 +- hack/dockerfiles/lint.Dockerfile | 2 +- hack/dockerfiles/vendor.Dockerfile | 2 +- solver/errdefs/errdefs.pb.go | 1 + solver/pb/ops.pb.go | 3 +++ util/archutil/Dockerfile | 2 +- 16 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 595bae7343f4..df2f4bc3c00d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,7 @@ env: CACHE_GHA_SCOPE_BINARIES: "binaries" CACHE_GHA_SCOPE_CROSS: "cross" BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment + GO_VERSION: "1.19" jobs: base: @@ -143,7 +144,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.18 + go-version: ${{ env.GO_VERSION }} - name: Cache Go modules uses: actions/cache@v2 diff --git a/Dockerfile b/Dockerfile index 4b4160ce6003..81cec9fbf54b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN apk add --no-cache git # xx is a helper for cross-compilation FROM --platform=$BUILDPLATFORM tonistiigi/xx@sha256:1e96844fadaa2f9aea021b2b05299bc02fe4c39a92d8e735b93e8e2b15610128 AS xx -FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS golatest +FROM --platform=$BUILDPLATFORM golang:1.19-alpine AS golatest # gobuild is base stage for compiling go/cgo FROM golatest AS gobuild-base diff --git a/examples/buildkit0/buildkit.go b/examples/buildkit0/buildkit.go index 1a524347427d..24810e730ff5 100644 --- a/examples/buildkit0/buildkit.go +++ b/examples/buildkit0/buildkit.go @@ -33,7 +33,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.19-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit1/buildkit.go b/examples/buildkit1/buildkit.go index 9bbee5f84c21..9f8201b2bddf 100644 --- a/examples/buildkit1/buildkit.go +++ b/examples/buildkit1/buildkit.go @@ -33,7 +33,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.19-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit2/buildkit.go b/examples/buildkit2/buildkit.go index fed66079783f..5ae6b201678b 100644 --- a/examples/buildkit2/buildkit.go +++ b/examples/buildkit2/buildkit.go @@ -33,7 +33,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.19-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit3/buildkit.go b/examples/buildkit3/buildkit.go index ac1c18ecdc07..58de1ebe0666 100644 --- a/examples/buildkit3/buildkit.go +++ b/examples/buildkit3/buildkit.go @@ -34,7 +34,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.19-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/buildkit4/buildkit.go b/examples/buildkit4/buildkit.go index 399a7ac5a07e..0bae9e7899e8 100644 --- a/examples/buildkit4/buildkit.go +++ b/examples/buildkit4/buildkit.go @@ -37,7 +37,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.19-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/examples/nested-llb/main.go b/examples/nested-llb/main.go index 180282e6eb19..93f9d41c2dcc 100644 --- a/examples/nested-llb/main.go +++ b/examples/nested-llb/main.go @@ -32,7 +32,7 @@ func main() { } func goBuildBase() llb.State { - goAlpine := llb.Image("docker.io/library/golang:1.18-alpine") + goAlpine := llb.Image("docker.io/library/golang:1.19-alpine") return goAlpine. AddEnv("PATH", "/usr/local/go/bin:"+system.DefaultPathEnvUnix). AddEnv("GOPATH", "/go"). diff --git a/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile b/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile index 6c4428a06533..e71903902426 100644 --- a/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile +++ b/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile @@ -3,7 +3,7 @@ # xx is a helper for cross-compilation FROM --platform=$BUILDPLATFORM tonistiigi/xx:golang@sha256:810dc54d5144f133a218e88e319184bf8b9ce01d37d46ddb37573e90decd9eef AS xx -FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS base +FROM --platform=$BUILDPLATFORM golang:1.19-alpine AS base RUN apk add git bash COPY --from=xx / / WORKDIR /src diff --git a/frontend/gateway/pb/gateway.pb.go b/frontend/gateway/pb/gateway.pb.go index e8e797ca7e10..236982d96f3f 100644 --- a/frontend/gateway/pb/gateway.pb.go +++ b/frontend/gateway/pb/gateway.pb.go @@ -35,6 +35,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Result struct { // Types that are valid to be assigned to Result: + // // *Result_RefDeprecated // *Result_RefsDeprecated // *Result_Ref @@ -1673,6 +1674,7 @@ var xxx_messageInfo_ReleaseContainerResponse proto.InternalMessageInfo type ExecMessage struct { ProcessID string `protobuf:"bytes,1,opt,name=ProcessID,proto3" json:"ProcessID,omitempty"` // Types that are valid to be assigned to Input: + // // *ExecMessage_Init // *ExecMessage_File // *ExecMessage_Resize diff --git a/hack/dockerfiles/generated-files.Dockerfile b/hack/dockerfiles/generated-files.Dockerfile index 0bc0897e7ebc..4a98712c67a1 100644 --- a/hack/dockerfiles/generated-files.Dockerfile +++ b/hack/dockerfiles/generated-files.Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile-upstream:master # protoc is dynamically linked to glibc to can't use golang:1.10-alpine -FROM golang:1.18-buster AS gobuild-base +FROM golang:1.19-buster AS gobuild-base RUN apt-get update && apt-get --no-install-recommends install -y \ unzip \ diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 5b7e0c158364..58803bd8b790 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile-upstream:master -FROM golang:1.18-alpine +FROM golang:1.19-alpine ENV GOFLAGS="-buildvcs=false" RUN apk add --no-cache gcc musl-dev yamllint RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.47.3 diff --git a/hack/dockerfiles/vendor.Dockerfile b/hack/dockerfiles/vendor.Dockerfile index 4387099d6895..4108aaaecf1b 100644 --- a/hack/dockerfiles/vendor.Dockerfile +++ b/hack/dockerfiles/vendor.Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile-upstream:master -FROM golang:1.18-alpine AS vendored +FROM golang:1.19-alpine AS vendored RUN apk add --no-cache git WORKDIR /src RUN --mount=target=/src,rw \ diff --git a/solver/errdefs/errdefs.pb.go b/solver/errdefs/errdefs.pb.go index 5da34b6e591b..e02cfb9696d8 100644 --- a/solver/errdefs/errdefs.pb.go +++ b/solver/errdefs/errdefs.pb.go @@ -186,6 +186,7 @@ type Solve struct { MountIDs []string `protobuf:"bytes,2,rep,name=mountIDs,proto3" json:"mountIDs,omitempty"` Op *pb.Op `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` // Types that are valid to be assigned to Subject: + // // *Solve_File // *Solve_Cache Subject isSolve_Subject `protobuf_oneof:"subject"` diff --git a/solver/pb/ops.pb.go b/solver/pb/ops.pb.go index 252227a94415..a3e3425fa29c 100644 --- a/solver/pb/ops.pb.go +++ b/solver/pb/ops.pb.go @@ -154,6 +154,7 @@ type Op struct { // inputs is a set of input edges. Inputs []*Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` // Types that are valid to be assigned to Op: + // // *Op_Exec // *Op_Source // *Op_File @@ -1948,6 +1949,7 @@ type FileAction struct { SecondaryInput InputIndex `protobuf:"varint,2,opt,name=secondaryInput,proto3,customtype=InputIndex" json:"secondaryInput"` Output OutputIndex `protobuf:"varint,3,opt,name=output,proto3,customtype=OutputIndex" json:"output"` // Types that are valid to be assigned to Action: + // // *FileAction_Copy // *FileAction_Mkfile // *FileAction_Mkdir @@ -2465,6 +2467,7 @@ func (m *ChownOpt) GetGroup() *UserOpt { type UserOpt struct { // Types that are valid to be assigned to User: + // // *UserOpt_ByName // *UserOpt_ByID User isUserOpt_User `protobuf_oneof:"user"` diff --git a/util/archutil/Dockerfile b/util/archutil/Dockerfile index 985d980bf165..9f831b7bfd44 100644 --- a/util/archutil/Dockerfile +++ b/util/archutil/Dockerfile @@ -48,7 +48,7 @@ FROM base AS exit-mips64 COPY fixtures/exit.mips64.s . RUN mips64-linux-gnuabi64-as --noexecstack -o exit.o exit.mips64.s && mips64-linux-gnuabi64-ld -o exit -s exit.o -FROM golang:1.18-alpine AS generate +FROM golang:1.19-alpine AS generate WORKDIR /src COPY --from=exit-amd64 /src/exit amd64 COPY --from=exit-386 /src/exit 386 From 058724d35a222c5e13708f0dc086d337942337aa Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 11 Aug 2022 13:02:56 +0200 Subject: [PATCH 13/21] update golangci-lint to 1.48.0 (go 1.19 support) and fix linting issues Signed-off-by: CrazyMax (cherry picked from commit 4a15e742d8456d9978811bf1aa5d23ab43c76ab1) Signed-off-by: Sebastiaan van Stijn --- cache/refs.go | 7 ++++--- frontend/dockerfile/instructions/bflag.go | 4 +++- frontend/dockerfile/instructions/commands.go | 11 ----------- frontend/dockerfile/parser/json_test.go | 12 ++++++------ frontend/dockerfile/parser/line_parsers.go | 1 - frontend/dockerfile/parser/parser.go | 1 - hack/dockerfiles/lint.Dockerfile | 2 +- solver/edge.go | 8 ++++---- util/archutil/detect.go | 6 +++--- 9 files changed, 21 insertions(+), 31 deletions(-) diff --git a/cache/refs.go b/cache/refs.go index 013a2804d96a..bbc38c481245 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -1590,9 +1590,10 @@ func (p sharableMountPool) setSharable(mounts snapshot.Mountable) snapshot.Mount // This is useful to share writable overlayfs mounts. // // NOTE: Mount() method doesn't return the underlying mount configuration (e.g. overlayfs mounts) -// instead it always return bind mounts of the temporary mount point. So if the caller -// needs to inspect the underlying mount configuration (e.g. for optimized differ for -// overlayfs), this wrapper shouldn't be used. +// +// instead it always return bind mounts of the temporary mount point. So if the caller +// needs to inspect the underlying mount configuration (e.g. for optimized differ for +// overlayfs), this wrapper shouldn't be used. type sharableMountable struct { snapshot.Mountable diff --git a/frontend/dockerfile/instructions/bflag.go b/frontend/dockerfile/instructions/bflag.go index 1cfbf760006a..c57a2d21391c 100644 --- a/frontend/dockerfile/instructions/bflag.go +++ b/frontend/dockerfile/instructions/bflag.go @@ -134,7 +134,9 @@ func (fl *Flag) IsTrue() bool { // compile time error so it doesn't matter too much when we stop our // processing as long as we do stop it, so this allows the code // around AddXXX() to be just: -// defFlag := AddString("description", "") +// +// defFlag := AddString("description", "") +// // w/o needing to add an if-statement around each one. func (bf *BFlags) Parse() error { // If there was an error while defining the possible flags diff --git a/frontend/dockerfile/instructions/commands.go b/frontend/dockerfile/instructions/commands.go index 48ebf183a965..df040e35f7da 100644 --- a/frontend/dockerfile/instructions/commands.go +++ b/frontend/dockerfile/instructions/commands.go @@ -157,7 +157,6 @@ func NewLabelCommand(k string, v string, NoExp bool) *LabelCommand { // LabelCommand : LABEL some json data describing the image // // Sets the Label variable foo to bar, -// type LabelCommand struct { withNameAndCode Labels KeyValuePairs // kvp slice instead of map to preserve ordering @@ -220,7 +219,6 @@ func (s *SourcesAndDest) ExpandRaw(expander SingleWordExpander) error { // // Add the file 'foo' to '/path'. Tarball and Remote URL (http, https) handling // exist here. If you do not wish to have this automatic handling, use COPY. -// type AddCommand struct { withNameAndCode SourcesAndDest @@ -243,7 +241,6 @@ func (c *AddCommand) Expand(expander SingleWordExpander) error { // CopyCommand : COPY foo /path // // Same as 'ADD' but without the tar and remote url handling. -// type CopyCommand struct { withNameAndCode SourcesAndDest @@ -273,7 +270,6 @@ type OnbuildCommand struct { // WorkdirCommand : WORKDIR /tmp // // Set the working directory for future RUN/CMD/etc statements. -// type WorkdirCommand struct { withNameAndCode Path string @@ -312,7 +308,6 @@ type ShellDependantCmdLine struct { // RUN echo hi # sh -c echo hi (Linux) // RUN echo hi # cmd /S /C echo hi (Windows) // RUN [ "echo", "hi" ] # echo hi -// type RunCommand struct { withNameAndCode withExternalData @@ -331,7 +326,6 @@ func (c *RunCommand) Expand(expander SingleWordExpander) error { // // Set the default command to run in the container (which may be empty). // Argument handling is the same as RUN. -// type CmdCommand struct { withNameAndCode ShellDependantCmdLine @@ -341,7 +335,6 @@ type CmdCommand struct { // // Set the default healthcheck command to run in the container (which may be empty). // Argument handling is the same as RUN. -// type HealthCheckCommand struct { withNameAndCode Health *container.HealthConfig @@ -354,7 +347,6 @@ type HealthCheckCommand struct { // // Handles command processing similar to CMD and RUN, only req.runConfig.Entrypoint // is initialized at newBuilder time instead of through argument parsing. -// type EntrypointCommand struct { withNameAndCode ShellDependantCmdLine @@ -364,7 +356,6 @@ type EntrypointCommand struct { // // Expose ports for links and port mappings. This all ends up in // req.runConfig.ExposedPorts for runconfig. -// type ExposeCommand struct { withNameAndCode Ports []string @@ -374,7 +365,6 @@ type ExposeCommand struct { // // Set the user to 'foo' for future commands and when running the // ENTRYPOINT/CMD at container run time. -// type UserCommand struct { withNameAndCode User string @@ -393,7 +383,6 @@ func (c *UserCommand) Expand(expander SingleWordExpander) error { // VolumeCommand : VOLUME /foo // // Expose the volume /foo for use. Will also accept the JSON array form. -// type VolumeCommand struct { withNameAndCode Volumes []string diff --git a/frontend/dockerfile/parser/json_test.go b/frontend/dockerfile/parser/json_test.go index 5ffd9bd2572d..d25804cd04d4 100644 --- a/frontend/dockerfile/parser/json_test.go +++ b/frontend/dockerfile/parser/json_test.go @@ -16,12 +16,12 @@ var invalidJSONArraysOfStrings = []string{ } var validJSONArraysOfStrings = map[string][]string{ - `[]`: {}, - `[""]`: {""}, - `["a"]`: {"a"}, - `["a","b"]`: {"a", "b"}, - `[ "a", "b" ]`: {"a", "b"}, - `[ "a", "b" ]`: {"a", "b"}, + `[]`: {}, + `[""]`: {""}, + `["a"]`: {"a"}, + `["a","b"]`: {"a", "b"}, + `[ "a", "b" ]`: {"a", "b"}, + `[ "a", "b" ]`: {"a", "b"}, ` [ "a", "b" ] `: {"a", "b"}, `["abc 123", "♥", "☃", "\" \\ \/ \b \f \n \r \t \u0000"]`: {"abc 123", "♥", "☃", "\" \\ / \b \f \n \r \t \u0000"}, } diff --git a/frontend/dockerfile/parser/line_parsers.go b/frontend/dockerfile/parser/line_parsers.go index c0d0a55d1224..2e3039f63e9a 100644 --- a/frontend/dockerfile/parser/line_parsers.go +++ b/frontend/dockerfile/parser/line_parsers.go @@ -34,7 +34,6 @@ func parseIgnore(rest string, d *directives) (*Node, map[string]bool, error) { // statement with sub-statements. // // ONBUILD RUN foo bar -> (onbuild (run foo bar)) -// func parseSubCommand(rest string, d *directives) (*Node, map[string]bool, error) { if rest == "" { return nil, nil, nil diff --git a/frontend/dockerfile/parser/parser.go b/frontend/dockerfile/parser/parser.go index 53165e0a481d..a9f6709d4d40 100644 --- a/frontend/dockerfile/parser/parser.go +++ b/frontend/dockerfile/parser/parser.go @@ -27,7 +27,6 @@ import ( // This data structure is frankly pretty lousy for handling complex languages, // but lucky for us the Dockerfile isn't very complicated. This structure // works a little more effectively than a "proper" parse tree for our needs. -// type Node struct { Value string // actual content Next *Node // the next item in the current sexp diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 58803bd8b790..257a9e878196 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.19-alpine ENV GOFLAGS="-buildvcs=false" RUN apk add --no-cache gcc musl-dev yamllint -RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.47.3 +RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.48.0 WORKDIR /go/src/github.com/moby/buildkit RUN --mount=target=/go/src/github.com/moby/buildkit --mount=target=/root/.cache,type=cache \ GOARCH=amd64 golangci-lint run && \ diff --git a/solver/edge.go b/solver/edge.go index 8504d9f657d6..3493054d3e97 100644 --- a/solver/edge.go +++ b/solver/edge.go @@ -317,10 +317,10 @@ func (e *edge) skipPhase2FastCache(dep *dep) bool { // previous calls. // To avoid deadlocks and resource leaks this function needs to follow // following rules: -// 1) this function needs to return unclosed outgoing requests if some incoming -// requests were not completed -// 2) this function may not return outgoing requests if it has completed all -// incoming requests +// 1. this function needs to return unclosed outgoing requests if some incoming +// requests were not completed +// 2. this function may not return outgoing requests if it has completed all +// incoming requests func (e *edge) unpark(incoming []pipe.Sender, updates, allPipes []pipe.Receiver, f *pipeFactory) { // process all incoming changes depChanged := false diff --git a/util/archutil/detect.go b/util/archutil/detect.go index 44cb3133e1b6..837b05791a83 100644 --- a/util/archutil/detect.go +++ b/util/archutil/detect.go @@ -87,9 +87,9 @@ func SupportedPlatforms(noCache bool) []ocispecs.Platform { return arr } -//WarnIfUnsupported validates the platforms and show warning message if there is, -//the end user could fix the issue based on those warning, and thus no need to drop -//the platform from the candidates. +// WarnIfUnsupported validates the platforms and show warning message if there is, +// the end user could fix the issue based on those warning, and thus no need to drop +// the platform from the candidates. func WarnIfUnsupported(pfs []ocispecs.Platform) { def := nativePlatform() for _, p := range pfs { From 067c5779e8efb98e16fa91f5b6a8b85e337b9b9f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 16 Aug 2022 10:20:13 +0200 Subject: [PATCH 14/21] ci: align test flags Signed-off-by: CrazyMax (cherry picked from commit c175c93c49a980197b2738896764bee7a5561e55) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/build.yml | 4 ++-- .github/workflows/dockerd.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df2f4bc3c00d..c22ff27766f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,7 @@ env: CACHE_GHA_SCOPE_IT: "integration-tests" CACHE_GHA_SCOPE_BINARIES: "binaries" CACHE_GHA_SCOPE_CROSS: "cross" + TESTFLAGS: "-v --parallel=6 --timeout=30m" BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment GO_VERSION: "1.19" @@ -109,7 +110,6 @@ jobs: - name: Test pkg=${{ matrix.pkg }} ; typ=${{ matrix.typ }} ; skipit=${{ matrix.skip-integration-tests }} ; worker=${{ matrix.worker }} run: | - export TESTFLAGS="-v --parallel=6 --timeout=20m" if [ -n "${{ matrix.worker }}" ]; then export TESTFLAGS="${TESTFLAGS} --run=//worker=${{ matrix.worker }}$" fi @@ -164,7 +164,7 @@ jobs: SKIP_INTEGRATION_TESTS: 1 run: | mkdir -p ./coverage - go test -coverprofile=./coverage/coverage-${{ github.job }}-${{ matrix.os }}.txt -covermode=atomic ./... + go test -coverprofile=./coverage/coverage-${{ github.job }}-${{ matrix.os }}.txt -covermode=atomic ${TESTFLAGS} ./... shell: bash - name: Upload coverage file diff --git a/.github/workflows/dockerd.yml b/.github/workflows/dockerd.yml index 03d2c359748b..c76970881968 100644 --- a/.github/workflows/dockerd.yml +++ b/.github/workflows/dockerd.yml @@ -13,6 +13,7 @@ env: REPO_SLUG_ORIGIN: "moby/buildkit:latest" CACHE_GHA_SCOPE_IT: "integration-tests" CACHE_GHA_SCOPE_BINARIES: "binaries" + TESTFLAGS: "-v --parallel=1 --timeout=30m" BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment jobs: @@ -137,6 +138,6 @@ jobs: TEST_DOCKERD: "1" TEST_DOCKERD_BINARY: "./build/dockerd" TESTPKGS: "${{ matrix.pkg }}" - TESTFLAGS: "-v --parallel=1 --timeout=30m --run=//worker=dockerd$" + TESTFLAGS: "${{ env.TESTFLAGS }} --run=//worker=dockerd$" SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}" CACHE_FROM: "type=gha,scope=${{ env.CACHE_GHA_SCOPE_IT }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }}" From 63d12159af4f42e50bc8e13db5166d7e68ff033a Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 21 Mar 2022 18:48:42 +0100 Subject: [PATCH 15/21] control: add info service Signed-off-by: CrazyMax (cherry picked from commit 859ad497fd8b36a5dded0970a8cc62d5cba78081) Signed-off-by: Sebastiaan van Stijn --- api/services/control/control.pb.go | 841 +++++++++++++++++++++++++---- api/services/control/control.proto | 14 +- client/client_test.go | 9 + client/info.go | 32 ++ cmd/buildctl/debug.go | 1 + cmd/buildctl/debug/info.go | 30 + control/control.go | 14 +- 7 files changed, 840 insertions(+), 101 deletions(-) create mode 100644 client/info.go create mode 100644 cmd/buildctl/debug/info.go diff --git a/api/services/control/control.pb.go b/api/services/control/control.pb.go index 939f2c2ca7d8..8a9a29826375 100644 --- a/api/services/control/control.pb.go +++ b/api/services/control/control.pb.go @@ -1240,6 +1240,155 @@ func (m *ListWorkersResponse) GetRecord() []*types.WorkerRecord { return nil } +type Version struct { + Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{17} +} +func (m *Version) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Version.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Version) XXX_Merge(src proto.Message) { + xxx_messageInfo_Version.Merge(m, src) +} +func (m *Version) XXX_Size() int { + return m.Size() +} +func (m *Version) XXX_DiscardUnknown() { + xxx_messageInfo_Version.DiscardUnknown(m) +} + +var xxx_messageInfo_Version proto.InternalMessageInfo + +func (m *Version) GetPackage() string { + if m != nil { + return m.Package + } + return "" +} + +func (m *Version) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Version) GetRevision() string { + if m != nil { + return m.Revision + } + return "" +} + +type InfoRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InfoRequest) Reset() { *m = InfoRequest{} } +func (m *InfoRequest) String() string { return proto.CompactTextString(m) } +func (*InfoRequest) ProtoMessage() {} +func (*InfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{18} +} +func (m *InfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InfoRequest.Merge(m, src) +} +func (m *InfoRequest) XXX_Size() int { + return m.Size() +} +func (m *InfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_InfoRequest proto.InternalMessageInfo + +type InfoResponse struct { + BuildkitVersion *Version `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InfoResponse) Reset() { *m = InfoResponse{} } +func (m *InfoResponse) String() string { return proto.CompactTextString(m) } +func (*InfoResponse) ProtoMessage() {} +func (*InfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{19} +} +func (m *InfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InfoResponse.Merge(m, src) +} +func (m *InfoResponse) XXX_Size() int { + return m.Size() +} +func (m *InfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_InfoResponse proto.InternalMessageInfo + +func (m *InfoResponse) GetBuildkitVersion() *Version { + if m != nil { + return m.BuildkitVersion + } + return nil +} + func init() { proto.RegisterType((*PruneRequest)(nil), "moby.buildkit.v1.PruneRequest") proto.RegisterType((*DiskUsageRequest)(nil), "moby.buildkit.v1.DiskUsageRequest") @@ -1264,109 +1413,118 @@ func init() { proto.RegisterType((*BytesMessage)(nil), "moby.buildkit.v1.BytesMessage") proto.RegisterType((*ListWorkersRequest)(nil), "moby.buildkit.v1.ListWorkersRequest") proto.RegisterType((*ListWorkersResponse)(nil), "moby.buildkit.v1.ListWorkersResponse") + proto.RegisterType((*Version)(nil), "moby.buildkit.v1.Version") + proto.RegisterType((*InfoRequest)(nil), "moby.buildkit.v1.InfoRequest") + proto.RegisterType((*InfoResponse)(nil), "moby.buildkit.v1.InfoResponse") } func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } var fileDescriptor_0c5120591600887d = []byte{ - // 1543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xef, 0xda, 0xf1, 0xd7, 0x8b, 0x13, 0xa5, 0xd3, 0x52, 0xad, 0x16, 0x91, 0xa4, 0xdb, 0x22, - 0x45, 0x55, 0xbb, 0x4e, 0x03, 0x85, 0x12, 0x3e, 0xd4, 0x3a, 0x2e, 0x34, 0x55, 0x23, 0xca, 0xa4, - 0xa5, 0x52, 0x0f, 0x48, 0x6b, 0x7b, 0xbc, 0x59, 0x65, 0xbd, 0xb3, 0xcc, 0xcc, 0xa6, 0x35, 0x7f, - 0x00, 0x67, 0x6e, 0xfc, 0x01, 0x1c, 0x38, 0x71, 0xe6, 0x2f, 0x40, 0xea, 0x91, 0x73, 0x0f, 0x01, - 0xf5, 0x0e, 0xe2, 0xc8, 0x11, 0xcd, 0xc7, 0x3a, 0xeb, 0xd8, 0xce, 0x57, 0x39, 0x79, 0xde, 0xcc, - 0x7b, 0xbf, 0x7d, 0x9f, 0x33, 0xef, 0x19, 0xe6, 0x3a, 0x34, 0x16, 0x8c, 0x46, 0x5e, 0xc2, 0xa8, - 0xa0, 0x68, 0xa1, 0x4f, 0xdb, 0x03, 0xaf, 0x9d, 0x86, 0x51, 0x77, 0x37, 0x14, 0xde, 0xde, 0x4d, - 0xe7, 0x46, 0x10, 0x8a, 0x9d, 0xb4, 0xed, 0x75, 0x68, 0xbf, 0x11, 0xd0, 0x80, 0x36, 0x14, 0x63, - 0x3b, 0xed, 0x29, 0x4a, 0x11, 0x6a, 0xa5, 0x01, 0x9c, 0xa5, 0x80, 0xd2, 0x20, 0x22, 0x07, 0x5c, - 0x22, 0xec, 0x13, 0x2e, 0xfc, 0x7e, 0x62, 0x18, 0xae, 0xe7, 0xf0, 0xe4, 0xc7, 0x1a, 0xd9, 0xc7, - 0x1a, 0x9c, 0x46, 0x7b, 0x84, 0x35, 0x92, 0x76, 0x83, 0x26, 0xdc, 0x70, 0x37, 0xa6, 0x72, 0xfb, - 0x49, 0xd8, 0x10, 0x83, 0x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 0x93, 0x29, 0x55, 0x54, 0x30, 0x43, 0x1a, 0x3d, 0x85, 0xb9, 0x6c, 0x7d, 0x57, 0x08, 0x26, 0x13, - 0x55, 0xa6, 0xd1, 0xcd, 0xf1, 0x34, 0xca, 0x2b, 0xe5, 0x8d, 0xc8, 0xdc, 0x8b, 0x05, 0x1b, 0xe0, - 0x51, 0x1c, 0x69, 0xe1, 0x36, 0xe1, 0x5c, 0x6a, 0xa8, 0xc2, 0x8f, 0x33, 0x52, 0xaa, 0xf3, 0x39, - 0xa3, 0xb1, 0x20, 0x71, 0x57, 0x85, 0xbe, 0x86, 0x87, 0xb4, 0x54, 0x27, 0x5b, 0x6b, 0x75, 0x2a, - 0x27, 0x52, 0x67, 0x44, 0xc6, 0xa8, 0x33, 0xb2, 0x87, 0xd6, 0xa1, 0xb4, 0xe1, 0x77, 0x76, 0x88, - 0x8a, 0xf2, 0xec, 0xda, 0xe2, 0x38, 0xa0, 0x3a, 0xfe, 0x52, 0x85, 0x95, 0xab, 0x42, 0x3d, 0x87, - 0xb5, 0x08, 0xfa, 0x06, 0xea, 0xf7, 0x62, 0x11, 0x8a, 0x88, 0xf4, 0x55, 0xc4, 0x6a, 0x32, 0x62, - 0xcd, 0xf5, 0x57, 0xfb, 0x4b, 0x1f, 0x4c, 0xbd, 0x78, 0x52, 0x11, 0x46, 0x0d, 0x92, 0x93, 0xf2, - 0x72, 0x10, 0x78, 0x04, 0x0f, 0x3d, 0x83, 0xf9, 0x4c, 0xd9, 0xcd, 0x38, 0x49, 0x05, 0xb7, 0x41, - 0x59, 0xbd, 0x76, 0x42, 0xab, 0xb5, 0x90, 0x36, 0xfb, 0x10, 0x92, 0x73, 0x07, 0xd0, 0x78, 0xac, - 0x64, 0x4e, 0xed, 0x92, 0x41, 0x96, 0x53, 0xbb, 0x64, 0x20, 0xcb, 0x7a, 0xcf, 0x8f, 0x52, 0x5d, - 0xee, 0x35, 0xac, 0x89, 0xf5, 0xc2, 0x6d, 0x4b, 0x22, 0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0x0c, 0x1a, 0x6c, 0xd5, 0x42, 0x5b, 0xc3, 0x09, 0x6a, 0x92, 0x6a, 0xf9, 0x34, 0x70, 0x8e, - 0x39, 0x5f, 0xb1, 0x56, 0x2d, 0xf4, 0x0c, 0x66, 0x73, 0x81, 0x46, 0x13, 0x02, 0x3a, 0x9e, 0x35, - 0xce, 0xbb, 0xc7, 0x70, 0x69, 0x65, 0x9b, 0xf5, 0x97, 0xaf, 0x17, 0xad, 0xdf, 0x5f, 0x2f, 0x5a, - 0x7f, 0xbe, 0x5e, 0xb4, 0xda, 0x65, 0x55, 0xf2, 0xef, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x54, - 0x8e, 0x72, 0x11, 0x36, 0x12, 0x00, 0x00, + // 1635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0x1b, 0x47, + 0x16, 0x76, 0x73, 0xe7, 0x23, 0xa5, 0x91, 0xcb, 0x1e, 0xa3, 0xa7, 0x07, 0x23, 0xc9, 0x6d, 0x0f, + 0x20, 0x18, 0x76, 0x53, 0xe6, 0x8c, 0x67, 0x3c, 0x9a, 0x05, 0x36, 0x45, 0xcd, 0x58, 0x86, 0x85, + 0xf1, 0x14, 0xbd, 0x60, 0x7c, 0x08, 0xd0, 0x24, 0x4b, 0x54, 0x43, 0xcd, 0xae, 0x4e, 0x55, 0xb5, + 0x6c, 0xe5, 0x07, 0xe4, 0x9c, 0x5b, 0x7e, 0x40, 0x0e, 0x39, 0xe5, 0x16, 0x20, 0xbf, 0x20, 0x80, + 0x8f, 0x39, 0xfb, 0xa0, 0x04, 0xfe, 0x01, 0x41, 0x8e, 0x39, 0x06, 0xb5, 0x34, 0xd5, 0xdc, 0xb4, + 0x39, 0x27, 0xd6, 0xab, 0x7a, 0xef, 0xeb, 0xb7, 0x56, 0xbd, 0x47, 0x58, 0xe8, 0xd1, 0x48, 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x6b, 0x13, 0xde, 0x63, 0x41, 0xac, + 0x42, 0x5d, 0x55, 0xee, 0xc9, 0x6e, 0x49, 0x04, 0xed, 0xc1, 0x67, 0x87, 0x31, 0xb1, 0x41, 0x31, + 0x64, 0x76, 0x64, 0x2c, 0x3b, 0x7b, 0x3e, 0x23, 0x7d, 0xbb, 0xa6, 0xdc, 0x65, 0x28, 0xe9, 0x5f, + 0xed, 0x09, 0x6e, 0xd7, 0x55, 0x90, 0x53, 0xd2, 0xfd, 0xa2, 0x04, 0xf5, 0x8e, 0xcc, 0xf1, 0x34, + 0x1d, 0x96, 0x20, 0x8f, 0xc9, 0xae, 0x89, 0x8d, 0x5c, 0x22, 0x0f, 0xa0, 0x4d, 0x76, 0x83, 0x28, + 0x50, 0x5a, 0xe5, 0x94, 0xe1, 0x8b, 0x5e, 0xdc, 0xf5, 0x8e, 0x77, 0x71, 0x86, 0x03, 0x39, 0x50, + 0xd9, 0x7a, 0x13, 0x53, 0x26, 0x53, 0x2a, 0xaf, 0x60, 0x46, 0x34, 0x7a, 0x09, 0x0b, 0xe9, 0xfa, + 0xa1, 0x10, 0x4c, 0x26, 0xaa, 0x4c, 0xa3, 0xbb, 0xd3, 0x69, 0x94, 0x55, 0xca, 0x1b, 0x93, 0xd9, + 0x8a, 0x04, 0x3b, 0xc4, 0xe3, 0x38, 0xd2, 0xc2, 0x0e, 0xe1, 0x5c, 0x6a, 0xa8, 0xc2, 0x8f, 0x53, + 0x52, 0xaa, 0xf3, 0x6f, 0x46, 0x23, 0x41, 0xa2, 0xbe, 0x0a, 0x7d, 0x15, 0x8f, 0x68, 0xa9, 0x4e, + 0xba, 0xd6, 0xea, 0x94, 0xcf, 0xa4, 0xce, 0x98, 0x8c, 0x51, 0x67, 0x6c, 0x0f, 0x6d, 0x40, 0x71, + 0xd3, 0xef, 0xed, 0x11, 0x15, 0xe5, 0x5a, 0x73, 0x79, 0x1a, 0x50, 0x1d, 0xff, 0x57, 0x85, 0x95, + 0xab, 0x42, 0xbd, 0x84, 0xb5, 0x08, 0xfa, 0x08, 0xea, 0x5b, 0x91, 0x08, 0x44, 0x48, 0x86, 0x2a, + 0x62, 0x55, 0x19, 0xb1, 0xd6, 0xc6, 0xbb, 0xa3, 0x95, 0xbf, 0xcc, 0xbd, 0x78, 0x12, 0x11, 0x84, + 0x0d, 0x92, 0x91, 0xf2, 0x32, 0x10, 0x78, 0x0c, 0x0f, 0xbd, 0x82, 0xc5, 0x54, 0xd9, 0xed, 0x28, + 0x4e, 0x04, 0xb7, 0x41, 0x59, 0xdd, 0x3c, 0xa3, 0xd5, 0x5a, 0x48, 0x9b, 0x3d, 0x81, 0xe4, 0x3c, + 0x00, 0x34, 0x1d, 0x2b, 0x99, 0x53, 0xfb, 0xe4, 0x30, 0xcd, 0xa9, 0x7d, 0x72, 0x28, 0xcb, 0xfa, + 0xc0, 0x0f, 0x13, 0x5d, 0xee, 0x55, 0xac, 0x89, 0x8d, 0xdc, 0x7d, 0x4b, 0x22, 0x4c, 0xbb, 0xf7, + 0x5c, 0x08, 0xff, 0x83, 0x2b, 0x33, 0x54, 0x9d, 0x01, 0x71, 0x33, 0x0b, 0x31, 0x9d, 0xd3, 0xc7, + 0x90, 0xee, 0x57, 0x79, 0xa8, 0x67, 0x03, 0x86, 0xd6, 0xe1, 0x8a, 0xb6, 0x13, 0x93, 0xdd, 0x36, + 0x89, 0x19, 0xe9, 0xc9, 0x5b, 0xc2, 0x80, 0xcf, 0x3a, 0x42, 0x4d, 0xb8, 0xba, 0x3d, 0x34, 0xdb, + 0x3c, 0x23, 0x92, 0x53, 0xf5, 0x38, 0xf3, 0x0c, 0x51, 0xf8, 0xad, 0x86, 0x52, 0x9e, 0xc8, 0x08, + 0xe5, 0x55, 0xc0, 0xfe, 0x76, 0x72, 0x56, 0x79, 0x33, 0x65, 0x75, 0xdc, 0x66, 0xe3, 0xa2, 0x7f, + 0x42, 0x59, 0x1f, 0xa4, 0x85, 0x79, 0xe3, 0xe4, 0x4f, 0x68, 0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0x26, 0x4f, 0xd1, 0x8c, 0x7c, 0x9c, 0x4e, 0x7a, 0xe7, 0x8f, 0xa7, + 0x70, 0x19, 0xcb, 0xb7, 0xa0, 0x20, 0x93, 0x08, 0xcd, 0x70, 0x76, 0x26, 0xd7, 0x66, 0xa9, 0x99, + 0xcd, 0xbd, 0x56, 0xfd, 0xed, 0xfb, 0x65, 0xeb, 0xbb, 0xf7, 0xcb, 0xd6, 0x0f, 0xef, 0x97, 0xad, + 0x6e, 0x49, 0x5d, 0x7c, 0x7f, 0xfa, 0x25, 0x00, 0x00, 0xff, 0xff, 0x52, 0xcc, 0x4a, 0x01, 0x3c, + 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1387,6 +1545,7 @@ type ControlClient interface { Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (Control_StatusClient, error) Session(ctx context.Context, opts ...grpc.CallOption) (Control_SessionClient, error) ListWorkers(ctx context.Context, in *ListWorkersRequest, opts ...grpc.CallOption) (*ListWorkersResponse, error) + Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) } type controlClient struct { @@ -1519,6 +1678,15 @@ func (c *controlClient) ListWorkers(ctx context.Context, in *ListWorkersRequest, return out, nil } +func (c *controlClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + out := new(InfoResponse) + err := c.cc.Invoke(ctx, "/moby.buildkit.v1.Control/Info", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ControlServer is the server API for Control service. type ControlServer interface { DiskUsage(context.Context, *DiskUsageRequest) (*DiskUsageResponse, error) @@ -1527,6 +1695,7 @@ type ControlServer interface { Status(*StatusRequest, Control_StatusServer) error Session(Control_SessionServer) error ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) + Info(context.Context, *InfoRequest) (*InfoResponse, error) } // UnimplementedControlServer can be embedded to have forward compatible implementations. @@ -1551,6 +1720,9 @@ func (*UnimplementedControlServer) Session(srv Control_SessionServer) error { func (*UnimplementedControlServer) ListWorkers(ctx context.Context, req *ListWorkersRequest) (*ListWorkersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListWorkers not implemented") } +func (*UnimplementedControlServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} func RegisterControlServer(s *grpc.Server, srv ControlServer) { s.RegisterService(&_Control_serviceDesc, srv) @@ -1678,6 +1850,24 @@ func _Control_ListWorkers_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Control_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControlServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/moby.buildkit.v1.Control/Info", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControlServer).Info(ctx, req.(*InfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Control_serviceDesc = grpc.ServiceDesc{ ServiceName: "moby.buildkit.v1.Control", HandlerType: (*ControlServer)(nil), @@ -1694,6 +1884,10 @@ var _Control_serviceDesc = grpc.ServiceDesc{ MethodName: "ListWorkers", Handler: _Control_ListWorkers_Handler, }, + { + MethodName: "Info", + Handler: _Control_Info_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -2865,6 +3059,120 @@ func (m *ListWorkersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Version) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Version) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Revision) > 0 { + i -= len(m.Revision) + copy(dAtA[i:], m.Revision) + i = encodeVarintControl(dAtA, i, uint64(len(m.Revision))) + i-- + dAtA[i] = 0x1a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintControl(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Package) > 0 { + i -= len(m.Package) + copy(dAtA[i:], m.Package) + i = encodeVarintControl(dAtA, i, uint64(len(m.Package))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *InfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.BuildkitVersion != nil { + { + size, err := m.BuildkitVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintControl(dAtA []byte, offset int, v uint64) int { offset -= sovControl(v) base := offset @@ -3406,6 +3714,58 @@ func (m *ListWorkersResponse) Size() (n int) { return n } +func (m *Version) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Package) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + l = len(m.Revision) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *InfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *InfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BuildkitVersion != nil { + l = m.BuildkitVersion.Size() + n += 1 + l + sovControl(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovControl(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7019,6 +7379,291 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *Version) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Version: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Package = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Revision = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildkitVersion", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BuildkitVersion == nil { + m.BuildkitVersion = &Version{} + } + if err := m.BuildkitVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipControl(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/api/services/control/control.proto b/api/services/control/control.proto index a468a293af88..f62efe3d1940 100644 --- a/api/services/control/control.proto +++ b/api/services/control/control.proto @@ -18,7 +18,7 @@ service Control { rpc Status(StatusRequest) returns (stream StatusResponse); rpc Session(stream BytesMessage) returns (stream BytesMessage); rpc ListWorkers(ListWorkersRequest) returns (ListWorkersResponse); - // rpc Info(InfoRequest) returns (InfoResponse); + rpc Info(InfoRequest) returns (InfoResponse); } message PruneRequest { @@ -157,3 +157,15 @@ message ListWorkersRequest { message ListWorkersResponse { repeated moby.buildkit.v1.types.WorkerRecord record = 1; } + +message Version { + string package = 1; + string version = 2; + string revision = 3; +} + +message InfoRequest {} + +message InfoResponse { + Version buildkitVersion = 1; +} diff --git a/client/client_test.go b/client/client_test.go index 9f41cad1ad35..a7b45dcd4798 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -160,6 +160,7 @@ func TestIntegration(t *testing.T) { testUncompressedLocalCacheImportExport, testUncompressedRegistryCacheImportExport, testStargzLazyRegistryCacheImportExport, + testCallInfo, ) tests = append(tests, diffOpTestCases()...) integration.Run(t, tests, mirrors) @@ -5727,6 +5728,14 @@ func testBuildInfoNoExport(t *testing.T, sb integration.Sandbox) { require.Equal(t, exbi.Sources[0].Ref, "docker.io/library/busybox:latest") } +func testCallInfo(t *testing.T, sb integration.Sandbox) { + c, err := New(sb.Context(), sb.Address()) + require.NoError(t, err) + defer c.Close() + _, err = c.Info(sb.Context()) + require.NoError(t, err) +} + func tmpdir(appliers ...fstest.Applier) (string, error) { tmpdir, err := os.MkdirTemp("", "buildkit-client") if err != nil { diff --git a/client/info.go b/client/info.go new file mode 100644 index 000000000000..71f27c86ec0f --- /dev/null +++ b/client/info.go @@ -0,0 +1,32 @@ +package client + +import ( + "context" + + controlapi "github.com/moby/buildkit/api/services/control" + "github.com/pkg/errors" +) + +type InfoResponse struct { + BuildkitVersion Version +} + +func (c *Client) Info(ctx context.Context) (*InfoResponse, error) { + res, err := c.controlClient().Info(ctx, &controlapi.InfoRequest{}) + if err != nil { + return nil, errors.Wrap(err, "failed to call info") + } + return &InfoResponse{ + BuildkitVersion: Version{ + Package: res.BuildkitVersion.Package, + Version: res.BuildkitVersion.Version, + Revision: res.BuildkitVersion.Revision, + }, + }, nil +} + +type Version struct { + Package string + Version string + Revision string +} diff --git a/cmd/buildctl/debug.go b/cmd/buildctl/debug.go index a6a33b6f8882..2db7a6cfb6a2 100644 --- a/cmd/buildctl/debug.go +++ b/cmd/buildctl/debug.go @@ -12,5 +12,6 @@ var debugCommand = cli.Command{ debug.DumpLLBCommand, debug.DumpMetadataCommand, debug.WorkersCommand, + debug.InfoCommand, }, } diff --git a/cmd/buildctl/debug/info.go b/cmd/buildctl/debug/info.go new file mode 100644 index 000000000000..6e9af149c844 --- /dev/null +++ b/cmd/buildctl/debug/info.go @@ -0,0 +1,30 @@ +package debug + +import ( + "fmt" + "os" + "text/tabwriter" + + bccommon "github.com/moby/buildkit/cmd/buildctl/common" + "github.com/urfave/cli" +) + +var InfoCommand = cli.Command{ + Name: "info", + Usage: "display internal information", + Action: info, +} + +func info(clicontext *cli.Context) error { + c, err := bccommon.ResolveClient(clicontext) + if err != nil { + return err + } + res, err := c.Info(bccommon.CommandContext(clicontext)) + if err != nil { + return err + } + w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) + _, _ = fmt.Fprintf(w, "BuildKit:\t%s %s %s\n", res.BuildkitVersion.Package, res.BuildkitVersion.Version, res.BuildkitVersion.Revision) + return w.Flush() +} diff --git a/control/control.go b/control/control.go index 0d3e7976e5b7..7cb6d7436897 100644 --- a/control/control.go +++ b/control/control.go @@ -6,8 +6,6 @@ import ( "sync/atomic" "time" - "github.com/moby/buildkit/util/bklog" - controlapi "github.com/moby/buildkit/api/services/control" apitypes "github.com/moby/buildkit/api/types" "github.com/moby/buildkit/cache/remotecache" @@ -20,9 +18,11 @@ import ( "github.com/moby/buildkit/solver" "github.com/moby/buildkit/solver/llbsolver" "github.com/moby/buildkit/solver/pb" + "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/imageutil" "github.com/moby/buildkit/util/throttle" "github.com/moby/buildkit/util/tracing/transform" + "github.com/moby/buildkit/version" "github.com/moby/buildkit/worker" "github.com/pkg/errors" sdktrace "go.opentelemetry.io/otel/sdk/trace" @@ -435,6 +435,16 @@ func (c *Controller) ListWorkers(ctx context.Context, r *controlapi.ListWorkersR return resp, nil } +func (c *Controller) Info(ctx context.Context, r *controlapi.InfoRequest) (*controlapi.InfoResponse, error) { + return &controlapi.InfoResponse{ + BuildkitVersion: &controlapi.Version{ + Package: version.Package, + Version: version.Version, + Revision: version.Revision, + }, + }, nil +} + func (c *Controller) gc() { c.gcmu.Lock() defer c.gcmu.Unlock() From 4723645f8be13747a6523e6aa640715144558d47 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 8 Apr 2022 13:06:18 +0200 Subject: [PATCH 16/21] control: add buildkit version to worker record Signed-off-by: CrazyMax (cherry picked from commit d2a757f862957bf8a4cfb6f1bb990fa6dc33d153) Signed-off-by: Sebastiaan van Stijn --- api/services/control/control.pb.go | 504 +++++------------------- api/services/control/control.proto | 8 +- api/types/worker.pb.go | 394 ++++++++++++++++-- api/types/worker.proto | 7 + client/info.go | 34 +- client/workers.go | 18 +- cmd/buildctl/debug/workers.go | 1 + cmd/buildkitd/main.go | 8 + cmd/buildkitd/main_containerd_worker.go | 1 + cmd/buildkitd/main_oci_worker.go | 1 + control/control.go | 19 +- worker/base/worker.go | 5 + worker/worker.go | 1 + worker/workercontroller.go | 7 +- 14 files changed, 553 insertions(+), 455 deletions(-) diff --git a/api/services/control/control.pb.go b/api/services/control/control.pb.go index 8a9a29826375..98208cf7a7d9 100644 --- a/api/services/control/control.pb.go +++ b/api/services/control/control.pb.go @@ -1240,69 +1240,6 @@ func (m *ListWorkersResponse) GetRecord() []*types.WorkerRecord { return nil } -type Version struct { - Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{17} -} -func (m *Version) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} -func (m *Version) XXX_Size() int { - return m.Size() -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) -} - -var xxx_messageInfo_Version proto.InternalMessageInfo - -func (m *Version) GetPackage() string { - if m != nil { - return m.Package - } - return "" -} - -func (m *Version) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *Version) GetRevision() string { - if m != nil { - return m.Revision - } - return "" -} - type InfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1313,7 +1250,7 @@ func (m *InfoRequest) Reset() { *m = InfoRequest{} } func (m *InfoRequest) String() string { return proto.CompactTextString(m) } func (*InfoRequest) ProtoMessage() {} func (*InfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{18} + return fileDescriptor_0c5120591600887d, []int{17} } func (m *InfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1343,17 +1280,17 @@ func (m *InfoRequest) XXX_DiscardUnknown() { var xxx_messageInfo_InfoRequest proto.InternalMessageInfo type InfoResponse struct { - BuildkitVersion *Version `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + BuildkitVersion *types.BuildkitVersion `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *InfoResponse) Reset() { *m = InfoResponse{} } func (m *InfoResponse) String() string { return proto.CompactTextString(m) } func (*InfoResponse) ProtoMessage() {} func (*InfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{19} + return fileDescriptor_0c5120591600887d, []int{18} } func (m *InfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1382,7 +1319,7 @@ func (m *InfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_InfoResponse proto.InternalMessageInfo -func (m *InfoResponse) GetBuildkitVersion() *Version { +func (m *InfoResponse) GetBuildkitVersion() *types.BuildkitVersion { if m != nil { return m.BuildkitVersion } @@ -1413,7 +1350,6 @@ func init() { proto.RegisterType((*BytesMessage)(nil), "moby.buildkit.v1.BytesMessage") proto.RegisterType((*ListWorkersRequest)(nil), "moby.buildkit.v1.ListWorkersRequest") proto.RegisterType((*ListWorkersResponse)(nil), "moby.buildkit.v1.ListWorkersResponse") - proto.RegisterType((*Version)(nil), "moby.buildkit.v1.Version") proto.RegisterType((*InfoRequest)(nil), "moby.buildkit.v1.InfoRequest") proto.RegisterType((*InfoResponse)(nil), "moby.buildkit.v1.InfoResponse") } @@ -1421,110 +1357,107 @@ func init() { func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } var fileDescriptor_0c5120591600887d = []byte{ - // 1635 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0x1b, 0x47, - 0x16, 0x76, 0x73, 0xe7, 0x23, 0xa5, 0x91, 0xcb, 0x1e, 0xa3, 0xa7, 0x07, 0x23, 0xc9, 0x6d, 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b, 0xb9, 0xd3, 0x20, 0x93, 0xe3, 0xbb, 0x73, 0xe3, 0x44, 0x1e, - 0xa3, 0xe6, 0x23, 0x28, 0xaa, 0xff, 0x1f, 0xd0, 0x8c, 0x67, 0x33, 0xfb, 0xc7, 0x84, 0x73, 0xf2, - 0x3c, 0xbf, 0x6e, 0x49, 0x24, 0xd5, 0x73, 0xcc, 0x42, 0xca, 0x4e, 0x0b, 0xce, 0xca, 0x29, 0xcd, - 0x0a, 0xda, 0x81, 0x92, 0xb9, 0x88, 0x67, 0xb1, 0x66, 0x3b, 0x0b, 0x67, 0x75, 0x3e, 0x83, 0x06, - 0x5b, 0xb7, 0xd0, 0xce, 0x68, 0x00, 0x9c, 0xa5, 0x5a, 0x36, 0x8b, 0x9d, 0x53, 0xce, 0xd7, 0xac, - 0x75, 0x0b, 0xbd, 0x82, 0x5a, 0x26, 0x4f, 0xd1, 0x8c, 0x7c, 0x9c, 0x4e, 0x7a, 0xe7, 0x8f, 0xa7, - 0x70, 0x19, 0xcb, 0xb7, 0xa0, 0x20, 0x93, 0x08, 0xcd, 0x70, 0x76, 0x26, 0xd7, 0x66, 0xa9, 0x99, - 0xcd, 0xbd, 0x56, 0xfd, 0xed, 0xfb, 0x65, 0xeb, 0xbb, 0xf7, 0xcb, 0xd6, 0x0f, 0xef, 0x97, 0xad, - 0x6e, 0x49, 0x5d, 0x7c, 0x7f, 0xfa, 0x25, 0x00, 0x00, 0xff, 0xff, 0x52, 0xcc, 0x4a, 0x01, 0x3c, - 0x13, 0x00, 0x00, + // 1597 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcb, 0x6e, 0x1c, 0x45, + 0x17, 0x4e, 0xcf, 0x7d, 0xce, 0x8c, 0xfd, 0x3b, 0x95, 0xfc, 0x51, 0xab, 0x7f, 0xfd, 0xb6, 0xd3, + 0x09, 0xc2, 0x8a, 0x92, 0x1e, 0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50, 0x13, 0xaa, 0x6b, 0x8c, 0xf8, 0x82, 0x74, 0xef, 0x0a, 0xbb, 0xb4, 0x68, 0x2d, 0xd5, + 0x56, 0x1c, 0x4f, 0x93, 0xc2, 0x4b, 0x49, 0xe1, 0x3d, 0x4e, 0x49, 0xd1, 0xac, 0xbc, 0x3a, 0x58, + 0x38, 0xf7, 0xdd, 0xef, 0x32, 0x77, 0x03, 0x33, 0x74, 0x07, 0xe0, 0x81, 0xcf, 0xc5, 0x13, 0xae, + 0x40, 0xca, 0xc7, 0x82, 0x14, 0x14, 0x40, 0xc6, 0x06, 0xcd, 0x03, 0xa8, 0x24, 0xac, 0xd1, 0x24, + 0x12, 0x76, 0x45, 0xf9, 0x9e, 0x99, 0x41, 0x8b, 0x50, 0x6b, 0x11, 0xde, 0x61, 0x41, 0xac, 0x4a, + 0x5d, 0x55, 0xe9, 0xc9, 0x4e, 0x49, 0x04, 0x9d, 0xc1, 0xc7, 0xfb, 0x31, 0xb1, 0x41, 0x29, 0x64, + 0x66, 0x64, 0x2d, 0xb7, 0x76, 0x7c, 0x46, 0xba, 0x76, 0x4d, 0xa5, 0xcb, 0x48, 0x32, 0xbf, 0x3a, + 0x13, 0xdc, 0xae, 0xab, 0x22, 0xa7, 0xa2, 0xfb, 0x43, 0x09, 0xea, 0x5b, 0x92, 0xe3, 0x29, 0x1d, + 0xe6, 0x20, 0x8f, 0xc9, 0xb6, 0xa9, 0x8d, 0x1c, 0x22, 0x0f, 0xa0, 0x45, 0xb6, 0x83, 0x28, 0x50, + 0x5e, 0xe5, 0x54, 0xe0, 0xb3, 0x5e, 0xdc, 0xf6, 0x0e, 0x67, 0x71, 0x46, 0x03, 0x39, 0x50, 0x59, + 0x7f, 0x19, 0x53, 0x26, 0x29, 0x95, 0x57, 0x30, 0x03, 0x19, 0x3d, 0x83, 0x99, 0x74, 0x7c, 0x57, + 0x08, 0x26, 0x89, 0x2a, 0x69, 0x74, 0x73, 0x9c, 0x46, 0x59, 0xa7, 0xb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 0x56, + 0x15, 0x6b, 0x01, 0x7d, 0x08, 0x33, 0x31, 0xa3, 0x3d, 0x46, 0x38, 0xff, 0x82, 0xd1, 0x24, 0x36, + 0x37, 0xec, 0x79, 0x79, 0x78, 0x3f, 0xcc, 0x2e, 0xe0, 0x61, 0x3d, 0xf7, 0xcf, 0x1c, 0xd4, 0xb3, + 0x14, 0x19, 0x6b, 0x42, 0xef, 0x43, 0x49, 0x13, 0x4e, 0x73, 0xfd, 0x6c, 0x39, 0xd6, 0x08, 0x13, + 0x73, 0x6c, 0x43, 0xb9, 0x93, 0x30, 0xd5, 0xa1, 0xea, 0xbe, 0x35, 0x15, 0x65, 0xa4, 0x82, 0x0a, + 0x3f, 0x54, 0x39, 0xce, 0x63, 0x2d, 0xc8, 0xa6, 0x75, 0xf0, 0x4e, 0x39, 0x5d, 0xd3, 0x3a, 0x30, + 0xcb, 0xd6, 0xaf, 0xfc, 0x56, 0xf5, 0xab, 0x9c, 0xba, 0x7e, 0xee, 0xaf, 0x16, 0x54, 0x07, 0x7b, + 0x2b, 0x93, 0x5d, 0xeb, 0xad, 0xb3, 0x3b, 0x94, 0x99, 0xdc, 0xd9, 0x32, 0x73, 0x09, 0x4a, 0x5c, + 0x30, 0xe2, 0xf7, 0xf5, 0x93, 0x0a, 0x1b, 0x49, 0x9e, 0x62, 0x7d, 0xde, 0x53, 0x15, 0xaa, 0x63, + 0x39, 0x74, 0xff, 0xb6, 0x60, 0x66, 0x68, 0xbb, 0xff, 0xab, 0xb1, 0x5c, 0x84, 0x62, 0x48, 0xf6, + 0x88, 0x7e, 0xf4, 0xe5, 0xb1, 0x16, 0xe4, 0x2c, 0xdf, 0xa1, 0x4c, 0x28, 0xe7, 0xea, 0x58, 0x0b, + 0xd2, 0xe7, 0x2e, 0x11, 0x7e, 0x10, 0xaa, 0x73, 0xa9, 0x8e, 0x8d, 0x24, 0x7d, 0x4e, 0x58, 0x68, + 0x1a, 0x5f, 0x39, 0x44, 0x2e, 0x14, 0x82, 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 0xc9, 0x9c, + 0x9d, 0x93, 0x54, 0xb3, 0xcd, 0x80, 0xb3, 0x38, 0x5d, 0x41, 0x83, 0x2d, 0x5b, 0x68, 0x73, 0xf0, + 0x66, 0x9b, 0xe4, 0x5a, 0x96, 0x78, 0xce, 0x31, 0xeb, 0x4b, 0xd6, 0xb2, 0x85, 0x9e, 0x43, 0x2d, + 0x43, 0x2d, 0x34, 0x81, 0x42, 0xe3, 0x3c, 0x75, 0xde, 0x39, 0x46, 0xcb, 0x44, 0xbe, 0x0e, 0x05, + 0x49, 0x29, 0x34, 0x21, 0xd9, 0x19, 0xe6, 0x4d, 0x72, 0x33, 0xcb, 0xc4, 0x66, 0xfd, 0xd5, 0x9b, + 0x79, 0xeb, 0xb7, 0x37, 0xf3, 0xd6, 0x1f, 0x6f, 0xe6, 0xad, 0x76, 0x49, 0x9d, 0x55, 0xef, 0xfd, + 0x13, 0x00, 0x00, 0xff, 0xff, 0x96, 0x5c, 0xf7, 0x1b, 0xef, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3059,54 +2992,6 @@ func (m *ListWorkersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Version) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Version) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Revision) > 0 { - i -= len(m.Revision) - copy(dAtA[i:], m.Revision) - i = encodeVarintControl(dAtA, i, uint64(len(m.Revision))) - i-- - dAtA[i] = 0x1a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintControl(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Package) > 0 { - i -= len(m.Package) - copy(dAtA[i:], m.Package) - i = encodeVarintControl(dAtA, i, uint64(len(m.Package))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3714,30 +3599,6 @@ func (m *ListWorkersResponse) Size() (n int) { return n } -func (m *Version) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Package) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.Revision) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *InfoRequest) Size() (n int) { if m == nil { return 0 @@ -7379,153 +7240,6 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Version) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Version: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Package = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Revision = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *InfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7636,7 +7350,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.BuildkitVersion == nil { - m.BuildkitVersion = &Version{} + m.BuildkitVersion = &types.BuildkitVersion{} } if err := m.BuildkitVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/api/services/control/control.proto b/api/services/control/control.proto index f62efe3d1940..6f5c976bce51 100644 --- a/api/services/control/control.proto +++ b/api/services/control/control.proto @@ -158,14 +158,8 @@ message ListWorkersResponse { repeated moby.buildkit.v1.types.WorkerRecord record = 1; } -message Version { - string package = 1; - string version = 2; - string revision = 3; -} - message InfoRequest {} message InfoResponse { - Version buildkitVersion = 1; + moby.buildkit.v1.types.BuildkitVersion buildkitVersion = 1; } diff --git a/api/types/worker.pb.go b/api/types/worker.pb.go index 54cbd605e14c..e1b3928cba52 100644 --- a/api/types/worker.pb.go +++ b/api/types/worker.pb.go @@ -29,6 +29,7 @@ type WorkerRecord struct { Labels map[string]string `protobuf:"bytes,2,rep,name=Labels,proto3" json:"Labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Platforms []pb.Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms"` GCPolicy []*GCPolicy `protobuf:"bytes,4,rep,name=GCPolicy,proto3" json:"GCPolicy,omitempty"` + BuildkitVersion *BuildkitVersion `protobuf:"bytes,5,opt,name=BuildkitVersion,proto3" json:"BuildkitVersion,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -95,6 +96,13 @@ func (m *WorkerRecord) GetGCPolicy() []*GCPolicy { return nil } +func (m *WorkerRecord) GetBuildkitVersion() *BuildkitVersion { + if m != nil { + return m.BuildkitVersion + } + return nil +} + type GCPolicy struct { All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` KeepDuration int64 `protobuf:"varint,2,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` @@ -166,39 +174,106 @@ func (m *GCPolicy) GetFilters() []string { return nil } +type BuildkitVersion struct { + Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BuildkitVersion) Reset() { *m = BuildkitVersion{} } +func (m *BuildkitVersion) String() string { return proto.CompactTextString(m) } +func (*BuildkitVersion) ProtoMessage() {} +func (*BuildkitVersion) Descriptor() ([]byte, []int) { + return fileDescriptor_e4ff6184b07e587a, []int{2} +} +func (m *BuildkitVersion) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BuildkitVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BuildkitVersion.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BuildkitVersion) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuildkitVersion.Merge(m, src) +} +func (m *BuildkitVersion) XXX_Size() int { + return m.Size() +} +func (m *BuildkitVersion) XXX_DiscardUnknown() { + xxx_messageInfo_BuildkitVersion.DiscardUnknown(m) +} + +var xxx_messageInfo_BuildkitVersion proto.InternalMessageInfo + +func (m *BuildkitVersion) GetPackage() string { + if m != nil { + return m.Package + } + return "" +} + +func (m *BuildkitVersion) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *BuildkitVersion) GetRevision() string { + if m != nil { + return m.Revision + } + return "" +} + func init() { proto.RegisterType((*WorkerRecord)(nil), "moby.buildkit.v1.types.WorkerRecord") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.types.WorkerRecord.LabelsEntry") proto.RegisterType((*GCPolicy)(nil), "moby.buildkit.v1.types.GCPolicy") + proto.RegisterType((*BuildkitVersion)(nil), "moby.buildkit.v1.types.BuildkitVersion") } func init() { proto.RegisterFile("worker.proto", fileDescriptor_e4ff6184b07e587a) } var fileDescriptor_e4ff6184b07e587a = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4e, 0xea, 0x40, - 0x14, 0x86, 0x6f, 0x5b, 0x2e, 0x97, 0x0e, 0xcd, 0x8d, 0x99, 0x18, 0xd3, 0x10, 0x83, 0x84, 0x15, - 0x0b, 0x9d, 0xa2, 0x6e, 0xd4, 0xb8, 0x42, 0x8c, 0x92, 0xb8, 0x20, 0xb3, 0x71, 0xdd, 0x81, 0x01, - 0x9b, 0x0e, 0x9c, 0xc9, 0x74, 0x8a, 0xf6, 0x39, 0x7c, 0x29, 0x96, 0x3e, 0x81, 0x31, 0x3c, 0x89, - 0x99, 0x29, 0x08, 0x26, 0xba, 0x3b, 0xff, 0x9f, 0xff, 0xfb, 0xe7, 0x9c, 0x0c, 0x0a, 0x9e, 0x41, - 0xa5, 0x5c, 0x11, 0xa9, 0x40, 0x03, 0x3e, 0x98, 0x01, 0x2b, 0x08, 0xcb, 0x13, 0x31, 0x4e, 0x13, - 0x4d, 0x16, 0xa7, 0x44, 0x17, 0x92, 0x67, 0x8d, 0x93, 0x69, 0xa2, 0x9f, 0x72, 0x46, 0x46, 0x30, - 0x8b, 0xa6, 0x30, 0x85, 0xc8, 0xc6, 0x59, 0x3e, 0xb1, 0xca, 0x0a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xa1, 0xb9, 0x39, 0xd6, 0x04, 0xb6, 0x06, 0x0e, 0xd1, 0xbf, 0x49, 0x22, 0x34, 0x57, 0x99, - 0xbd, 0xcb, 0xa7, 0x1b, 0xd9, 0x0b, 0x96, 0xab, 0xa6, 0xf3, 0xb6, 0x6a, 0x3a, 0x1f, 0xab, 0xa6, - 0xc3, 0xaa, 0xf6, 0x93, 0xce, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x79, 0x52, 0x6a, 0x29, - 0x02, 0x00, 0x00, + // 416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x8e, 0xd3, 0x30, + 0x10, 0x25, 0xc9, 0xee, 0xd2, 0xb8, 0x11, 0x20, 0x0b, 0xa1, 0x28, 0x42, 0x25, 0xca, 0x85, 0x1e, + 0xc0, 0x59, 0x96, 0x0b, 0x20, 0x4e, 0xa1, 0x08, 0x56, 0xe2, 0xb0, 0xf8, 0x00, 0x67, 0x3b, 0xeb, + 0x86, 0x28, 0xee, 0xda, 0x72, 0x9c, 0x40, 0xfe, 0xb0, 0x47, 0xbe, 0x00, 0xa1, 0x1e, 0xf8, 0x0e, + 0x64, 0x27, 0x69, 0x4b, 0xd9, 0xde, 0xe6, 0xcd, 0xbc, 0xf7, 0x3c, 0xf3, 0x64, 0x10, 0x7c, 0x17, + 0xaa, 0x62, 0x0a, 0x49, 0x25, 0xb4, 0x80, 0x8f, 0x56, 0x82, 0x76, 0x88, 0x36, 0x25, 0xbf, 0xae, + 0x4a, 0x8d, 0xda, 0x17, 0x48, 0x77, 0x92, 0xd5, 0xd1, 0xf3, 0xa2, 0xd4, 0xdf, 0x1a, 0x8a, 0x72, + 0xb1, 0x4a, 0x0b, 0x51, 0x88, 0xd4, 0xd2, 0x69, 0xb3, 0xb4, 0xc8, 0x02, 0x5b, 0xf5, 0x36, 0xd1, + 0xb3, 0x3d,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 0x6c, 0x4a, 0x98, 0x80, 0xa0, 0x62, 0x4c, 0x2e, 0x1a, 0x45, + 0xb4, 0x59, 0xd4, 0xc8, 0x3d, 0xfc, 0x4f, 0x0f, 0x3e, 0x06, 0xbe, 0xc1, 0x59, 0xa7, 0x99, 0xc9, + 0xcf, 0x10, 0x76, 0x0d, 0x18, 0x82, 0xbb, 0xcb, 0x92, 0x6b, 0xa6, 0x6a, 0x1b, 0x95, 0x8f, 0x47, + 0x98, 0x90, 0xff, 0x72, 0x30, 0x64, 0x49, 0xf2, 0x8a, 0x14, 0x6c, 0x58, 0x7e, 0x84, 0x66, 0xd2, + 0x0e, 0x61, 0xf5, 0x27, 0x8c, 0x10, 0x46, 0x60, 0xa2, 0x58, 0x5b, 0xda, 0x91, 0x67, 0x47, 0x5b, + 0x9c, 0x05, 0xeb, 0xcd, 0xcc, 0xf9, 0xb9, 0x99, 0x39, 0xbf, 0x37, 0x33, 0x87, 0x9e, 0xd9, 0xaf, + 0xf5, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x19, 0xcf, 0xd5, 0xdf, 0x02, 0x00, 0x00, } func (m *WorkerRecord) Marshal() (dAtA []byte, err error) { @@ -225,6 +300,18 @@ func (m *WorkerRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.BuildkitVersion != nil { + { + size, err := m.BuildkitVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWorker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.GCPolicy) > 0 { for iNdEx := len(m.GCPolicy) - 1; iNdEx >= 0; iNdEx-- { { @@ -338,6 +425,54 @@ func (m *GCPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BuildkitVersion) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BuildkitVersion) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuildkitVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Revision) > 0 { + i -= len(m.Revision) + copy(dAtA[i:], m.Revision) + i = encodeVarintWorker(dAtA, i, uint64(len(m.Revision))) + i-- + dAtA[i] = 0x1a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintWorker(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Package) > 0 { + i -= len(m.Package) + copy(dAtA[i:], m.Package) + i = encodeVarintWorker(dAtA, i, uint64(len(m.Package))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintWorker(dAtA []byte, offset int, v uint64) int { offset -= sovWorker(v) base := offset @@ -379,6 +514,10 @@ func (m *WorkerRecord) Size() (n int) { n += 1 + l + sovWorker(uint64(l)) } } + if m.BuildkitVersion != nil { + l = m.BuildkitVersion.Size() + n += 1 + l + sovWorker(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -412,6 +551,30 @@ func (m *GCPolicy) Size() (n int) { return n } +func (m *BuildkitVersion) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Package) + if l > 0 { + n += 1 + l + sovWorker(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovWorker(uint64(l)) + } + l = len(m.Revision) + if l > 0 { + n += 1 + l + sovWorker(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovWorker(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -674,6 +837,42 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildkitVersion", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWorker + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWorker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BuildkitVersion == nil { + m.BuildkitVersion = &BuildkitVersion{} + } + if err := m.BuildkitVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipWorker(dAtA[iNdEx:]) @@ -837,6 +1036,153 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } return nil } +func (m *BuildkitVersion) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BuildkitVersion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BuildkitVersion: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Package = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Revision = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWorker(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWorker + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipWorker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/api/types/worker.proto b/api/types/worker.proto index 82dd7ad65145..476fcc62e104 100644 --- a/api/types/worker.proto +++ b/api/types/worker.proto @@ -14,6 +14,7 @@ message WorkerRecord { map Labels = 2; repeated pb.Platform platforms = 3 [(gogoproto.nullable) = false]; repeated GCPolicy GCPolicy = 4; + BuildkitVersion BuildkitVersion = 5; } message GCPolicy { @@ -22,3 +23,9 @@ message GCPolicy { int64 keepBytes = 3; repeated string filters = 4; } + +message BuildkitVersion { + string package = 1; + string version = 2; + string revision = 3; +} diff --git a/client/info.go b/client/info.go index 71f27c86ec0f..68f883d56ff8 100644 --- a/client/info.go +++ b/client/info.go @@ -4,29 +4,37 @@ import ( "context" controlapi "github.com/moby/buildkit/api/services/control" + apitypes "github.com/moby/buildkit/api/types" "github.com/pkg/errors" ) -type InfoResponse struct { - BuildkitVersion Version +type Info struct { + BuildkitVersion BuildkitVersion } -func (c *Client) Info(ctx context.Context) (*InfoResponse, error) { +type BuildkitVersion struct { + Package string + Version string + Revision string +} + +func (c *Client) Info(ctx context.Context) (*Info, error) { res, err := c.controlClient().Info(ctx, &controlapi.InfoRequest{}) if err != nil { return nil, errors.Wrap(err, "failed to call info") } - return &InfoResponse{ - BuildkitVersion: Version{ - Package: res.BuildkitVersion.Package, - Version: res.BuildkitVersion.Version, - Revision: res.BuildkitVersion.Revision, - }, + return &Info{ + BuildkitVersion: fromAPIBuildkitVersion(res.BuildkitVersion), }, nil } -type Version struct { - Package string - Version string - Revision string +func fromAPIBuildkitVersion(in *apitypes.BuildkitVersion) BuildkitVersion { + if in == nil { + return BuildkitVersion{} + } + return BuildkitVersion{ + Package: in.Package, + Version: in.Version, + Revision: in.Revision, + } } diff --git a/client/workers.go b/client/workers.go index e5331cd608c4..89311e3912fa 100644 --- a/client/workers.go +++ b/client/workers.go @@ -13,10 +13,11 @@ import ( // WorkerInfo contains information about a worker type WorkerInfo struct { - ID string `json:"id"` - Labels map[string]string `json:"labels"` - Platforms []ocispecs.Platform `json:"platforms"` - GCPolicy []PruneInfo `json:"gcPolicy"` + ID string `json:"id"` + Labels map[string]string `json:"labels"` + Platforms []ocispecs.Platform `json:"platforms"` + GCPolicy []PruneInfo `json:"gcPolicy"` + BuildkitVersion BuildkitVersion `json:"buildkitVersion"` } // ListWorkers lists all active workers @@ -36,10 +37,11 @@ func (c *Client) ListWorkers(ctx context.Context, opts ...ListWorkersOption) ([] for _, w := range resp.Record { wi = append(wi, &WorkerInfo{ - ID: w.ID, - Labels: w.Labels, - Platforms: pb.ToSpecPlatforms(w.Platforms), - GCPolicy: fromAPIGCPolicy(w.GCPolicy), + ID: w.ID, + Labels: w.Labels, + Platforms: pb.ToSpecPlatforms(w.Platforms), + GCPolicy: fromAPIGCPolicy(w.GCPolicy), + BuildkitVersion: fromAPIBuildkitVersion(w.BuildkitVersion), }) } diff --git a/cmd/buildctl/debug/workers.go b/cmd/buildctl/debug/workers.go index feacf4beefbe..dbe4499f8e78 100644 --- a/cmd/buildctl/debug/workers.go +++ b/cmd/buildctl/debug/workers.go @@ -79,6 +79,7 @@ func printWorkersVerbose(tw *tabwriter.Writer, winfo []*client.WorkerInfo) { for _, wi := range winfo { fmt.Fprintf(tw, "ID:\t%s\n", wi.ID) fmt.Fprintf(tw, "Platforms:\t%s\n", joinPlatforms(wi.Platforms)) + fmt.Fprintf(tw, "BuildKit:\t%s %s %s\n", wi.BuildkitVersion.Package, wi.BuildkitVersion.Version, wi.BuildkitVersion.Revision) fmt.Fprintf(tw, "Labels:\n") for _, k := range sortedKeys(wi.Labels) { v := wi.Labels[k] diff --git a/cmd/buildkitd/main.go b/cmd/buildkitd/main.go index cdccc7cbf106..618975465545 100644 --- a/cmd/buildkitd/main.go +++ b/cmd/buildkitd/main.go @@ -759,6 +759,14 @@ func getGCPolicy(cfg config.GCConfig, root string) []client.PruneInfo { return out } +func getBuildkitVersion() client.BuildkitVersion { + return client.BuildkitVersion{ + Package: version.Package, + Version: version.Version, + Revision: version.Revision, + } +} + func getDNSConfig(cfg *config.DNSConfig) *oci.DNSConfig { var dns *oci.DNSConfig if cfg != nil { diff --git a/cmd/buildkitd/main_containerd_worker.go b/cmd/buildkitd/main_containerd_worker.go index fe917422e86f..a3bb8ac30ab4 100644 --- a/cmd/buildkitd/main_containerd_worker.go +++ b/cmd/buildkitd/main_containerd_worker.go @@ -264,6 +264,7 @@ func containerdWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([ return nil, err } opt.GCPolicy = getGCPolicy(cfg.GCConfig, common.config.Root) + opt.BuildkitVersion = getBuildkitVersion() opt.RegistryHosts = resolverFunc(common.config) if platformsStr := cfg.Platforms; len(platformsStr) != 0 { diff --git a/cmd/buildkitd/main_oci_worker.go b/cmd/buildkitd/main_oci_worker.go index e3c3bb52e96f..49153af5fb48 100644 --- a/cmd/buildkitd/main_oci_worker.go +++ b/cmd/buildkitd/main_oci_worker.go @@ -295,6 +295,7 @@ func ociWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([]worker return nil, err } opt.GCPolicy = getGCPolicy(cfg.GCConfig, common.config.Root) + opt.BuildkitVersion = getBuildkitVersion() opt.RegistryHosts = hosts if platformsStr := cfg.Platforms; len(platformsStr) != 0 { diff --git a/control/control.go b/control/control.go index 7cb6d7436897..fde476803175 100644 --- a/control/control.go +++ b/control/control.go @@ -426,10 +426,11 @@ func (c *Controller) ListWorkers(ctx context.Context, r *controlapi.ListWorkersR } for _, w := range workers { resp.Record = append(resp.Record, &apitypes.WorkerRecord{ - ID: w.ID(), - Labels: w.Labels(), - Platforms: pb.PlatformsFromSpec(w.Platforms(true)), - GCPolicy: toPBGCPolicy(w.GCPolicy()), + ID: w.ID(), + Labels: w.Labels(), + Platforms: pb.PlatformsFromSpec(w.Platforms(true)), + GCPolicy: toPBGCPolicy(w.GCPolicy()), + BuildkitVersion: toPBBuildkitVersion(w.BuildkitVersion()), }) } return resp, nil @@ -437,7 +438,7 @@ func (c *Controller) ListWorkers(ctx context.Context, r *controlapi.ListWorkersR func (c *Controller) Info(ctx context.Context, r *controlapi.InfoRequest) (*controlapi.InfoResponse, error) { return &controlapi.InfoResponse{ - BuildkitVersion: &controlapi.Version{ + BuildkitVersion: &apitypes.BuildkitVersion{ Package: version.Package, Version: version.Version, Revision: version.Revision, @@ -510,3 +511,11 @@ func toPBGCPolicy(in []client.PruneInfo) []*apitypes.GCPolicy { } return policy } + +func toPBBuildkitVersion(in client.BuildkitVersion) *apitypes.BuildkitVersion { + return &apitypes.BuildkitVersion{ + Package: in.Package, + Version: in.Version, + Revision: in.Revision, + } +} diff --git a/worker/base/worker.go b/worker/base/worker.go index 7db6dc29a622..44db745d0670 100644 --- a/worker/base/worker.go +++ b/worker/base/worker.go @@ -61,6 +61,7 @@ type WorkerOpt struct { Labels map[string]string Platforms []ocispecs.Platform GCPolicy []client.PruneInfo + BuildkitVersion client.BuildkitVersion Executor executor.Executor Snapshotter snapshot.Snapshotter ContentStore content.Store @@ -218,6 +219,10 @@ func (w *Worker) GCPolicy() []client.PruneInfo { return w.WorkerOpt.GCPolicy } +func (w *Worker) BuildkitVersion() client.BuildkitVersion { + return w.WorkerOpt.BuildkitVersion +} + func (w *Worker) LoadRef(ctx context.Context, id string, hidden bool) (cache.ImmutableRef, error) { var opts []cache.RefOption if hidden { diff --git a/worker/worker.go b/worker/worker.go index 743513bb0a98..00ce568aebc5 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -21,6 +21,7 @@ type Worker interface { ID() string Labels() map[string]string Platforms(noCache bool) []ocispecs.Platform + BuildkitVersion() client.BuildkitVersion GCPolicy() []client.PruneInfo LoadRef(ctx context.Context, id string, hidden bool) (cache.ImmutableRef, error) diff --git a/worker/workercontroller.go b/worker/workercontroller.go index 26ca9459231c..d00080c1694d 100644 --- a/worker/workercontroller.go +++ b/worker/workercontroller.go @@ -62,9 +62,10 @@ func (c *Controller) WorkerInfos() []client.WorkerInfo { out := make([]client.WorkerInfo, 0, len(c.workers)) for _, w := range c.workers { out = append(out, client.WorkerInfo{ - ID: w.ID(), - Labels: w.Labels(), - Platforms: w.Platforms(false), + ID: w.ID(), + Labels: w.Labels(), + Platforms: w.Platforms(false), + BuildkitVersion: w.BuildkitVersion(), }) } return out From dc7c087944302364bb042835a193ef07326fae9b Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 9 Sep 2022 16:32:42 +0200 Subject: [PATCH 17/21] integration: skip for dockerd Signed-off-by: CrazyMax (cherry picked from commit 54bcf4bec6d5848973bb58936fb28824cc99bf6e) Signed-off-by: Sebastiaan van Stijn --- client/client_test.go | 1 + frontend/dockerfile/dockerfile_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/client/client_test.go b/client/client_test.go index a7b45dcd4798..eb2dfb6f44ac 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -5729,6 +5729,7 @@ func testBuildInfoNoExport(t *testing.T, sb integration.Sandbox) { } func testCallInfo(t *testing.T, sb integration.Sandbox) { + integration.SkipIfDockerd(t, sb, "not implemented") c, err := New(sb.Context(), sb.Address()) require.NoError(t, err) defer c.Close() diff --git a/frontend/dockerfile/dockerfile_test.go b/frontend/dockerfile/dockerfile_test.go index 056e1a75ed7c..1c9ade0cbffb 100644 --- a/frontend/dockerfile/dockerfile_test.go +++ b/frontend/dockerfile/dockerfile_test.go @@ -5507,6 +5507,7 @@ RUN echo hello } func testNamedImageContextTimestamps(t *testing.T, sb integration.Sandbox) { + integration.SkipIfDockerd(t, sb, "direct push") ctx := sb.Context() c, err := client.New(ctx, sb.Address()) From ee10ba766723c0b245f432c21365e0ef36f952f6 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 9 Sep 2022 16:25:41 +0200 Subject: [PATCH 18/21] ci: update buildx to 0.9.1 Signed-off-by: CrazyMax (cherry picked from commit 07e7f32d6aecae83f82f40003578b61f0d8f86ca) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/build.yml | 2 +- .github/workflows/buildx-image.yml | 2 +- .github/workflows/dockerd.yml | 2 +- .github/workflows/validate.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c22ff27766f9..1074edf2a8a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ env: CACHE_GHA_SCOPE_BINARIES: "binaries" CACHE_GHA_SCOPE_CROSS: "cross" TESTFLAGS: "-v --parallel=6 --timeout=30m" - BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment + BUILDX_VERSION: "v0.9.1" # leave empty to use the one available on GitHub virtual environment GO_VERSION: "1.19" jobs: diff --git a/.github/workflows/buildx-image.yml b/.github/workflows/buildx-image.yml index 90de77f00a2f..31b04f0c3d30 100644 --- a/.github/workflows/buildx-image.yml +++ b/.github/workflows/buildx-image.yml @@ -27,7 +27,7 @@ on: env: REPO_SLUG_TARGET: "moby/buildkit" - BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment + BUILDX_VERSION: "v0.9.1" # leave empty to use the one available on GitHub virtual environment jobs: create: diff --git a/.github/workflows/dockerd.yml b/.github/workflows/dockerd.yml index c76970881968..f730dd286299 100644 --- a/.github/workflows/dockerd.yml +++ b/.github/workflows/dockerd.yml @@ -14,7 +14,7 @@ env: CACHE_GHA_SCOPE_IT: "integration-tests" CACHE_GHA_SCOPE_BINARIES: "binaries" TESTFLAGS: "-v --parallel=1 --timeout=30m" - BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment + BUILDX_VERSION: "v0.9.1" # leave empty to use the one available on GitHub virtual environment jobs: prepare: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 494723989c04..f461756944c3 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,7 +15,7 @@ on: env: REPO_SLUG_ORIGIN: "moby/buildkit:latest" - BUILDX_VERSION: "v0.8.2" # leave empty to use the one available on GitHub virtual environment + BUILDX_VERSION: "v0.9.1" # leave empty to use the one available on GitHub virtual environment jobs: validate: From a75a844850f16712c7848a6084a3f06cc3939d16 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 9 Sep 2022 16:31:14 +0200 Subject: [PATCH 19/21] ci(dockerd): fix symlink with dockerd bundle Signed-off-by: CrazyMax (cherry picked from commit e870da7be2c9cdc8e6bfb5c9ef1510de600dd1e1) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/dockerd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dockerd.yml b/.github/workflows/dockerd.yml index f730dd286299..a4e13c108614 100644 --- a/.github/workflows/dockerd.yml +++ b/.github/workflows/dockerd.yml @@ -57,12 +57,12 @@ jobs: target: binary outputs: /tmp/moby - - # FIXME: remove symlink and rename bin. should be fixed upstream on moby. name: Rename binary if: steps.build.outputs.result == 'true' run: | - rm /tmp/moby/binary-daemon/dockerd - mv /tmp/moby/binary-daemon/dockerd-dev /tmp/moby/binary-daemon/dockerd + if [ -L "/tmp/moby/binary-daemon/dockerd" ]; then + mv -f $(readlink /tmp/moby/binary-daemon/dockerd) /tmp/moby/binary-daemon/dockerd + fi - name: Download if: steps.build.outputs.result != 'true' From 847e47fbeb127121330312d1878f89586dc8afe8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 4 Oct 2022 15:40:05 +0200 Subject: [PATCH 20/21] Revert "control: add buildkit version to worker record" This reverts commit 4723645f8be13747a6523e6aa640715144558d47. Signed-off-by: Sebastiaan van Stijn --- api/services/control/control.pb.go | 504 +++++++++++++++++++----- api/services/control/control.proto | 8 +- api/types/worker.pb.go | 394 ++---------------- api/types/worker.proto | 7 - client/info.go | 34 +- client/workers.go | 18 +- cmd/buildctl/debug/workers.go | 1 - cmd/buildkitd/main.go | 8 - cmd/buildkitd/main_containerd_worker.go | 1 - cmd/buildkitd/main_oci_worker.go | 1 - control/control.go | 19 +- worker/base/worker.go | 5 - worker/worker.go | 1 - worker/workercontroller.go | 7 +- 14 files changed, 455 insertions(+), 553 deletions(-) diff --git a/api/services/control/control.pb.go b/api/services/control/control.pb.go index 98208cf7a7d9..8a9a29826375 100644 --- a/api/services/control/control.pb.go +++ b/api/services/control/control.pb.go @@ -1240,6 +1240,69 @@ func (m *ListWorkersResponse) GetRecord() []*types.WorkerRecord { return nil } +type Version struct { + Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{17} +} +func (m *Version) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Version.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Version) XXX_Merge(src proto.Message) { + xxx_messageInfo_Version.Merge(m, src) +} +func (m *Version) XXX_Size() int { + return m.Size() +} +func (m *Version) XXX_DiscardUnknown() { + xxx_messageInfo_Version.DiscardUnknown(m) +} + +var xxx_messageInfo_Version proto.InternalMessageInfo + +func (m *Version) GetPackage() string { + if m != nil { + return m.Package + } + return "" +} + +func (m *Version) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Version) GetRevision() string { + if m != nil { + return m.Revision + } + return "" +} + type InfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1250,7 +1313,7 @@ func (m *InfoRequest) Reset() { *m = InfoRequest{} } func (m *InfoRequest) String() string { return proto.CompactTextString(m) } func (*InfoRequest) ProtoMessage() {} func (*InfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{17} + return fileDescriptor_0c5120591600887d, []int{18} } func (m *InfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1280,17 +1343,17 @@ func (m *InfoRequest) XXX_DiscardUnknown() { var xxx_messageInfo_InfoRequest proto.InternalMessageInfo type InfoResponse struct { - BuildkitVersion *types.BuildkitVersion `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + BuildkitVersion *Version `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *InfoResponse) Reset() { *m = InfoResponse{} } func (m *InfoResponse) String() string { return proto.CompactTextString(m) } func (*InfoResponse) ProtoMessage() {} func (*InfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{18} + return fileDescriptor_0c5120591600887d, []int{19} } func (m *InfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1319,7 +1382,7 @@ func (m *InfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_InfoResponse proto.InternalMessageInfo -func (m *InfoResponse) GetBuildkitVersion() *types.BuildkitVersion { +func (m *InfoResponse) GetBuildkitVersion() *Version { if m != nil { return m.BuildkitVersion } @@ -1350,6 +1413,7 @@ func init() { proto.RegisterType((*BytesMessage)(nil), "moby.buildkit.v1.BytesMessage") proto.RegisterType((*ListWorkersRequest)(nil), "moby.buildkit.v1.ListWorkersRequest") proto.RegisterType((*ListWorkersResponse)(nil), "moby.buildkit.v1.ListWorkersResponse") + proto.RegisterType((*Version)(nil), "moby.buildkit.v1.Version") proto.RegisterType((*InfoRequest)(nil), "moby.buildkit.v1.InfoRequest") proto.RegisterType((*InfoResponse)(nil), "moby.buildkit.v1.InfoResponse") } @@ -1357,107 +1421,110 @@ func init() { func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } var fileDescriptor_0c5120591600887d = []byte{ - // 1597 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcb, 0x6e, 0x1c, 0x45, - 0x17, 0x4e, 0xcf, 0x7d, 0xce, 0x8c, 0xfd, 0x3b, 0x95, 0xfc, 0x51, 0xab, 0x7f, 0xfd, 0xb6, 0xd3, - 0x09, 0xc2, 0x8a, 0x92, 0x1e, 0xc7, 0x10, 0x08, 0xe6, 0xa2, 0x64, 0x3c, 0x86, 0x38, 0x8a, 0x45, - 0x52, 0xce, 0x45, 0xca, 0x02, 0xa9, 0x67, 0xa6, 0x3c, 0x6e, 0xb9, 0xa7, 0xab, 0xa9, 0xaa, 0x76, - 0x62, 0x1e, 0x80, 0x35, 0x3b, 0x1e, 0x80, 0x05, 0x2b, 0x76, 0x48, 0x3c, 0x01, 0x52, 0x96, 0xac, - 0xb3, 0x30, 0x28, 0x0f, 0x80, 0x58, 0xb2, 0x44, 0x75, 0xe9, 0x71, 0xcf, 0xcd, 0xb7, 0xb0, 0x9a, - 0x3a, 0x55, 0xe7, 0x7c, 0x7d, 0x2e, 0x5f, 0x55, 0x9d, 0x1a, 0x98, 0xe9, 0xd0, 0x48, 0x30, 0x1a, - 0x7a, 0x31, 0xa3, 0x82, 0xa2, 0xb9, 0x3e, 0x6d, 0xef, 0x7b, 0x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, 0x9c, - 0xcf, 0xe8, 0xf2, 0x98, 0x46, 0x9c, 0xa0, 0x5b, 0x50, 0x62, 0xa4, 0x43, 0x59, 0x57, 0x29, 0xd7, - 0x56, 0xfe, 0xef, 0x8d, 0xd6, 0xc6, 0x33, 0x06, 0x52, 0x09, 0x1b, 0x65, 0xf7, 0xfb, 0x3c, 0xd4, - 0x32, 0xf3, 0x68, 0x16, 0x72, 0x1b, 0x2d, 0xdb, 0x5a, 0xb4, 0x96, 0xaa, 0x38, 0xb7, 0xd1, 0x42, - 0x36, 0x94, 0x37, 0x13, 0xe1, 0xb7, 0x43, 0x62, 0x62, 0x4f, 0x45, 0x74, 0x11, 0x8a, 0x1b, 0xd1, - 0x13, 0x4e, 0x54, 0xe0, 0x15, 0xac, 0x05, 0x84, 0xa0, 0xb0, 0x15, 0x7c, 0x43, 0x74, 0x98, 0x58, - 0x8d, 0x91, 0x03, 0xa5, 0x87, 0x3e, 0x23, 0x91, 0xb0, 0x8b, 0x12, 0xb7, 0x99, 0xb3, 0x2d, 0x6c, - 0x66, 0x50, 0x13, 0xaa, 0x6b, 0x8c, 0xf8, 0x82, 0x74, 0xef, 0x0a, 0xbb, 0xb4, 0x68, 0x2d, 0xd5, - 0x56, 0x1c, 0x4f, 0x93, 0xc2, 0x4b, 0x49, 0xe1, 0x3d, 0x4e, 0x49, 0xd1, 0xac, 0xbc, 0x3a, 0x58, - 0x38, 0xf7, 0xdd, 0xef, 0x32, 0x77, 0x03, 0x33, 0x74, 0x07, 0xe0, 0x81, 0xcf, 0xc5, 0x13, 0xae, - 0x40, 0xca, 0xc7, 0x82, 0x14, 0x14, 0x40, 0xc6, 0x06, 0xcd, 0x03, 0xa8, 0x24, 0xac, 0xd1, 0x24, - 0x12, 0x76, 0x45, 0xf9, 0x9e, 0x99, 0x41, 0x8b, 0x50, 0x6b, 0x11, 0xde, 0x61, 0x41, 0xac, 0x4a, - 0x5d, 0x55, 0xe9, 0xc9, 0x4e, 0x49, 0x04, 0x9d, 0xc1, 0xc7, 0xfb, 0x31, 0xb1, 0x41, 0x29, 0x64, - 0x66, 0x64, 0x2d, 0xb7, 0x76, 0x7c, 0x46, 0xba, 0x76, 0x4d, 0xa5, 0xcb, 0x48, 0x32, 0xbf, 0x3a, - 0x13, 0xdc, 0xae, 0xab, 0x22, 0xa7, 0xa2, 0xfb, 0x43, 0x09, 0xea, 0x5b, 0x92, 0xe3, 0x29, 0x1d, - 0xe6, 0x20, 0x8f, 0xc9, 0xb6, 0xa9, 0x8d, 0x1c, 0x22, 0x0f, 0xa0, 0x45, 0xb6, 0x83, 0x28, 0x50, - 0x5e, 0xe5, 0x54, 0xe0, 0xb3, 0x5e, 0xdc, 0xf6, 0x0e, 0x67, 0x71, 0x46, 0x03, 0x39, 0x50, 0x59, - 0x7f, 0x19, 0x53, 0x26, 0x29, 0x95, 0x57, 0x30, 0x03, 0x19, 0x3d, 0x83, 0x99, 0x74, 0x7c, 0x57, - 0x08, 0x26, 0x89, 0x2a, 0x69, 0x74, 0x73, 0x9c, 0x46, 0x59, 0xa7, 0xbc, 0x21, 0x9b, 0xf5, 0x48, - 0xb0, 0x7d, 0x3c, 0x8c, 0x23, 0x23, 0xdc, 0x22, 0x9c, 0x4b, 0x0f, 0x55, 0xf9, 0x71, 0x2a, 0x4a, - 0x77, 0x3e, 0x67, 0x34, 0x12, 0x24, 0xea, 0xaa, 0xd2, 0x57, 0xf1, 0x40, 0x96, 0xee, 0xa4, 0x63, - 0xed, 0x4e, 0xf9, 0x44, 0xee, 0x0c, 0xd9, 0x18, 0x77, 0x86, 0xe6, 0xd0, 0x2a, 0x14, 0xd7, 0xfc, - 0xce, 0x0e, 0x51, 0x55, 0xae, 0xad, 0xcc, 0x8f, 0x03, 0xaa, 0xe5, 0x2f, 0x55, 0x59, 0xb9, 0xda, - 0xa8, 0xe7, 0xb0, 0x36, 0x41, 0x5f, 0x41, 0x7d, 0x3d, 0x12, 0x81, 0x08, 0x49, 0x5f, 0x55, 0xac, - 0x2a, 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0x34, 0x57, 0xe4, - 0x21, 0xff, 0xfa, 0x60, 0xe1, 0x5a, 0xe6, 0x14, 0xa7, 0x31, 0x89, 0x64, 0xb3, 0xeb, 0x07, 0x11, - 0x61, 0xbc, 0xd1, 0xa3, 0x37, 0xb4, 0x89, 0xd7, 0x52, 0x3f, 0xd8, 0x20, 0x48, 0xac, 0x40, 0x9f, - 0xd5, 0xea, 0xbc, 0x38, 0x1b, 0x96, 0x46, 0x90, 0xdb, 0x20, 0xf2, 0xfb, 0xc4, 0xdc, 0xcd, 0x6a, - 0x2c, 0x1b, 0x87, 0x8e, 0xe4, 0x79, 0x57, 0xb5, 0x54, 0x15, 0x6c, 0x24, 0xb4, 0x0a, 0x65, 0x2e, - 0x7c, 0x26, 0xcf, 0x9c, 0xe2, 0x09, 0x3b, 0x9e, 0xd4, 0x00, 0x7d, 0x06, 0xd5, 0x0e, 0xed, 0xc7, - 0x21, 0x91, 0xd6, 0xa5, 0x13, 0x5a, 0x1f, 0x9a, 0x48, 0xea, 0x11, 0xc6, 0x28, 0x53, 0xbd, 0x56, - 0x15, 0x6b, 0x01, 0x7d, 0x08, 0x33, 0x31, 0xa3, 0x3d, 0x46, 0x38, 0xff, 0x82, 0xd1, 0x24, 0x36, - 0x37, 0xec, 0x79, 0x79, 0x78, 0x3f, 0xcc, 0x2e, 0xe0, 0x61, 0x3d, 0xf7, 0xcf, 0x1c, 0xd4, 0xb3, - 0x14, 0x19, 0x6b, 0x42, 0xef, 0x43, 0x49, 0x13, 0x4e, 0x73, 0xfd, 0x6c, 0x39, 0xd6, 0x08, 0x13, - 0x73, 0x6c, 0x43, 0xb9, 0x93, 0x30, 0xd5, 0xa1, 0xea, 0xbe, 0x35, 0x15, 0x65, 0xa4, 0x82, 0x0a, - 0x3f, 0x54, 0x39, 0xce, 0x63, 0x2d, 0xc8, 0xa6, 0x75, 0xf0, 0x4e, 0x39, 0x5d, 0xd3, 0x3a, 0x30, - 0xcb, 0xd6, 0xaf, 0xfc, 0x56,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ff, 0xff, 0x96, 0x5c, 0xf7, 0x1b, 0xef, 0x12, 0x00, 0x00, + // 1635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0x1b, 0x47, + 0x16, 0x76, 0x73, 0xe7, 0x23, 0xa5, 0x91, 0xcb, 0x1e, 0xa3, 0xa7, 0x07, 0x23, 0xc9, 0x6d, 0x0f, + 0x20, 0x18, 0x76, 0x53, 0xe6, 0x8c, 0x67, 0x3c, 0x9a, 0x05, 0x36, 0x45, 0xcd, 0x58, 0x86, 0x85, + 0xf1, 0x14, 0xbd, 0x60, 0x7c, 0x08, 0xd0, 0x24, 0x4b, 0x54, 0x43, 0xcd, 0xae, 0x4e, 0x55, 0xb5, + 0x6c, 0xe5, 0x07, 0xe4, 0x9c, 0x5b, 0x7e, 0x40, 0x0e, 0x39, 0xe5, 0x16, 0x20, 0xbf, 0x20, 0x80, + 0x8f, 0x39, 0xfb, 0xa0, 0x04, 0xfe, 0x01, 0x41, 0x8e, 0x39, 0x06, 0xb5, 0x34, 0xd5, 0xdc, 0xb4, + 0x39, 0x27, 0xd6, 0xab, 0x7a, 0xef, 0xeb, 0xb7, 0x56, 0xbd, 0x47, 0x58, 0xe8, 0xd1, 0x48, 0x30, + 0x1a, 0x7a, 0x31, 0xa3, 0x82, 0xa2, 0xa5, 0x21, 0xed, 0x1e, 0x7a, 0xdd, 0x24, 0x08, 0xfb, 0xfb, + 0x81, 0xf0, 0x0e, 0xee, 0x3a, 0x77, 0x06, 0x81, 0xd8, 0x4b, 0xba, 0x5e, 0x8f, 0x0e, 0x1b, 0x03, + 0x3a, 0xa0, 0x0d, 0xc5, 0xd8, 0x4d, 0x76, 0x15, 0xa5, 0x08, 0xb5, 0xd2, 0x00, 0xce, 0xca, 0x80, + 0xd2, 0x41, 0x48, 0x8e, 0xb9, 0x44, 0x30, 0x24, 0x5c, 0xf8, 0xc3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, 0x3c, + 0x00, 0x34, 0x1d, 0x2b, 0x99, 0x53, 0xfb, 0xe4, 0x30, 0xcd, 0xa9, 0x7d, 0x72, 0x28, 0xcb, 0xfa, + 0xc0, 0x0f, 0x13, 0x5d, 0xee, 0x55, 0xac, 0x89, 0x8d, 0xdc, 0x7d, 0x4b, 0x22, 0x4c, 0xbb, 0xf7, + 0x5c, 0x08, 0xff, 0x83, 0x2b, 0x33, 0x54, 0x9d, 0x01, 0x71, 0x33, 0x0b, 0x31, 0x9d, 0xd3, 0xc7, + 0x90, 0xee, 0x57, 0x79, 0xa8, 0x67, 0x03, 0x86, 0xd6, 0xe1, 0x8a, 0xb6, 0x13, 0x93, 0xdd, 0x36, + 0x89, 0x19, 0xe9, 0xc9, 0x5b, 0xc2, 0x80, 0xcf, 0x3a, 0x42, 0x4d, 0xb8, 0xba, 0x3d, 0x34, 0xdb, + 0x3c, 0x23, 0x92, 0x53, 0xf5, 0x38, 0xf3, 0x0c, 0x51, 0xf8, 0xad, 0x86, 0x52, 0x9e, 0xc8, 0x08, + 0xe5, 0x55, 0xc0, 0xfe, 0x76, 0x72, 0x56, 0x79, 0x33, 0x65, 0x75, 0xdc, 0x66, 0xe3, 0xa2, 0x7f, + 0x42, 0x59, 0x1f, 0xa4, 0x85, 0x79, 0xe3, 0xe4, 0x4f, 0x68, 0xb0, 0x54, 0x46, 0x8a, 0x6b, 0x3b, + 0xb8, 0x5d, 0x3c, 0x87, 0xb8, 0x91, 0x71, 0x1e, 0x81, 0x33, 0x5f, 0xe5, 0xf3, 0xa4, 0x80, 0xfb, + 0xa5, 0x05, 0x97, 0xa7, 0x3e, 0x24, 0x5f, 0x0d, 0x75, 0x6f, 0x6a, 0x08, 0xb5, 0x46, 0x6d, 0x28, + 0xea, 0xca, 0xcf, 0x29, 0x85, 0xbd, 0x33, 0x28, 0xec, 0x65, 0xca, 0x5e, 0x0b, 0x3b, 0xf7, 0x01, + 0x2e, 0x96, 0xac, 0xee, 0x37, 0x16, 0x2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, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2992,6 +3059,54 @@ func (m *ListWorkersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Version) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Version) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Revision) > 0 { + i -= len(m.Revision) + copy(dAtA[i:], m.Revision) + i = encodeVarintControl(dAtA, i, uint64(len(m.Revision))) + i-- + dAtA[i] = 0x1a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintControl(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Package) > 0 { + i -= len(m.Package) + copy(dAtA[i:], m.Package) + i = encodeVarintControl(dAtA, i, uint64(len(m.Package))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3599,6 +3714,30 @@ func (m *ListWorkersResponse) Size() (n int) { return n } +func (m *Version) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Package) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + l = len(m.Revision) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *InfoRequest) Size() (n int) { if m == nil { return 0 @@ -7240,6 +7379,153 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *Version) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Version: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Package = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Revision = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *InfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7350,7 +7636,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.BuildkitVersion == nil { - m.BuildkitVersion = &types.BuildkitVersion{} + m.BuildkitVersion = &Version{} } if err := m.BuildkitVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/api/services/control/control.proto b/api/services/control/control.proto index 6f5c976bce51..f62efe3d1940 100644 --- a/api/services/control/control.proto +++ b/api/services/control/control.proto @@ -158,8 +158,14 @@ message ListWorkersResponse { repeated moby.buildkit.v1.types.WorkerRecord record = 1; } +message Version { + string package = 1; + string version = 2; + string revision = 3; +} + message InfoRequest {} message InfoResponse { - moby.buildkit.v1.types.BuildkitVersion buildkitVersion = 1; + Version buildkitVersion = 1; } diff --git a/api/types/worker.pb.go b/api/types/worker.pb.go index e1b3928cba52..54cbd605e14c 100644 --- a/api/types/worker.pb.go +++ b/api/types/worker.pb.go @@ -29,7 +29,6 @@ type WorkerRecord struct { Labels map[string]string `protobuf:"bytes,2,rep,name=Labels,proto3" json:"Labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Platforms []pb.Platform `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms"` GCPolicy []*GCPolicy `protobuf:"bytes,4,rep,name=GCPolicy,proto3" json:"GCPolicy,omitempty"` - BuildkitVersion *BuildkitVersion `protobuf:"bytes,5,opt,name=BuildkitVersion,proto3" json:"BuildkitVersion,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -96,13 +95,6 @@ func (m *WorkerRecord) GetGCPolicy() []*GCPolicy { return nil } -func (m *WorkerRecord) GetBuildkitVersion() *BuildkitVersion { - if m != nil { - return m.BuildkitVersion - } - return nil -} - type GCPolicy struct { All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` KeepDuration int64 `protobuf:"varint,2,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` @@ -174,106 +166,39 @@ func (m *GCPolicy) GetFilters() []string { return nil } -type BuildkitVersion struct { - Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BuildkitVersion) Reset() { *m = BuildkitVersion{} } -func (m *BuildkitVersion) String() string { return proto.CompactTextString(m) } -func (*BuildkitVersion) ProtoMessage() {} -func (*BuildkitVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_e4ff6184b07e587a, []int{2} -} -func (m *BuildkitVersion) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BuildkitVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BuildkitVersion.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BuildkitVersion) XXX_Merge(src proto.Message) { - xxx_messageInfo_BuildkitVersion.Merge(m, src) -} -func (m *BuildkitVersion) XXX_Size() int { - return m.Size() -} -func (m *BuildkitVersion) XXX_DiscardUnknown() { - xxx_messageInfo_BuildkitVersion.DiscardUnknown(m) -} - -var xxx_messageInfo_BuildkitVersion proto.InternalMessageInfo - -func (m *BuildkitVersion) GetPackage() string { - if m != nil { - return m.Package - } - return "" -} - -func (m *BuildkitVersion) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *BuildkitVersion) GetRevision() string { - if m != nil { - return m.Revision - } - return "" -} - func init() { proto.RegisterType((*WorkerRecord)(nil), "moby.buildkit.v1.types.WorkerRecord") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.types.WorkerRecord.LabelsEntry") proto.RegisterType((*GCPolicy)(nil), "moby.buildkit.v1.types.GCPolicy") - proto.RegisterType((*BuildkitVersion)(nil), "moby.buildkit.v1.types.BuildkitVersion") } func init() { proto.RegisterFile("worker.proto", fileDescriptor_e4ff6184b07e587a) } var fileDescriptor_e4ff6184b07e587a = []byte{ - // 416 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x8e, 0xd3, 0x30, - 0x10, 0x25, 0xc9, 0xee, 0xd2, 0xb8, 0x11, 0x20, 0x0b, 0xa1, 0x28, 0x42, 0x25, 0xca, 0x85, 0x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 0x37, 0x33, 0x87, 0x9e, 0xd9, 0xaf, - 0xf5, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x19, 0xcf, 0xd5, 0xdf, 0x02, 0x00, 0x00, + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4e, 0xea, 0x40, + 0x14, 0x86, 0x6f, 0x5b, 0x2e, 0x97, 0x0e, 0xcd, 0x8d, 0x99, 0x18, 0xd3, 0x10, 0x83, 0x84, 0x15, + 0x0b, 0x9d, 0xa2, 0x6e, 0xd4, 0xb8, 0x42, 0x8c, 0x92, 0xb8, 0x20, 0xb3, 0x71, 0xdd, 0x81, 0x01, + 0x9b, 0x0e, 0x9c, 0xc9, 0x74, 0x8a, 0xf6, 0x39, 0x7c, 0x29, 0x96, 0x3e, 0x81, 0x31, 0x3c, 0x89, + 0x99, 0x29, 0x08, 0x26, 0xba, 0x3b, 0xff, 0x9f, 0xff, 0xfb, 0xe7, 0x9c, 0x0c, 0x0a, 0x9e, 0x41, + 0xa5, 0x5c, 0x11, 0xa9, 0x40, 0x03, 0x3e, 0x98, 0x01, 0x2b, 0x08, 0xcb, 0x13, 0x31, 0x4e, 0x13, + 0x4d, 0x16, 0xa7, 0x44, 0x17, 0x92, 0x67, 0x8d, 0x93, 0x69, 0xa2, 0x9f, 0x72, 0x46, 0x46, 0x30, + 0x8b, 0xa6, 0x30, 0x85, 0xc8, 0xc6, 0x59, 0x3e, 0xb1, 0xca, 0x0a, 0x3b, 0x95, 0x35, 0x8d, 0xe3, + 0x9d, 0xb8, 0x69, 0x8c, 0x36, 0x8d, 0x51, 0x06, 0x62, 0xc1, 0x55, 0x24, 0x59, 0x04, 0x32, 0x2b, + 0xd3, 0xed, 0x57, 0x17, 0x05, 0x8f, 0x76, 0x0b, 0xca, 0x47, 0xa0, 0xc6, 0xf8, 0x3f, 0x72, 0x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, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x79, 0x52, 0x6a, 0x29, + 0x02, 0x00, 0x00, } func (m *WorkerRecord) Marshal() (dAtA []byte, err error) { @@ -300,18 +225,6 @@ func (m *WorkerRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.BuildkitVersion != nil { - { - size, err := m.BuildkitVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWorker(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if len(m.GCPolicy) > 0 { for iNdEx := len(m.GCPolicy) - 1; iNdEx >= 0; iNdEx-- { { @@ -425,54 +338,6 @@ func (m *GCPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BuildkitVersion) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BuildkitVersion) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BuildkitVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Revision) > 0 { - i -= len(m.Revision) - copy(dAtA[i:], m.Revision) - i = encodeVarintWorker(dAtA, i, uint64(len(m.Revision))) - i-- - dAtA[i] = 0x1a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintWorker(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Package) > 0 { - i -= len(m.Package) - copy(dAtA[i:], m.Package) - i = encodeVarintWorker(dAtA, i, uint64(len(m.Package))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintWorker(dAtA []byte, offset int, v uint64) int { offset -= sovWorker(v) base := offset @@ -514,10 +379,6 @@ func (m *WorkerRecord) Size() (n int) { n += 1 + l + sovWorker(uint64(l)) } } - if m.BuildkitVersion != nil { - l = m.BuildkitVersion.Size() - n += 1 + l + sovWorker(uint64(l)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -551,30 +412,6 @@ func (m *GCPolicy) Size() (n int) { return n } -func (m *BuildkitVersion) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Package) - if l > 0 { - n += 1 + l + sovWorker(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovWorker(uint64(l)) - } - l = len(m.Revision) - if l > 0 { - n += 1 + l + sovWorker(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func sovWorker(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -837,42 +674,6 @@ func (m *WorkerRecord) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildkitVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWorker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWorker - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWorker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BuildkitVersion == nil { - m.BuildkitVersion = &BuildkitVersion{} - } - if err := m.BuildkitVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipWorker(dAtA[iNdEx:]) @@ -1036,153 +837,6 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } return nil } -func (m *BuildkitVersion) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWorker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BuildkitVersion: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BuildkitVersion: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWorker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWorker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWorker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Package = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWorker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWorker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWorker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWorker - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWorker - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWorker - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Revision = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWorker(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWorker - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipWorker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/api/types/worker.proto b/api/types/worker.proto index 476fcc62e104..82dd7ad65145 100644 --- a/api/types/worker.proto +++ b/api/types/worker.proto @@ -14,7 +14,6 @@ message WorkerRecord { map Labels = 2; repeated pb.Platform platforms = 3 [(gogoproto.nullable) = false]; repeated GCPolicy GCPolicy = 4; - BuildkitVersion BuildkitVersion = 5; } message GCPolicy { @@ -23,9 +22,3 @@ message GCPolicy { int64 keepBytes = 3; repeated string filters = 4; } - -message BuildkitVersion { - string package = 1; - string version = 2; - string revision = 3; -} diff --git a/client/info.go b/client/info.go index 68f883d56ff8..71f27c86ec0f 100644 --- a/client/info.go +++ b/client/info.go @@ -4,37 +4,29 @@ import ( "context" controlapi "github.com/moby/buildkit/api/services/control" - apitypes "github.com/moby/buildkit/api/types" "github.com/pkg/errors" ) -type Info struct { - BuildkitVersion BuildkitVersion +type InfoResponse struct { + BuildkitVersion Version } -type BuildkitVersion struct { - Package string - Version string - Revision string -} - -func (c *Client) Info(ctx context.Context) (*Info, error) { +func (c *Client) Info(ctx context.Context) (*InfoResponse, error) { res, err := c.controlClient().Info(ctx, &controlapi.InfoRequest{}) if err != nil { return nil, errors.Wrap(err, "failed to call info") } - return &Info{ - BuildkitVersion: fromAPIBuildkitVersion(res.BuildkitVersion), + return &InfoResponse{ + BuildkitVersion: Version{ + Package: res.BuildkitVersion.Package, + Version: res.BuildkitVersion.Version, + Revision: res.BuildkitVersion.Revision, + }, }, nil } -func fromAPIBuildkitVersion(in *apitypes.BuildkitVersion) BuildkitVersion { - if in == nil { - return BuildkitVersion{} - } - return BuildkitVersion{ - Package: in.Package, - Version: in.Version, - Revision: in.Revision, - } +type Version struct { + Package string + Version string + Revision string } diff --git a/client/workers.go b/client/workers.go index 89311e3912fa..e5331cd608c4 100644 --- a/client/workers.go +++ b/client/workers.go @@ -13,11 +13,10 @@ import ( // WorkerInfo contains information about a worker type WorkerInfo struct { - ID string `json:"id"` - Labels map[string]string `json:"labels"` - Platforms []ocispecs.Platform `json:"platforms"` - GCPolicy []PruneInfo `json:"gcPolicy"` - BuildkitVersion BuildkitVersion `json:"buildkitVersion"` + ID string `json:"id"` + Labels map[string]string `json:"labels"` + Platforms []ocispecs.Platform `json:"platforms"` + GCPolicy []PruneInfo `json:"gcPolicy"` } // ListWorkers lists all active workers @@ -37,11 +36,10 @@ func (c *Client) ListWorkers(ctx context.Context, opts ...ListWorkersOption) ([] for _, w := range resp.Record { wi = append(wi, &WorkerInfo{ - ID: w.ID, - Labels: w.Labels, - Platforms: pb.ToSpecPlatforms(w.Platforms), - GCPolicy: fromAPIGCPolicy(w.GCPolicy), - BuildkitVersion: fromAPIBuildkitVersion(w.BuildkitVersion), + ID: w.ID, + Labels: w.Labels, + Platforms: pb.ToSpecPlatforms(w.Platforms), + GCPolicy: fromAPIGCPolicy(w.GCPolicy), }) } diff --git a/cmd/buildctl/debug/workers.go b/cmd/buildctl/debug/workers.go index dbe4499f8e78..feacf4beefbe 100644 --- a/cmd/buildctl/debug/workers.go +++ b/cmd/buildctl/debug/workers.go @@ -79,7 +79,6 @@ func printWorkersVerbose(tw *tabwriter.Writer, winfo []*client.WorkerInfo) { for _, wi := range winfo { fmt.Fprintf(tw, "ID:\t%s\n", wi.ID) fmt.Fprintf(tw, "Platforms:\t%s\n", joinPlatforms(wi.Platforms)) - fmt.Fprintf(tw, "BuildKit:\t%s %s %s\n", wi.BuildkitVersion.Package, wi.BuildkitVersion.Version, wi.BuildkitVersion.Revision) fmt.Fprintf(tw, "Labels:\n") for _, k := range sortedKeys(wi.Labels) { v := wi.Labels[k] diff --git a/cmd/buildkitd/main.go b/cmd/buildkitd/main.go index 618975465545..cdccc7cbf106 100644 --- a/cmd/buildkitd/main.go +++ b/cmd/buildkitd/main.go @@ -759,14 +759,6 @@ func getGCPolicy(cfg config.GCConfig, root string) []client.PruneInfo { return out } -func getBuildkitVersion() client.BuildkitVersion { - return client.BuildkitVersion{ - Package: version.Package, - Version: version.Version, - Revision: version.Revision, - } -} - func getDNSConfig(cfg *config.DNSConfig) *oci.DNSConfig { var dns *oci.DNSConfig if cfg != nil { diff --git a/cmd/buildkitd/main_containerd_worker.go b/cmd/buildkitd/main_containerd_worker.go index a3bb8ac30ab4..fe917422e86f 100644 --- a/cmd/buildkitd/main_containerd_worker.go +++ b/cmd/buildkitd/main_containerd_worker.go @@ -264,7 +264,6 @@ func containerdWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([ return nil, err } opt.GCPolicy = getGCPolicy(cfg.GCConfig, common.config.Root) - opt.BuildkitVersion = getBuildkitVersion() opt.RegistryHosts = resolverFunc(common.config) if platformsStr := cfg.Platforms; len(platformsStr) != 0 { diff --git a/cmd/buildkitd/main_oci_worker.go b/cmd/buildkitd/main_oci_worker.go index 49153af5fb48..e3c3bb52e96f 100644 --- a/cmd/buildkitd/main_oci_worker.go +++ b/cmd/buildkitd/main_oci_worker.go @@ -295,7 +295,6 @@ func ociWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([]worker return nil, err } opt.GCPolicy = getGCPolicy(cfg.GCConfig, common.config.Root) - opt.BuildkitVersion = getBuildkitVersion() opt.RegistryHosts = hosts if platformsStr := cfg.Platforms; len(platformsStr) != 0 { diff --git a/control/control.go b/control/control.go index fde476803175..7cb6d7436897 100644 --- a/control/control.go +++ b/control/control.go @@ -426,11 +426,10 @@ func (c *Controller) ListWorkers(ctx context.Context, r *controlapi.ListWorkersR } for _, w := range workers { resp.Record = append(resp.Record, &apitypes.WorkerRecord{ - ID: w.ID(), - Labels: w.Labels(), - Platforms: pb.PlatformsFromSpec(w.Platforms(true)), - GCPolicy: toPBGCPolicy(w.GCPolicy()), - BuildkitVersion: toPBBuildkitVersion(w.BuildkitVersion()), + ID: w.ID(), + Labels: w.Labels(), + Platforms: pb.PlatformsFromSpec(w.Platforms(true)), + GCPolicy: toPBGCPolicy(w.GCPolicy()), }) } return resp, nil @@ -438,7 +437,7 @@ func (c *Controller) ListWorkers(ctx context.Context, r *controlapi.ListWorkersR func (c *Controller) Info(ctx context.Context, r *controlapi.InfoRequest) (*controlapi.InfoResponse, error) { return &controlapi.InfoResponse{ - BuildkitVersion: &apitypes.BuildkitVersion{ + BuildkitVersion: &controlapi.Version{ Package: version.Package, Version: version.Version, Revision: version.Revision, @@ -511,11 +510,3 @@ func toPBGCPolicy(in []client.PruneInfo) []*apitypes.GCPolicy { } return policy } - -func toPBBuildkitVersion(in client.BuildkitVersion) *apitypes.BuildkitVersion { - return &apitypes.BuildkitVersion{ - Package: in.Package, - Version: in.Version, - Revision: in.Revision, - } -} diff --git a/worker/base/worker.go b/worker/base/worker.go index 44db745d0670..7db6dc29a622 100644 --- a/worker/base/worker.go +++ b/worker/base/worker.go @@ -61,7 +61,6 @@ type WorkerOpt struct { Labels map[string]string Platforms []ocispecs.Platform GCPolicy []client.PruneInfo - BuildkitVersion client.BuildkitVersion Executor executor.Executor Snapshotter snapshot.Snapshotter ContentStore content.Store @@ -219,10 +218,6 @@ func (w *Worker) GCPolicy() []client.PruneInfo { return w.WorkerOpt.GCPolicy } -func (w *Worker) BuildkitVersion() client.BuildkitVersion { - return w.WorkerOpt.BuildkitVersion -} - func (w *Worker) LoadRef(ctx context.Context, id string, hidden bool) (cache.ImmutableRef, error) { var opts []cache.RefOption if hidden { diff --git a/worker/worker.go b/worker/worker.go index 00ce568aebc5..743513bb0a98 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -21,7 +21,6 @@ type Worker interface { ID() string Labels() map[string]string Platforms(noCache bool) []ocispecs.Platform - BuildkitVersion() client.BuildkitVersion GCPolicy() []client.PruneInfo LoadRef(ctx context.Context, id string, hidden bool) (cache.ImmutableRef, error) diff --git a/worker/workercontroller.go b/worker/workercontroller.go index d00080c1694d..26ca9459231c 100644 --- a/worker/workercontroller.go +++ b/worker/workercontroller.go @@ -62,10 +62,9 @@ func (c *Controller) WorkerInfos() []client.WorkerInfo { out := make([]client.WorkerInfo, 0, len(c.workers)) for _, w := range c.workers { out = append(out, client.WorkerInfo{ - ID: w.ID(), - Labels: w.Labels(), - Platforms: w.Platforms(false), - BuildkitVersion: w.BuildkitVersion(), + ID: w.ID(), + Labels: w.Labels(), + Platforms: w.Platforms(false), }) } return out From fc632ab04aa70fb8fb97b8aaa441b4ecabd48b76 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 4 Oct 2022 15:41:00 +0200 Subject: [PATCH 21/21] Revert "control: add info service" This reverts commit 63d12159af4f42e50bc8e13db5166d7e68ff033a. Signed-off-by: Sebastiaan van Stijn --- api/services/control/control.pb.go | 841 ++++------------------------- api/services/control/control.proto | 14 +- client/client_test.go | 10 - client/info.go | 32 -- cmd/buildctl/debug.go | 1 - cmd/buildctl/debug/info.go | 30 - control/control.go | 14 +- 7 files changed, 101 insertions(+), 841 deletions(-) delete mode 100644 client/info.go delete mode 100644 cmd/buildctl/debug/info.go diff --git a/api/services/control/control.pb.go b/api/services/control/control.pb.go index 8a9a29826375..939f2c2ca7d8 100644 --- a/api/services/control/control.pb.go +++ b/api/services/control/control.pb.go @@ -1240,155 +1240,6 @@ func (m *ListWorkersResponse) GetRecord() []*types.WorkerRecord { return nil } -type Version struct { - Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{17} -} -func (m *Version) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} -func (m *Version) XXX_Size() int { - return m.Size() -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) -} - -var xxx_messageInfo_Version proto.InternalMessageInfo - -func (m *Version) GetPackage() string { - if m != nil { - return m.Package - } - return "" -} - -func (m *Version) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *Version) GetRevision() string { - if m != nil { - return m.Revision - } - return "" -} - -type InfoRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InfoRequest) Reset() { *m = InfoRequest{} } -func (m *InfoRequest) String() string { return proto.CompactTextString(m) } -func (*InfoRequest) ProtoMessage() {} -func (*InfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{18} -} -func (m *InfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoRequest.Merge(m, src) -} -func (m *InfoRequest) XXX_Size() int { - return m.Size() -} -func (m *InfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoRequest proto.InternalMessageInfo - -type InfoResponse struct { - BuildkitVersion *Version `protobuf:"bytes,1,opt,name=buildkitVersion,proto3" json:"buildkitVersion,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InfoResponse) Reset() { *m = InfoResponse{} } -func (m *InfoResponse) String() string { return proto.CompactTextString(m) } -func (*InfoResponse) ProtoMessage() {} -func (*InfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{19} -} -func (m *InfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoResponse.Merge(m, src) -} -func (m *InfoResponse) XXX_Size() int { - return m.Size() -} -func (m *InfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoResponse proto.InternalMessageInfo - -func (m *InfoResponse) GetBuildkitVersion() *Version { - if m != nil { - return m.BuildkitVersion - } - return nil -} - func init() { proto.RegisterType((*PruneRequest)(nil), "moby.buildkit.v1.PruneRequest") proto.RegisterType((*DiskUsageRequest)(nil), "moby.buildkit.v1.DiskUsageRequest") @@ -1413,118 +1264,109 @@ func init() { proto.RegisterType((*BytesMessage)(nil), "moby.buildkit.v1.BytesMessage") proto.RegisterType((*ListWorkersRequest)(nil), "moby.buildkit.v1.ListWorkersRequest") proto.RegisterType((*ListWorkersResponse)(nil), "moby.buildkit.v1.ListWorkersResponse") - proto.RegisterType((*Version)(nil), "moby.buildkit.v1.Version") - proto.RegisterType((*InfoRequest)(nil), "moby.buildkit.v1.InfoRequest") - proto.RegisterType((*InfoResponse)(nil), "moby.buildkit.v1.InfoResponse") } func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } var fileDescriptor_0c5120591600887d = []byte{ - // 1635 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0x1b, 0x47, - 0x16, 0x76, 0x73, 0xe7, 0x23, 0xa5, 0x91, 0xcb, 0x1e, 0xa3, 0xa7, 0x07, 0x23, 0xc9, 0x6d, 0x0f, - 0x20, 0x18, 0x76, 0x53, 0xe6, 0x8c, 0x67, 0x3c, 0x9a, 0x05, 0x36, 0x45, 0xcd, 0x58, 0x86, 0x85, - 0xf1, 0x14, 0xbd, 0x60, 0x7c, 0x08, 0xd0, 0x24, 0x4b, 0x54, 0x43, 0xcd, 0xae, 0x4e, 0x55, 0xb5, - 0x6c, 0xe5, 0x07, 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23, 0x41, 0xa2, 0xbe, 0x0a, 0x7d, 0x15, 0x8f, 0x68, 0xa9, 0x4e, - 0xba, 0xd6, 0xea, 0x94, 0xcf, 0xa4, 0xce, 0x98, 0x8c, 0x51, 0x67, 0x6c, 0x0f, 0x6d, 0x40, 0x71, - 0xd3, 0xef, 0xed, 0x11, 0x15, 0xe5, 0x5a, 0x73, 0x79, 0x1a, 0x50, 0x1d, 0xff, 0x57, 0x85, 0x95, - 0xab, 0x42, 0xbd, 0x84, 0xb5, 0x08, 0xfa, 0x08, 0xea, 0x5b, 0x91, 0x08, 0x44, 0x48, 0x86, 0x2a, - 0x62, 0x55, 0x19, 0xb1, 0xd6, 0xc6, 0xbb, 0xa3, 0x95, 0xbf, 0xcc, 0xbd, 0x78, 0x12, 0x11, 0x84, - 0x0d, 0x92, 0x91, 0xf2, 0x32, 0x10, 0x78, 0x0c, 0x0f, 0xbd, 0x82, 0xc5, 0x54, 0xd9, 0xed, 0x28, - 0x4e, 0x04, 0xb7, 0x41, 0x59, 0xdd, 0x3c, 0xa3, 0xd5, 0x5a, 0x48, 0x9b, 0x3d, 0x81, 0xe4, 0x3c, - 0x00, 0x34, 0x1d, 0x2b, 0x99, 0x53, 0xfb, 0xe4, 0x30, 0xcd, 0xa9, 0x7d, 0x72, 0x28, 0xcb, 0xfa, - 0xc0, 0x0f, 0x13, 0x5d, 0xee, 0x55, 0xac, 0x89, 0x8d, 0xdc, 0x7d, 0x4b, 0x22, 0x4c, 0xbb, 0xf7, - 0x5c, 0x08, 0xff, 0x83, 0x2b, 0x33, 0x54, 0x9d, 0x01, 0x71, 0x33, 0x0b, 0x31, 0x9d, 0xd3, 0xc7, - 0x90, 0xee, 0x57, 0x79, 0xa8, 0x67, 0x03, 0x86, 0xd6, 0xe1, 0x8a, 0xb6, 0x13, 0x93, 0xdd, 0x36, - 0x89, 0x19, 0xe9, 0xc9, 0x5b, 0xc2, 0x80, 0xcf, 0x3a, 0x42, 0x4d, 0xb8, 0xba, 0x3d, 0x34, 0xdb, - 0x3c, 0x23, 0x92, 0x53, 0xf5, 0x38, 0xf3, 0x0c, 0x51, 0xf8, 0xad, 0x86, 0x52, 0x9e, 0xc8, 0x08, - 0xe5, 0x55, 0xc0, 0xfe, 0x76, 0x72, 0x56, 0x79, 0x33, 0x65, 0x75, 0xdc, 0x66, 0xe3, 0xa2, 0x7f, - 0x42, 0x59, 0x1f, 0xa4, 0x85, 0x79, 0xe3, 0xe4, 0x4f, 0x68, 0xb0, 0x54, 0x46, 0x8a, 0x6b, 0x3b, - 0xb8, 0x5d, 0x3c, 0x87, 0xb8, 0x91, 0x71, 0x1e, 0x81, 0x33, 0x5f, 0xe5, 0xf3, 0xa4, 0x80, 0xfb, - 0xa5, 0x05, 0x97, 0xa7, 0x3e, 0x24, 0x5f, 0x0d, 0x75, 0x6f, 0x6a, 0x08, 0xb5, 0x46, 0x6d, 0x28, - 0xea, 0xca, 0xcf, 0x29, 0x85, 0xbd, 0x33, 0x28, 0xec, 0x65, 0xca, 0x5e, 0x0b, 0x3b, 0xf7, 0x01, - 0x2e, 0x96, 0xac, 0xee, 0x37, 0x16, 0x2c, 0x98, 0x2a, 0x33, 0x4f, 0xac, 0x0f, 0x4b, 0x69, 0x09, - 0xa5, 0x7b, 0xe6, 0xb1, 0xbd, 0x37, 0xb7, 0x40, 0x35, 0x9b, 0x37, 0x29, 0xa7, 0x75, 0x9c, 0x82, - 0x73, 0x36, 0xd3, 0xbc, 0x9a, 0x60, 0x3d, 0x97, 0xe6, 0xd7, 0x61, 0xa1, 0x23, 0x7c, 0x91, 0xf0, - 0xb9, 0x2f, 0x87, 0xfb, 0x93, 0x05, 0x8b, 0x29, 0x8f, 0xb1, 0xee, 0xcf, 0x50, 0x39, 0x20, 0x4c, - 0x90, 0x37, 0x84, 0x1b, 0xab, 0xec, 0x69, 0xab, 0x5e, 0x28, 0x0e, 0x3c, 0xe2, 0x44, 0x1b, 0x50, - 0xe1, 0x0a, 0x87, 0xa4, 0x81, 0x5a, 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 0xca, 0x4e, 0x0b, 0xce, 0xca, 0x29, 0xcd, - 0x0a, 0xda, 0x81, 0x92, 0xb9, 0x88, 0x67, 0xb1, 0x66, 0x3b, 0x0b, 0x67, 0x75, 0x3e, 0x83, 0x06, - 0x5b, 0xb7, 0xd0, 0xce, 0x68, 0x00, 0x9c, 0xa5, 0x5a, 0x36, 0x8b, 0x9d, 0x53, 0xce, 0xd7, 0xac, - 0x75, 0x0b, 0xbd, 0x82, 0x5a, 0x26, 0x4f, 0xd1, 0x8c, 0x7c, 0x9c, 0x4e, 0x7a, 0xe7, 0x8f, 0xa7, - 0x70, 0x19, 0xcb, 0xb7, 0xa0, 0x20, 0x93, 0x08, 0xcd, 0x70, 0x76, 0x26, 0xd7, 0x66, 0xa9, 0x99, - 0xcd, 0xbd, 0x56, 0xfd, 0xed, 0xfb, 0x65, 0xeb, 0xbb, 0xf7, 0xcb, 0xd6, 0x0f, 0xef, 0x97, 0xad, - 0x6e, 0x49, 0x5d, 0x7c, 0x7f, 0xfa, 0x25, 0x00, 0x00, 0xff, 0xff, 0x52, 0xcc, 0x4a, 0x01, 0x3c, - 0x13, 0x00, 0x00, + // 1543 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xef, 0xda, 0xf1, 0xd7, 0x8b, 0x13, 0xa5, 0xd3, 0x52, 0xad, 0x16, 0x91, 0xa4, 0xdb, 0x22, + 0x45, 0x55, 0xbb, 0x4e, 0x03, 0x85, 0x12, 0x3e, 0xd4, 0x3a, 0x2e, 0x34, 0x55, 0x23, 0xca, 0xa4, + 0xa5, 0x52, 0x0f, 0x48, 0x6b, 0x7b, 0xbc, 0x59, 0x65, 0xbd, 0xb3, 0xcc, 0xcc, 0xa6, 0x35, 0x7f, + 0x00, 0x67, 0x6e, 0xfc, 0x01, 0x1c, 0x38, 0x71, 0xe6, 0x2f, 0x40, 0xea, 0x91, 0x73, 0x0f, 0x01, + 0xf5, 0x0e, 0xe2, 0xc8, 0x11, 0xcd, 0xc7, 0x3a, 0xeb, 0xd8, 0xce, 0x57, 0x39, 0x79, 0xde, 0xcc, + 0x7b, 0xbf, 0x7d, 0x9f, 0x33, 0xef, 0x19, 0xe6, 0x3a, 0x34, 0x16, 0x8c, 0x46, 0x5e, 0xc2, 0xa8, + 0xa0, 0x68, 0xa1, 0x4f, 0xdb, 0x03, 0xaf, 0x9d, 0x86, 0x51, 0x77, 0x37, 0x14, 0xde, 0xde, 0x4d, + 0xe7, 0x46, 0x10, 0x8a, 0x9d, 0xb4, 0xed, 0x75, 0x68, 0xbf, 0x11, 0xd0, 0x80, 0x36, 0x14, 0x63, + 0x3b, 0xed, 0x29, 0x4a, 0x11, 0x6a, 0xa5, 0x01, 0x9c, 0xa5, 0x80, 0xd2, 0x20, 0x22, 0x07, 0x5c, + 0x22, 0xec, 0x13, 0x2e, 0xfc, 0x7e, 0x62, 0x18, 0xae, 0xe7, 0xf0, 0xe4, 0xc7, 0x1a, 0xd9, 0xc7, + 0x1a, 0x9c, 0x46, 0x7b, 0x84, 0x35, 0x92, 0x76, 0x83, 0x26, 0xdc, 0x70, 0x37, 0xa6, 0x72, 0xfb, + 0x49, 0xd8, 0x10, 0x83, 0x84, 0xf0, 0xc6, 0x73, 0xca, 0x76, 0x09, 0xd3, 0x02, 0xee, 0xf7, 0x16, + 0xd4, 0x1f, 0xb1, 0x34, 0x26, 0x98, 0x7c, 0x9b, 0x12, 0x2e, 0xd0, 0x25, 0x28, 0xf7, 0xc2, 0x48, + 0x10, 0x66, 0x5b, 0xcb, 0xc5, 0x95, 0x1a, 0x36, 0x14, 0x5a, 0x80, 0xa2, 0x1f, 0x45, 0x76, 0x61, + 0xd9, 0x5a, 0xa9, 0x62, 0xb9, 0x44, 0x2b, 0x50, 0xdf, 0x25, 0x24, 0x69, 0xa5, 0xcc, 0x17, 0x21, + 0x8d, 0xed, 0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x6b, 0x75, 0x2a, + 0x27, 0x52, 0x67, 0x44, 0xc6, 0xa8, 0x33, 0xb2, 0x87, 0xd6, 0xa1, 0xb4, 0xe1, 0x77, 0x76, 0x88, + 0x8a, 0xf2, 0xec, 0xda, 0xe2, 0x38, 0xa0, 0x3a, 0xfe, 0x52, 0x85, 0x95, 0xab, 0x42, 0x3d, 0x87, + 0xb5, 0x08, 0xfa, 0x06, 0xea, 0xf7, 0x62, 0x11, 0x8a, 0x88, 0xf4, 0x55, 0xc4, 0x6a, 0x32, 0x62, + 0xcd, 0xf5, 0x57, 0xfb, 0x4b, 0x1f, 0x4c, 0xbd, 0x78, 0x52, 0x11, 0x46, 0x0d, 0x92, 0x93, 0xf2, + 0x72, 0x10, 0x78, 0x04, 0x0f, 0x3d, 0x83, 0xf9, 0x4c, 0xd9, 0xcd, 0x38, 0x49, 0x05, 0xb7, 0x41, + 0x59, 0xbd, 0x76, 0x42, 0xab, 0xb5, 0x90, 0x36, 0xfb, 0x10, 0x92, 0x73, 0x07, 0xd0, 0x78, 0xac, + 0x64, 0x4e, 0xed, 0x92, 0x41, 0x96, 0x53, 0xbb, 0x64, 0x20, 0xcb, 0x7a, 0xcf, 0x8f, 0x52, 0x5d, + 0xee, 0x35, 0xac, 0x89, 0xf5, 0xc2, 0x6d, 0x4b, 0x22, 0x8c, 0xbb, 0xf7, 0x54, 0x08, 0x5f, 0xc1, + 0x85, 0x09, 0xaa, 0x4e, 0x80, 0xb8, 0x9a, 0x87, 0x18, 0xcf, 0xe9, 0x03, 0x48, 0xf7, 0x97, 0x22, + 0xd4, 0xf3, 0x01, 0x43, 0xab, 0x70, 0x41, 0xdb, 0x89, 0x49, 0xaf, 0x45, 0x12, 0x46, 0x3a, 0xf2, + 0x96, 0x30, 0xe0, 0x93, 0x8e, 0xd0, 0x1a, 0x5c, 0xdc, 0xec, 0x9b, 0x6d, 0x9e, 0x13, 0x29, 0xa8, + 0x7a, 0x9c, 0x78, 0x86, 0x28, 0xbc, 0xa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ff, 0x54, + 0x8e, 0x72, 0x11, 0x36, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1545,7 +1387,6 @@ type ControlClient interface { Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (Control_StatusClient, error) Session(ctx context.Context, opts ...grpc.CallOption) (Control_SessionClient, error) ListWorkers(ctx context.Context, in *ListWorkersRequest, opts ...grpc.CallOption) (*ListWorkersResponse, error) - Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) } type controlClient struct { @@ -1678,15 +1519,6 @@ func (c *controlClient) ListWorkers(ctx context.Context, in *ListWorkersRequest, return out, nil } -func (c *controlClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - out := new(InfoResponse) - err := c.cc.Invoke(ctx, "/moby.buildkit.v1.Control/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // ControlServer is the server API for Control service. type ControlServer interface { DiskUsage(context.Context, *DiskUsageRequest) (*DiskUsageResponse, error) @@ -1695,7 +1527,6 @@ type ControlServer interface { Status(*StatusRequest, Control_StatusServer) error Session(Control_SessionServer) error ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) - Info(context.Context, *InfoRequest) (*InfoResponse, error) } // UnimplementedControlServer can be embedded to have forward compatible implementations. @@ -1720,9 +1551,6 @@ func (*UnimplementedControlServer) Session(srv Control_SessionServer) error { func (*UnimplementedControlServer) ListWorkers(ctx context.Context, req *ListWorkersRequest) (*ListWorkersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListWorkers not implemented") } -func (*UnimplementedControlServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") -} func RegisterControlServer(s *grpc.Server, srv ControlServer) { s.RegisterService(&_Control_serviceDesc, srv) @@ -1850,24 +1678,6 @@ func _Control_ListWorkers_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Control_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ControlServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/moby.buildkit.v1.Control/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ControlServer).Info(ctx, req.(*InfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Control_serviceDesc = grpc.ServiceDesc{ ServiceName: "moby.buildkit.v1.Control", HandlerType: (*ControlServer)(nil), @@ -1884,10 +1694,6 @@ var _Control_serviceDesc = grpc.ServiceDesc{ MethodName: "ListWorkers", Handler: _Control_ListWorkers_Handler, }, - { - MethodName: "Info", - Handler: _Control_Info_Handler, - }, }, Streams: []grpc.StreamDesc{ { @@ -3059,120 +2865,6 @@ func (m *ListWorkersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Version) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Version) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Revision) > 0 { - i -= len(m.Revision) - copy(dAtA[i:], m.Revision) - i = encodeVarintControl(dAtA, i, uint64(len(m.Revision))) - i-- - dAtA[i] = 0x1a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintControl(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Package) > 0 { - i -= len(m.Package) - copy(dAtA[i:], m.Package) - i = encodeVarintControl(dAtA, i, uint64(len(m.Package))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *InfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *InfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.BuildkitVersion != nil { - { - size, err := m.BuildkitVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintControl(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintControl(dAtA []byte, offset int, v uint64) int { offset -= sovControl(v) base := offset @@ -3714,58 +3406,6 @@ func (m *ListWorkersResponse) Size() (n int) { return n } -func (m *Version) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Package) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - l = len(m.Revision) - if l > 0 { - n += 1 + l + sovControl(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *InfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *InfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BuildkitVersion != nil { - l = m.BuildkitVersion.Size() - n += 1 + l + sovControl(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func sovControl(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7379,291 +7019,6 @@ func (m *ListWorkersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Version) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Version: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Package = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Revision = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InfoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InfoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildkitVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowControl - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthControl - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthControl - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BuildkitVersion == nil { - m.BuildkitVersion = &Version{} - } - if err := m.BuildkitVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipControl(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipControl(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/api/services/control/control.proto b/api/services/control/control.proto index f62efe3d1940..a468a293af88 100644 --- a/api/services/control/control.proto +++ b/api/services/control/control.proto @@ -18,7 +18,7 @@ service Control { rpc Status(StatusRequest) returns (stream StatusResponse); rpc Session(stream BytesMessage) returns (stream BytesMessage); rpc ListWorkers(ListWorkersRequest) returns (ListWorkersResponse); - rpc Info(InfoRequest) returns (InfoResponse); + // rpc Info(InfoRequest) returns (InfoResponse); } message PruneRequest { @@ -157,15 +157,3 @@ message ListWorkersRequest { message ListWorkersResponse { repeated moby.buildkit.v1.types.WorkerRecord record = 1; } - -message Version { - string package = 1; - string version = 2; - string revision = 3; -} - -message InfoRequest {} - -message InfoResponse { - Version buildkitVersion = 1; -} diff --git a/client/client_test.go b/client/client_test.go index eb2dfb6f44ac..9f41cad1ad35 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -160,7 +160,6 @@ func TestIntegration(t *testing.T) { testUncompressedLocalCacheImportExport, testUncompressedRegistryCacheImportExport, testStargzLazyRegistryCacheImportExport, - testCallInfo, ) tests = append(tests, diffOpTestCases()...) integration.Run(t, tests, mirrors) @@ -5728,15 +5727,6 @@ func testBuildInfoNoExport(t *testing.T, sb integration.Sandbox) { require.Equal(t, exbi.Sources[0].Ref, "docker.io/library/busybox:latest") } -func testCallInfo(t *testing.T, sb integration.Sandbox) { - integration.SkipIfDockerd(t, sb, "not implemented") - c, err := New(sb.Context(), sb.Address()) - require.NoError(t, err) - defer c.Close() - _, err = c.Info(sb.Context()) - require.NoError(t, err) -} - func tmpdir(appliers ...fstest.Applier) (string, error) { tmpdir, err := os.MkdirTemp("", "buildkit-client") if err != nil { diff --git a/client/info.go b/client/info.go deleted file mode 100644 index 71f27c86ec0f..000000000000 --- a/client/info.go +++ /dev/null @@ -1,32 +0,0 @@ -package client - -import ( - "context" - - controlapi "github.com/moby/buildkit/api/services/control" - "github.com/pkg/errors" -) - -type InfoResponse struct { - BuildkitVersion Version -} - -func (c *Client) Info(ctx context.Context) (*InfoResponse, error) { - res, err := c.controlClient().Info(ctx, &controlapi.InfoRequest{}) - if err != nil { - return nil, errors.Wrap(err, "failed to call info") - } - return &InfoResponse{ - BuildkitVersion: Version{ - Package: res.BuildkitVersion.Package, - Version: res.BuildkitVersion.Version, - Revision: res.BuildkitVersion.Revision, - }, - }, nil -} - -type Version struct { - Package string - Version string - Revision string -} diff --git a/cmd/buildctl/debug.go b/cmd/buildctl/debug.go index 2db7a6cfb6a2..a6a33b6f8882 100644 --- a/cmd/buildctl/debug.go +++ b/cmd/buildctl/debug.go @@ -12,6 +12,5 @@ var debugCommand = cli.Command{ debug.DumpLLBCommand, debug.DumpMetadataCommand, debug.WorkersCommand, - debug.InfoCommand, }, } diff --git a/cmd/buildctl/debug/info.go b/cmd/buildctl/debug/info.go deleted file mode 100644 index 6e9af149c844..000000000000 --- a/cmd/buildctl/debug/info.go +++ /dev/null @@ -1,30 +0,0 @@ -package debug - -import ( - "fmt" - "os" - "text/tabwriter" - - bccommon "github.com/moby/buildkit/cmd/buildctl/common" - "github.com/urfave/cli" -) - -var InfoCommand = cli.Command{ - Name: "info", - Usage: "display internal information", - Action: info, -} - -func info(clicontext *cli.Context) error { - c, err := bccommon.ResolveClient(clicontext) - if err != nil { - return err - } - res, err := c.Info(bccommon.CommandContext(clicontext)) - if err != nil { - return err - } - w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) - _, _ = fmt.Fprintf(w, "BuildKit:\t%s %s %s\n", res.BuildkitVersion.Package, res.BuildkitVersion.Version, res.BuildkitVersion.Revision) - return w.Flush() -} diff --git a/control/control.go b/control/control.go index 7cb6d7436897..0d3e7976e5b7 100644 --- a/control/control.go +++ b/control/control.go @@ -6,6 +6,8 @@ import ( "sync/atomic" "time" + "github.com/moby/buildkit/util/bklog" + controlapi "github.com/moby/buildkit/api/services/control" apitypes "github.com/moby/buildkit/api/types" "github.com/moby/buildkit/cache/remotecache" @@ -18,11 +20,9 @@ import ( "github.com/moby/buildkit/solver" "github.com/moby/buildkit/solver/llbsolver" "github.com/moby/buildkit/solver/pb" - "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/imageutil" "github.com/moby/buildkit/util/throttle" "github.com/moby/buildkit/util/tracing/transform" - "github.com/moby/buildkit/version" "github.com/moby/buildkit/worker" "github.com/pkg/errors" sdktrace "go.opentelemetry.io/otel/sdk/trace" @@ -435,16 +435,6 @@ func (c *Controller) ListWorkers(ctx context.Context, r *controlapi.ListWorkersR return resp, nil } -func (c *Controller) Info(ctx context.Context, r *controlapi.InfoRequest) (*controlapi.InfoResponse, error) { - return &controlapi.InfoResponse{ - BuildkitVersion: &controlapi.Version{ - Package: version.Package, - Version: version.Version, - Revision: version.Revision, - }, - }, nil -} - func (c *Controller) gc() { c.gcmu.Lock() defer c.gcmu.Unlock()