vendor: github.com/moby/buildkit v0.10.2
note that the previous version we used was from the master branch, so some changes, for example, replacing the deprecated `io/ioutil` package are reverted in this update. raw diff: https://github.com/moby/buildkit/compare/d7744bcb3532..v0.10.2 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
fca0c20cd4
commit
82088364e1
38 changed files with 172 additions and 102 deletions
|
@ -49,7 +49,7 @@ require (
|
|||
github.com/klauspost/compress v1.15.1
|
||||
github.com/miekg/dns v1.1.27
|
||||
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible
|
||||
github.com/moby/buildkit v0.10.1-0.20220327110152-d7744bcb3532
|
||||
github.com/moby/buildkit v0.10.2
|
||||
github.com/moby/ipvs v1.0.1
|
||||
github.com/moby/locker v1.0.1
|
||||
github.com/moby/swarmkit/v2 v2.0.0-20220420172245-6068d1894d46
|
||||
|
|
|
@ -725,8 +725,8 @@ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4
|
|||
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
|
||||
github.com/moby/buildkit v0.10.1-0.20220327110152-d7744bcb3532 h1:rR5v5qILq+0Cm6NqPV4hSEgsUsGQ+KJvgNy7GkRf5fk=
|
||||
github.com/moby/buildkit v0.10.1-0.20220327110152-d7744bcb3532/go.mod h1:g7CFu3cq4bl1f3XLmF6eDF9EsYjnJ2oZYann8kKJvPc=
|
||||
github.com/moby/buildkit v0.10.2 h1:jywa+mPPtsfCQqpIbt72RUKf49hTTCirTqIs4LG0n+8=
|
||||
github.com/moby/buildkit v0.10.2/go.mod h1:jxeOuly98l9gWHai0Ojrbnczrk/rf+o9/JqNhY+UCSo=
|
||||
github.com/moby/ipvs v1.0.1 h1:aoZ7fhLTXgDbzVrAnvV+XbKOU8kOET7B3+xULDF/1o0=
|
||||
github.com/moby/ipvs v1.0.1/go.mod h1:2pngiyseZbIKXNv7hsKj3O9UEz30c53MT9005gt2hxQ=
|
||||
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
||||
|
|
15
vendor/github.com/moby/buildkit/cache/manager.go
generated
vendored
15
vendor/github.com/moby/buildkit/cache/manager.go
generated
vendored
|
@ -458,6 +458,13 @@ func (cm *cacheManager) getRecord(ctx context.Context, id string, opts ...RefOpt
|
|||
cacheMetadata: md,
|
||||
}
|
||||
|
||||
// TODO:(sipsma) this is kludge to deal with a bug in v0.10.{0,1} where
|
||||
// merge and diff refs didn't have committed set to true:
|
||||
// https://github.com/moby/buildkit/issues/2740
|
||||
if kind := rec.kind(); kind == Merge || kind == Diff {
|
||||
rec.mutable = false
|
||||
}
|
||||
|
||||
// the record was deleted but we crashed before data on disk was removed
|
||||
if md.getDeleted() {
|
||||
if err := rec.remove(ctx, true); err != nil {
|
||||
|
@ -496,6 +503,11 @@ func (cm *cacheManager) getRecord(ctx context.Context, id string, opts ...RefOpt
|
|||
}
|
||||
|
||||
func (cm *cacheManager) parentsOf(ctx context.Context, md *cacheMetadata, opts ...RefOption) (ps parentRefs, rerr error) {
|
||||
defer func() {
|
||||
if rerr != nil {
|
||||
ps.release(context.TODO())
|
||||
}
|
||||
}()
|
||||
if parentID := md.getParent(); parentID != "" {
|
||||
p, err := cm.get(ctx, parentID, nil, append(opts, NoUpdateLastUsed))
|
||||
if err != nil {
|
||||
|
@ -794,7 +806,7 @@ func (cm *cacheManager) createMergeRef(ctx context.Context, parents parentRefs,
|
|||
}
|
||||
|
||||
rec.queueSnapshotID(snapshotID)
|
||||
|
||||
rec.queueCommitted(true)
|
||||
if err := rec.commitMetadata(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -969,6 +981,7 @@ func (cm *cacheManager) createDiffRef(ctx context.Context, parents parentRefs, d
|
|||
}
|
||||
|
||||
rec.queueSnapshotID(snapshotID)
|
||||
rec.queueCommitted(true)
|
||||
if err := rec.commitMetadata(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
2
vendor/github.com/moby/buildkit/cache/opts.go
generated
vendored
2
vendor/github.com/moby/buildkit/cache/opts.go
generated
vendored
|
@ -35,3 +35,5 @@ type NeedsRemoteProviderError []digest.Digest //nolint:errname
|
|||
func (m NeedsRemoteProviderError) Error() string {
|
||||
return fmt.Sprintf("missing descriptor handlers for lazy blobs %+v", []digest.Digest(m))
|
||||
}
|
||||
|
||||
type ProgressKey struct{}
|
||||
|
|
3
vendor/github.com/moby/buildkit/cache/refs.go
generated
vendored
3
vendor/github.com/moby/buildkit/cache/refs.go
generated
vendored
|
@ -3,6 +3,7 @@ package cache
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -1630,7 +1631,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 := os.MkdirTemp(sm.mountPoolRoot, "buildkit")
|
||||
dir, err := ioutil.TempDir(sm.mountPoolRoot, "buildkit")
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
5
vendor/github.com/moby/buildkit/cache/util/fsutil.go
generated
vendored
5
vendor/github.com/moby/buildkit/cache/util/fsutil.go
generated
vendored
|
@ -3,6 +3,7 @@ package util
|
|||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
|
@ -58,7 +59,7 @@ func ReadFile(ctx context.Context, mount snapshot.Mountable, req ReadRequest) ([
|
|||
}
|
||||
|
||||
if req.Range == nil {
|
||||
dt, err = os.ReadFile(fp)
|
||||
dt, err = ioutil.ReadFile(fp)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
|
@ -67,7 +68,7 @@ func ReadFile(ctx context.Context, mount snapshot.Mountable, req ReadRequest) ([
|
|||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
dt, err = io.ReadAll(io.NewSectionReader(f, int64(req.Range.Offset), int64(req.Range.Length)))
|
||||
dt, err = ioutil.ReadAll(io.NewSectionReader(f, int64(req.Range.Offset), int64(req.Range.Length)))
|
||||
f.Close()
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
|
|
4
vendor/github.com/moby/buildkit/client/client.go
generated
vendored
4
vendor/github.com/moby/buildkit/client/client.go
generated
vendored
|
@ -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 := os.ReadFile(opts.CACert)
|
||||
ca, err := ioutil.ReadFile(opts.CACert)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not read ca certificate")
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/client/llb/marshal.go
generated
vendored
3
vendor/github.com/moby/buildkit/client/llb/marshal.go
generated
vendored
|
@ -2,6 +2,7 @@ package llb
|
|||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/moby/buildkit/solver/pb"
|
||||
|
@ -66,7 +67,7 @@ func WriteTo(def *Definition, w io.Writer) error {
|
|||
}
|
||||
|
||||
func ReadFrom(r io.Reader) (*Definition, error) {
|
||||
b, err := io.ReadAll(r)
|
||||
b, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
15
vendor/github.com/moby/buildkit/client/llb/state.go
generated
vendored
15
vendor/github.com/moby/buildkit/client/llb/state.go
generated
vendored
|
@ -230,13 +230,7 @@ func (s State) WithOutput(o Output) State {
|
|||
}
|
||||
|
||||
func (s State) WithImageConfig(c []byte) (State, error) {
|
||||
var img struct {
|
||||
Config struct {
|
||||
Env []string `json:"Env,omitempty"`
|
||||
WorkingDir string `json:"WorkingDir,omitempty"`
|
||||
User string `json:"User,omitempty"`
|
||||
} `json:"config,omitempty"`
|
||||
}
|
||||
var img ocispecs.Image
|
||||
if err := json.Unmarshal(c, &img); err != nil {
|
||||
return State{}, err
|
||||
}
|
||||
|
@ -251,6 +245,13 @@ func (s State) WithImageConfig(c []byte) (State, error) {
|
|||
}
|
||||
}
|
||||
s = s.Dir(img.Config.WorkingDir)
|
||||
if img.Architecture != "" && img.OS != "" {
|
||||
s = s.Platform(ocispecs.Platform{
|
||||
OS: img.OS,
|
||||
Architecture: img.Architecture,
|
||||
Variant: img.Variant,
|
||||
})
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
|
|
6
vendor/github.com/moby/buildkit/client/ociindex/ociindex.go
generated
vendored
6
vendor/github.com/moby/buildkit/client/ociindex/ociindex.go
generated
vendored
|
@ -2,7 +2,7 @@ package ociindex
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"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 := io.ReadAll(f)
|
||||
b, err := ioutil.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 := os.ReadFile(indexJSONPath)
|
||||
b, err := ioutil.ReadFile(indexJSONPath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "could not read %s", indexJSONPath)
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/executor/oci/hosts.go
generated
vendored
3
vendor/github.com/moby/buildkit/executor/oci/hosts.go
generated
vendored
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
|
@ -55,7 +56,7 @@ func makeHostsFile(stateDir string, extraHosts []executor.HostIP, idmap *idtools
|
|||
}
|
||||
|
||||
tmpPath := p + ".tmp"
|
||||
if err := os.WriteFile(tmpPath, b.Bytes(), 0644); err != nil {
|
||||
if err := ioutil.WriteFile(tmpPath, b.Bytes(), 0644); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
|
|
3
vendor/github.com/moby/buildkit/executor/oci/resolvconf.go
generated
vendored
3
vendor/github.com/moby/buildkit/executor/oci/resolvconf.go
generated
vendored
|
@ -2,6 +2,7 @@ package oci
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
|
@ -100,7 +101,7 @@ func GetResolvConf(ctx context.Context, stateDir string, idmap *idtools.Identity
|
|||
}
|
||||
|
||||
tmpPath := p + ".tmp"
|
||||
if err := os.WriteFile(tmpPath, f.Content, 0644); err != nil {
|
||||
if err := ioutil.WriteFile(tmpPath, f.Content, 0644); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
|
3
vendor/github.com/moby/buildkit/exporter/local/export.go
generated
vendored
3
vendor/github.com/moby/buildkit/exporter/local/export.go
generated
vendored
|
@ -2,6 +2,7 @@ package local
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -66,7 +67,7 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source,
|
|||
var err error
|
||||
var idmap *idtools.IdentityMapping
|
||||
if ref == nil {
|
||||
src, err = os.MkdirTemp("", "buildkit")
|
||||
src, err = ioutil.TempDir("", "buildkit")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/exporter/tar/export.go
generated
vendored
3
vendor/github.com/moby/buildkit/exporter/tar/export.go
generated
vendored
|
@ -2,6 +2,7 @@ package local
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -82,7 +83,7 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source,
|
|||
var err error
|
||||
var idmap *idtools.IdentityMapping
|
||||
if ref == nil {
|
||||
src, err = os.MkdirTemp("", "buildkit")
|
||||
src, err = ioutil.TempDir("", "buildkit")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
14
vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go
generated
vendored
14
vendor/github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb/convert.go
generated
vendored
|
@ -158,6 +158,7 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
|
|||
st.BaseName = name
|
||||
|
||||
ds := &dispatchState{
|
||||
stage: st,
|
||||
deps: make(map[*dispatchState]struct{}),
|
||||
ctxPaths: make(map[string]struct{}),
|
||||
stageName: st.Name,
|
||||
|
@ -174,6 +175,13 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
|
|||
ds.state = *s
|
||||
if img != nil {
|
||||
ds.image = *img
|
||||
if img.Architecture != "" && img.OS != "" {
|
||||
ds.platform = &ocispecs.Platform{
|
||||
OS: img.OS,
|
||||
Architecture: img.Architecture,
|
||||
Variant: img.Variant,
|
||||
}
|
||||
}
|
||||
}
|
||||
if bi != nil {
|
||||
ds.buildInfo = *bi
|
||||
|
@ -183,8 +191,6 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
|
|||
}
|
||||
}
|
||||
|
||||
ds.stage = st
|
||||
|
||||
if st.Name == "" {
|
||||
ds.stageName = fmt.Sprintf("stage-%d", i)
|
||||
}
|
||||
|
@ -320,7 +326,7 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
|
|||
if bi != nil {
|
||||
d.buildInfo = *bi
|
||||
}
|
||||
d.state = *st
|
||||
d.state = st.Platform(*platform)
|
||||
d.platform = platform
|
||||
return nil
|
||||
}
|
||||
|
@ -403,7 +409,7 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
|
|||
ctxPaths := map[string]struct{}{}
|
||||
|
||||
for _, d := range allDispatchStates.states {
|
||||
if !isReachable(target, d) {
|
||||
if !isReachable(target, d) || d.noinit {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
3
vendor/github.com/moby/buildkit/session/sshforward/ssh.go
generated
vendored
3
vendor/github.com/moby/buildkit/session/sshforward/ssh.go
generated
vendored
|
@ -1,6 +1,7 @@
|
|||
package sshforward
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -63,7 +64,7 @@ type SocketOpt struct {
|
|||
}
|
||||
|
||||
func MountSSHSocket(ctx context.Context, c session.Caller, opt SocketOpt) (sockPath string, closer func() error, err error) {
|
||||
dir, err := os.MkdirTemp("", ".buildkit-ssh-sock")
|
||||
dir, err := ioutil.TempDir("", ".buildkit-ssh-sock")
|
||||
if err != nil {
|
||||
return "", nil, errors.WithStack(err)
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/snapshot/localmounter_unix.go
generated
vendored
3
vendor/github.com/moby/buildkit/snapshot/localmounter_unix.go
generated
vendored
|
@ -4,6 +4,7 @@
|
|||
package snapshot
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
|
@ -37,7 +38,7 @@ func (lm *localMounter) Mount() (string, error) {
|
|||
}
|
||||
}
|
||||
|
||||
dir, err := os.MkdirTemp("", "buildkit-mount")
|
||||
dir, err := ioutil.TempDir("", "buildkit-mount")
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to create temp dir")
|
||||
}
|
||||
|
|
15
vendor/github.com/moby/buildkit/solver/cacheopts.go
generated
vendored
15
vendor/github.com/moby/buildkit/solver/cacheopts.go
generated
vendored
|
@ -4,15 +4,12 @@ import (
|
|||
"context"
|
||||
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
"github.com/moby/buildkit/util/progress"
|
||||
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
)
|
||||
|
||||
type CacheOpts map[interface{}]interface{}
|
||||
|
||||
type progressKey struct{}
|
||||
|
||||
type cacheOptGetterKey struct{}
|
||||
|
||||
func CacheOptGetterOf(ctx context.Context) func(includeAncestors bool, keys ...interface{}) map[interface{}]interface{} {
|
||||
|
@ -94,15 +91,3 @@ func walkAncestors(ctx context.Context, start *state, f func(*state) bool) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ProgressControllerFromContext(ctx context.Context) progress.Controller {
|
||||
var pg progress.Controller
|
||||
if optGetter := CacheOptGetterOf(ctx); optGetter != nil {
|
||||
if kv := optGetter(false, progressKey{}); kv != nil {
|
||||
if v, ok := kv[progressKey{}].(progress.Controller); ok {
|
||||
pg = v
|
||||
}
|
||||
}
|
||||
}
|
||||
return pg
|
||||
}
|
||||
|
|
10
vendor/github.com/moby/buildkit/solver/jobs.go
generated
vendored
10
vendor/github.com/moby/buildkit/solver/jobs.go
generated
vendored
|
@ -13,7 +13,6 @@ import (
|
|||
"github.com/moby/buildkit/solver/errdefs"
|
||||
"github.com/moby/buildkit/util/flightcontrol"
|
||||
"github.com/moby/buildkit/util/progress"
|
||||
"github.com/moby/buildkit/util/progress/controller"
|
||||
"github.com/moby/buildkit/util/tracing"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -782,15 +781,6 @@ func (s *sharedOp) CacheMap(ctx context.Context, index int) (resp *cacheMapResp,
|
|||
}
|
||||
if complete {
|
||||
if err == nil {
|
||||
if res.Opts == nil {
|
||||
res.Opts = CacheOpts(make(map[interface{}]interface{}))
|
||||
}
|
||||
res.Opts[progressKey{}] = &controller.Controller{
|
||||
WriterFactory: progress.FromContext(ctx),
|
||||
Digest: s.st.vtx.Digest(),
|
||||
Name: s.st.vtx.Name(),
|
||||
ProgressGroup: s.st.vtx.Options().ProgressGroup,
|
||||
}
|
||||
s.cacheRes = append(s.cacheRes, res)
|
||||
s.cacheDone = done
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/solver/llbsolver/file/backend.go
generated
vendored
3
vendor/github.com/moby/buildkit/solver/llbsolver/file/backend.go
generated
vendored
|
@ -2,6 +2,7 @@ package file
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -109,7 +110,7 @@ func mkfile(ctx context.Context, d string, action pb.FileActionMkFile, user *cop
|
|||
return err
|
||||
}
|
||||
|
||||
if err := os.WriteFile(p, action.Data, os.FileMode(action.Mode)&0777); err != nil {
|
||||
if err := ioutil.WriteFile(p, action.Data, os.FileMode(action.Mode)&0777); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
5
vendor/github.com/moby/buildkit/solver/llbsolver/mounts/mount.go
generated
vendored
5
vendor/github.com/moby/buildkit/solver/llbsolver/mounts/mount.go
generated
vendored
|
@ -3,6 +3,7 @@ package mounts
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
@ -281,7 +282,7 @@ type secretMountInstance struct {
|
|||
}
|
||||
|
||||
func (sm *secretMountInstance) Mount() ([]mount.Mount, func() error, error) {
|
||||
dir, err := os.MkdirTemp("", "buildkit-secrets")
|
||||
dir, err := ioutil.TempDir("", "buildkit-secrets")
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "failed to create temp dir")
|
||||
}
|
||||
|
@ -319,7 +320,7 @@ func (sm *secretMountInstance) Mount() ([]mount.Mount, func() error, error) {
|
|||
|
||||
randID := identity.NewID()
|
||||
fp := filepath.Join(dir, randID)
|
||||
if err := os.WriteFile(fp, sm.sm.data, 0600); err != nil {
|
||||
if err := ioutil.WriteFile(fp, sm.sm.data, 0600); err != nil {
|
||||
cleanup()
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
14
vendor/github.com/moby/buildkit/solver/llbsolver/ops/diff.go
generated
vendored
14
vendor/github.com/moby/buildkit/solver/llbsolver/ops/diff.go
generated
vendored
|
@ -4,6 +4,8 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/moby/buildkit/util/progress"
|
||||
"github.com/moby/buildkit/util/progress/controller"
|
||||
"github.com/moby/buildkit/worker"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
|
@ -21,6 +23,7 @@ type diffOp struct {
|
|||
op *pb.DiffOp
|
||||
worker worker.Worker
|
||||
vtx solver.Vertex
|
||||
pg progress.Controller
|
||||
}
|
||||
|
||||
func NewDiffOp(v solver.Vertex, op *pb.Op_Diff, w worker.Worker) (solver.Op, error) {
|
||||
|
@ -61,8 +64,17 @@ func (d *diffOp) CacheMap(ctx context.Context, group session.Group, index int) (
|
|||
ComputeDigestFunc solver.ResultBasedCacheFunc
|
||||
PreprocessFunc solver.PreprocessFunc
|
||||
}, depCount),
|
||||
Opts: solver.CacheOpts(make(map[interface{}]interface{})),
|
||||
}
|
||||
|
||||
d.pg = &controller.Controller{
|
||||
WriterFactory: progress.FromContext(ctx),
|
||||
Digest: d.vtx.Digest(),
|
||||
Name: d.vtx.Name(),
|
||||
ProgressGroup: d.vtx.Options().ProgressGroup,
|
||||
}
|
||||
cm.Opts[cache.ProgressKey{}] = d.pg
|
||||
|
||||
return cm, true, nil
|
||||
}
|
||||
|
||||
|
@ -109,7 +121,7 @@ func (d *diffOp) Exec(ctx context.Context, g session.Group, inputs []solver.Resu
|
|||
return []solver.Result{worker.NewWorkerRefResult(nil, d.worker)}, nil
|
||||
}
|
||||
|
||||
diffRef, err := d.worker.CacheManager().Diff(ctx, lowerRef, upperRef, solver.ProgressControllerFromContext(ctx),
|
||||
diffRef, err := d.worker.CacheManager().Diff(ctx, lowerRef, upperRef, d.pg,
|
||||
cache.WithDescription(d.vtx.Name()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
12
vendor/github.com/moby/buildkit/solver/llbsolver/ops/exec.go
generated
vendored
12
vendor/github.com/moby/buildkit/solver/llbsolver/ops/exec.go
generated
vendored
|
@ -21,6 +21,8 @@ import (
|
|||
"github.com/moby/buildkit/solver/llbsolver/errdefs"
|
||||
"github.com/moby/buildkit/solver/llbsolver/mounts"
|
||||
"github.com/moby/buildkit/solver/pb"
|
||||
"github.com/moby/buildkit/util/progress"
|
||||
"github.com/moby/buildkit/util/progress/controller"
|
||||
"github.com/moby/buildkit/util/progress/logs"
|
||||
utilsystem "github.com/moby/buildkit/util/system"
|
||||
"github.com/moby/buildkit/worker"
|
||||
|
@ -43,6 +45,7 @@ type execOp struct {
|
|||
platform *pb.Platform
|
||||
numInputs int
|
||||
parallelism *semaphore.Weighted
|
||||
vtx solver.Vertex
|
||||
}
|
||||
|
||||
func NewExecOp(v solver.Vertex, op *pb.Op_Exec, platform *pb.Platform, cm cache.Manager, parallelism *semaphore.Weighted, sm *session.Manager, exec executor.Executor, w worker.Worker) (solver.Op, error) {
|
||||
|
@ -60,6 +63,7 @@ func NewExecOp(v solver.Vertex, op *pb.Op_Exec, platform *pb.Platform, cm cache.
|
|||
w: w,
|
||||
platform: platform,
|
||||
parallelism: parallelism,
|
||||
vtx: v,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -141,6 +145,14 @@ func (e *execOp) CacheMap(ctx context.Context, g session.Group, index int) (*sol
|
|||
ComputeDigestFunc solver.ResultBasedCacheFunc
|
||||
PreprocessFunc solver.PreprocessFunc
|
||||
}, e.numInputs),
|
||||
Opts: solver.CacheOpts(map[interface{}]interface{}{
|
||||
cache.ProgressKey{}: &controller.Controller{
|
||||
WriterFactory: progress.FromContext(ctx),
|
||||
Digest: e.vtx.Digest(),
|
||||
Name: e.vtx.Name(),
|
||||
ProgressGroup: e.vtx.Options().ProgressGroup,
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
||||
deps, err := e.getMountDeps()
|
||||
|
|
3
vendor/github.com/moby/buildkit/solver/llbsolver/ops/exec_binfmt.go
generated
vendored
3
vendor/github.com/moby/buildkit/solver/llbsolver/ops/exec_binfmt.go
generated
vendored
|
@ -2,6 +2,7 @@ package ops
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
@ -46,7 +47,7 @@ type staticEmulatorMount struct {
|
|||
}
|
||||
|
||||
func (m *staticEmulatorMount) Mount() ([]mount.Mount, func() error, error) {
|
||||
tmpdir, err := os.MkdirTemp("", "buildkit-qemu-emulator")
|
||||
tmpdir, err := ioutil.TempDir("", "buildkit-qemu-emulator")
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
12
vendor/github.com/moby/buildkit/solver/llbsolver/ops/file.go
generated
vendored
12
vendor/github.com/moby/buildkit/solver/llbsolver/ops/file.go
generated
vendored
|
@ -19,6 +19,8 @@ import (
|
|||
"github.com/moby/buildkit/solver/llbsolver/ops/fileoptypes"
|
||||
"github.com/moby/buildkit/solver/pb"
|
||||
"github.com/moby/buildkit/util/flightcontrol"
|
||||
"github.com/moby/buildkit/util/progress"
|
||||
"github.com/moby/buildkit/util/progress/controller"
|
||||
"github.com/moby/buildkit/worker"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -35,6 +37,7 @@ type fileOp struct {
|
|||
solver *FileOpSolver
|
||||
numInputs int
|
||||
parallelism *semaphore.Weighted
|
||||
vtx solver.Vertex
|
||||
}
|
||||
|
||||
func NewFileOp(v solver.Vertex, op *pb.Op_File, cm cache.Manager, parallelism *semaphore.Weighted, w worker.Worker) (solver.Op, error) {
|
||||
|
@ -48,6 +51,7 @@ func NewFileOp(v solver.Vertex, op *pb.Op_File, cm cache.Manager, parallelism *s
|
|||
w: w,
|
||||
solver: NewFileOpSolver(w, &file.Backend{}, file.NewRefManager(cm)),
|
||||
parallelism: parallelism,
|
||||
vtx: v,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -134,6 +138,14 @@ func (f *fileOp) CacheMap(ctx context.Context, g session.Group, index int) (*sol
|
|||
ComputeDigestFunc solver.ResultBasedCacheFunc
|
||||
PreprocessFunc solver.PreprocessFunc
|
||||
}, f.numInputs),
|
||||
Opts: solver.CacheOpts(map[interface{}]interface{}{
|
||||
cache.ProgressKey{}: &controller.Controller{
|
||||
WriterFactory: progress.FromContext(ctx),
|
||||
Digest: f.vtx.Digest(),
|
||||
Name: f.vtx.Name(),
|
||||
ProgressGroup: f.vtx.Options().ProgressGroup,
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
||||
for idx, m := range selectors {
|
||||
|
|
14
vendor/github.com/moby/buildkit/solver/llbsolver/ops/merge.go
generated
vendored
14
vendor/github.com/moby/buildkit/solver/llbsolver/ops/merge.go
generated
vendored
|
@ -4,6 +4,8 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/moby/buildkit/util/progress"
|
||||
"github.com/moby/buildkit/util/progress/controller"
|
||||
"github.com/moby/buildkit/worker"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
|
@ -21,6 +23,7 @@ type mergeOp struct {
|
|||
op *pb.MergeOp
|
||||
worker worker.Worker
|
||||
vtx solver.Vertex
|
||||
pg progress.Controller
|
||||
}
|
||||
|
||||
func NewMergeOp(v solver.Vertex, op *pb.Op_Merge, w worker.Worker) (solver.Op, error) {
|
||||
|
@ -53,8 +56,17 @@ func (m *mergeOp) CacheMap(ctx context.Context, group session.Group, index int)
|
|||
ComputeDigestFunc solver.ResultBasedCacheFunc
|
||||
PreprocessFunc solver.PreprocessFunc
|
||||
}, len(m.op.Inputs)),
|
||||
Opts: solver.CacheOpts(make(map[interface{}]interface{})),
|
||||
}
|
||||
|
||||
m.pg = &controller.Controller{
|
||||
WriterFactory: progress.FromContext(ctx),
|
||||
Digest: m.vtx.Digest(),
|
||||
Name: m.vtx.Name(),
|
||||
ProgressGroup: m.vtx.Options().ProgressGroup,
|
||||
}
|
||||
cm.Opts[cache.ProgressKey{}] = m.pg
|
||||
|
||||
return cm, true, nil
|
||||
}
|
||||
|
||||
|
@ -81,7 +93,7 @@ func (m *mergeOp) Exec(ctx context.Context, g session.Group, inputs []solver.Res
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
mergedRef, err := m.worker.CacheManager().Merge(ctx, refs, solver.ProgressControllerFromContext(ctx),
|
||||
mergedRef, err := m.worker.CacheManager().Merge(ctx, refs, m.pg,
|
||||
cache.WithDescription(m.vtx.Name()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
2
vendor/github.com/moby/buildkit/solver/pb/ops.pb.go
generated
vendored
2
vendor/github.com/moby/buildkit/solver/pb/ops.pb.go
generated
vendored
|
@ -1038,7 +1038,7 @@ func (m *SecretOpt) GetOptional() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// SSHOpt defines options describing ssh mounts
|
||||
// SSHOpt defines options describing secret mounts
|
||||
type SSHOpt struct {
|
||||
// ID of exposed ssh rule. Used for quering the value.
|
||||
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||
|
|
2
vendor/github.com/moby/buildkit/solver/pb/ops.proto
generated
vendored
2
vendor/github.com/moby/buildkit/solver/pb/ops.proto
generated
vendored
|
@ -157,7 +157,7 @@ message SecretOpt {
|
|||
bool optional = 5;
|
||||
}
|
||||
|
||||
// SSHOpt defines options describing ssh mounts
|
||||
// SSHOpt defines options describing secret mounts
|
||||
message SSHOpt {
|
||||
// ID of exposed ssh rule. Used for quering the value.
|
||||
string ID = 1;
|
||||
|
|
5
vendor/github.com/moby/buildkit/source/git/gitsource.go
generated
vendored
5
vendor/github.com/moby/buildkit/source/git/gitsource.go
generated
vendored
|
@ -6,6 +6,7 @@ import (
|
|||
"encoding/base64"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
@ -272,7 +273,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 := os.CreateTemp("", "")
|
||||
knownHosts, err := ioutil.TempFile("", "")
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
@ -542,7 +543,7 @@ func (gs *gitSourceHandler) Snapshot(ctx context.Context, g session.Group) (out
|
|||
} else {
|
||||
cd := checkoutDir
|
||||
if subdir != "." {
|
||||
cd, err = os.MkdirTemp(cd, "checkout")
|
||||
cd, err = ioutil.TempDir(cd, "checkout")
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to create temporary checkout dir")
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/util/archutil/check_unix.go
generated
vendored
3
vendor/github.com/moby/buildkit/util/archutil/check_unix.go
generated
vendored
|
@ -7,6 +7,7 @@ import (
|
|||
"bytes"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
@ -22,7 +23,7 @@ func withChroot(cmd *exec.Cmd, dir string) {
|
|||
}
|
||||
|
||||
func check(arch, bin string) (string, error) {
|
||||
tmpdir, err := os.MkdirTemp("", "qemu-check")
|
||||
tmpdir, err := ioutil.TempDir("", "qemu-check")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
48
vendor/github.com/moby/buildkit/util/buildinfo/buildinfo.go
generated
vendored
48
vendor/github.com/moby/buildkit/util/buildinfo/buildinfo.go
generated
vendored
|
@ -42,7 +42,7 @@ func Encode(ctx context.Context, metadata map[string][]byte, key string, llbSour
|
|||
} else {
|
||||
return nil, err
|
||||
}
|
||||
bi.Sources = dedupSources(bi, allDepsSources(bi, nil))
|
||||
bi.Sources = dedupSources(bi.Sources, allDepsSources(bi.Deps, nil))
|
||||
return json.Marshal(bi)
|
||||
}
|
||||
|
||||
|
@ -205,24 +205,25 @@ func decodeDeps(key string, attrs map[string]*string) (map[string]binfotypes.Bui
|
|||
}
|
||||
|
||||
// dedupSources deduplicates regular sources from dependencies ones.
|
||||
func dedupSources(bi binfotypes.BuildInfo, depsSources []binfotypes.Source) (srcs []binfotypes.Source) {
|
||||
func dedupSources(sources []binfotypes.Source, depsSources []binfotypes.Source) (srcs []binfotypes.Source) {
|
||||
// dedup sources from deps
|
||||
for i, src := range bi.Sources {
|
||||
for _, dsrc := range depsSources {
|
||||
if src == dsrc {
|
||||
bi.Sources = append(bi.Sources[:i], bi.Sources[i+1:]...)
|
||||
} else if src.Type == binfotypes.SourceTypeDockerImage {
|
||||
msrc := make(map[binfotypes.Source]struct{})
|
||||
sourcesloop:
|
||||
for _, src := range sources {
|
||||
for _, srcd := range depsSources {
|
||||
if src == srcd {
|
||||
continue sourcesloop
|
||||
}
|
||||
if src.Type == binfotypes.SourceTypeDockerImage && srcd.Type == binfotypes.SourceTypeDockerImage {
|
||||
_, dgst := ctnref.SplitObject(src.Ref)
|
||||
if dgst != "" && src.Pin == dsrc.Pin {
|
||||
bi.Sources = append(bi.Sources[:i], bi.Sources[i+1:]...)
|
||||
if dgst != "" && src.Pin == srcd.Pin {
|
||||
continue sourcesloop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// dedup regular sources
|
||||
msrc := make(map[binfotypes.Source]struct{})
|
||||
for _, src := range bi.Sources {
|
||||
msrc[src] = struct{}{}
|
||||
if _, ok := msrc[src]; !ok {
|
||||
msrc[src] = struct{}{}
|
||||
}
|
||||
}
|
||||
for src := range msrc {
|
||||
srcs = append(srcs, src)
|
||||
|
@ -234,21 +235,21 @@ func dedupSources(bi binfotypes.BuildInfo, depsSources []binfotypes.Source) (src
|
|||
}
|
||||
|
||||
// allDepsSources gathers dependencies sources.
|
||||
func allDepsSources(bi binfotypes.BuildInfo, visited map[binfotypes.Source]struct{}) (res []binfotypes.Source) {
|
||||
func allDepsSources(deps map[string]binfotypes.BuildInfo, visited map[binfotypes.Source]struct{}) (res []binfotypes.Source) {
|
||||
if visited == nil {
|
||||
visited = make(map[binfotypes.Source]struct{})
|
||||
}
|
||||
if len(bi.Deps) == 0 {
|
||||
if len(deps) == 0 {
|
||||
return res
|
||||
}
|
||||
for _, dbi := range bi.Deps {
|
||||
for _, dbi := range deps {
|
||||
for _, dsrc := range dbi.Sources {
|
||||
if _, ok := visited[dsrc]; ok {
|
||||
continue
|
||||
}
|
||||
visited[dsrc] = struct{}{}
|
||||
}
|
||||
res = allDepsSources(dbi, visited)
|
||||
res = allDepsSources(dbi.Deps, visited)
|
||||
}
|
||||
for src := range visited {
|
||||
res = append(res, src)
|
||||
|
@ -262,17 +263,24 @@ type FormatOpts struct {
|
|||
}
|
||||
|
||||
// Format formats build info.
|
||||
func Format(dt []byte, format FormatOpts) (_ []byte, err error) {
|
||||
func Format(dt []byte, opts FormatOpts) (_ []byte, err error) {
|
||||
if len(dt) == 0 {
|
||||
return dt, nil
|
||||
}
|
||||
|
||||
var bi binfotypes.BuildInfo
|
||||
if err := json.Unmarshal(dt, &bi); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal buildinfo for formatting")
|
||||
}
|
||||
if format.RemoveAttrs {
|
||||
|
||||
if opts.RemoveAttrs {
|
||||
bi.Attrs = nil
|
||||
if len(bi.Deps) > 0 {
|
||||
bi.Sources = dedupSources(append(bi.Sources, allDepsSources(bi.Deps, nil)...), nil)
|
||||
bi.Deps = nil
|
||||
}
|
||||
}
|
||||
|
||||
if dt, err = json.Marshal(bi); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
4
vendor/github.com/moby/buildkit/util/contentutil/buffer.go
generated
vendored
4
vendor/github.com/moby/buildkit/util/contentutil/buffer.go
generated
vendored
|
@ -3,7 +3,7 @@ package contentutil
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"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: io.NopCloser(r), size: int64(r.Len())}, nil
|
||||
return &readerAt{Reader: r, Closer: ioutil.NopCloser(r), size: int64(r.Len())}, nil
|
||||
}
|
||||
|
||||
func (b *buffer) getBytesReader(ctx context.Context, dgst digest.Digest) (*bytes.Reader, error) {
|
||||
|
|
4
vendor/github.com/moby/buildkit/util/imageutil/schema1.go
generated
vendored
4
vendor/github.com/moby/buildkit/util/imageutil/schema1.go
generated
vendored
|
@ -3,7 +3,7 @@ package imageutil
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -19,7 +19,7 @@ func readSchema1Config(ctx context.Context, ref string, desc ocispecs.Descriptor
|
|||
return "", nil, err
|
||||
}
|
||||
defer rc.Close()
|
||||
dt, err := io.ReadAll(rc)
|
||||
dt, err := ioutil.ReadAll(rc)
|
||||
if err != nil {
|
||||
return "", nil, errors.Wrap(err, "failed to fetch schema1 manifest")
|
||||
}
|
||||
|
|
3
vendor/github.com/moby/buildkit/util/overlay/overlay_linux.go
generated
vendored
3
vendor/github.com/moby/buildkit/util/overlay/overlay_linux.go
generated
vendored
|
@ -8,6 +8,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -113,7 +114,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 := os.MkdirTemp("", "buildkit") // empty directory used for the lower of diff view
|
||||
emptyLower, err := ioutil.TempDir("", "buildkit") // empty directory used for the lower of diff view
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to create temp dir")
|
||||
}
|
||||
|
|
5
vendor/github.com/moby/buildkit/util/resolver/resolver.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/resolver/resolver.go
generated
vendored
|
@ -3,6 +3,7 @@ package resolver
|
|||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -66,7 +67,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 := os.ReadDir(d)
|
||||
fs, err := ioutil.ReadDir(d)
|
||||
if err != nil && !errors.Is(err, os.ErrNotExist) && !errors.Is(err, os.ErrPermission) {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
@ -97,7 +98,7 @@ func loadTLSConfig(c config.RegistryConfig) (*tls.Config, error) {
|
|||
}
|
||||
|
||||
for _, p := range c.RootCAs {
|
||||
dt, err := os.ReadFile(p)
|
||||
dt, err := ioutil.ReadFile(p)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to read %s", p)
|
||||
}
|
||||
|
|
5
vendor/github.com/moby/buildkit/util/winlayers/applier.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/winlayers/applier.go
generated
vendored
|
@ -4,6 +4,7 @@ import (
|
|||
"archive/tar"
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
|
@ -86,7 +87,7 @@ func (s *winApplier) Apply(ctx context.Context, desc ocispecs.Descriptor, mounts
|
|||
}
|
||||
|
||||
// Read any trailing data
|
||||
if _, err := io.Copy(io.Discard, rc); err != nil {
|
||||
if _, err := io.Copy(ioutil.Discard, rc); err != nil {
|
||||
discard(err)
|
||||
return err
|
||||
}
|
||||
|
@ -143,7 +144,7 @@ func filter(in io.Reader, f func(*tar.Header) bool) (io.Reader, func(error)) {
|
|||
}
|
||||
} else {
|
||||
if h.Size > 0 {
|
||||
if _, err := io.Copy(io.Discard, tarReader); err != nil {
|
||||
if _, err := io.Copy(ioutil.Discard, tarReader); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
12
vendor/github.com/moby/buildkit/version/version.go
generated
vendored
12
vendor/github.com/moby/buildkit/version/version.go
generated
vendored
|
@ -45,18 +45,18 @@ var (
|
|||
)
|
||||
|
||||
func UserAgent() string {
|
||||
version := defaultVersion
|
||||
uaVersion := defaultVersion
|
||||
|
||||
reOnce.Do(func() {
|
||||
reRelease = regexp.MustCompile(`^(v[0-9]+\.[0-9]+)\.[0-9]+$`)
|
||||
reDev = regexp.MustCompile(`^(v[0-9]+\.[0-9]+)\.[0-9]+`)
|
||||
})
|
||||
|
||||
if matches := reRelease.FindAllStringSubmatch(version, 1); len(matches) > 0 {
|
||||
version = matches[0][1]
|
||||
} else if matches := reDev.FindAllStringSubmatch(version, 1); len(matches) > 0 {
|
||||
version = matches[0][1] + "-dev"
|
||||
if matches := reRelease.FindAllStringSubmatch(Version, 1); len(matches) > 0 {
|
||||
uaVersion = matches[0][1]
|
||||
} else if matches := reDev.FindAllStringSubmatch(Version, 1); len(matches) > 0 {
|
||||
uaVersion = matches[0][1] + "-dev"
|
||||
}
|
||||
|
||||
return "buildkit/" + version
|
||||
return "buildkit/" + uaVersion
|
||||
}
|
||||
|
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
@ -467,7 +467,7 @@ github.com/mistifyio/go-zfs
|
|||
# github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
## explicit; go 1.14
|
||||
github.com/mitchellh/hashstructure/v2
|
||||
# github.com/moby/buildkit v0.10.1-0.20220327110152-d7744bcb3532
|
||||
# github.com/moby/buildkit v0.10.2
|
||||
## explicit; go 1.17
|
||||
github.com/moby/buildkit/api/services/control
|
||||
github.com/moby/buildkit/api/types
|
||||
|
|
Loading…
Add table
Reference in a new issue