mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 3e38a2d
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
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 := ioutil.ReadFile(opts.CACert)
|
||||
ca, err := os.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,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
|
||||
}
|
||||
|
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/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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user