mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@cbfd4023383d
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
23
vendor/github.com/moby/buildkit/session/filesync/filesync.go
generated
vendored
23
vendor/github.com/moby/buildkit/session/filesync/filesync.go
generated
vendored
@ -11,6 +11,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/moby/buildkit/session"
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tonistiigi/fsutil"
|
||||
fstypes "github.com/tonistiigi/fsutil/types"
|
||||
@ -277,7 +278,7 @@ func (sp *fsSyncTarget) DiffCopy(stream FileSend_DiffCopyServer) (err error) {
|
||||
}
|
||||
defer func() {
|
||||
err1 := wc.Close()
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
err = err1
|
||||
}
|
||||
}()
|
||||
@ -308,9 +309,16 @@ func CopyFileWriter(ctx context.Context, md map[string]string, c session.Caller)
|
||||
|
||||
client := NewFileSendClient(c.Conn())
|
||||
|
||||
opts := make(map[string][]string, len(md))
|
||||
opts, ok := metadata.FromOutgoingContext(ctx)
|
||||
if !ok {
|
||||
opts = make(map[string][]string, len(md))
|
||||
}
|
||||
for k, v := range md {
|
||||
opts[keyExporterMetaPrefix+k] = []string{v}
|
||||
k := keyExporterMetaPrefix + k
|
||||
if existingVal, ok := opts[k]; ok {
|
||||
bklog.G(ctx).Warnf("overwriting grpc metadata key %q from value %+v to %+v", k, existingVal, v)
|
||||
}
|
||||
opts[k] = []string{v}
|
||||
}
|
||||
|
||||
ctx = metadata.NewOutgoingContext(ctx, opts)
|
||||
@ -351,13 +359,13 @@ func decodeOpts(opts map[string][]string) map[string][]string {
|
||||
md := make(map[string][]string, len(opts))
|
||||
for k, v := range opts {
|
||||
out := make([]string, len(v))
|
||||
var isDecoded bool
|
||||
var isEncoded bool
|
||||
if v, ok := opts[k+"-encoded"]; ok && len(v) > 0 {
|
||||
if b, _ := strconv.ParseBool(v[0]); b {
|
||||
isDecoded = true
|
||||
isEncoded = true
|
||||
}
|
||||
}
|
||||
if isDecoded {
|
||||
if isEncoded {
|
||||
for i, s := range v {
|
||||
out[i], _ = url.QueryUnescape(s)
|
||||
}
|
||||
@ -373,13 +381,14 @@ func decodeOpts(opts map[string][]string) map[string][]string {
|
||||
// is backwards compatible and avoids encoding ASCII characters.
|
||||
func encodeStringForHeader(inputs []string) ([]string, bool) {
|
||||
var encode bool
|
||||
loop:
|
||||
for _, input := range inputs {
|
||||
for _, runeVal := range input {
|
||||
// Only encode non-ASCII characters, and characters that have special
|
||||
// meaning during decoding.
|
||||
if runeVal > unicode.MaxASCII {
|
||||
encode = true
|
||||
break
|
||||
break loop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
7
vendor/github.com/moby/buildkit/session/filesync/filesync.proto
generated
vendored
7
vendor/github.com/moby/buildkit/session/filesync/filesync.proto
generated
vendored
@ -7,15 +7,14 @@ option go_package = "filesync";
|
||||
import "github.com/tonistiigi/fsutil/types/wire.proto";
|
||||
|
||||
service FileSync{
|
||||
rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
||||
rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
||||
rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
||||
rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
|
||||
}
|
||||
|
||||
service FileSend{
|
||||
rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage);
|
||||
rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage);
|
||||
}
|
||||
|
||||
|
||||
// BytesMessage contains a chunk of byte data
|
||||
message BytesMessage{
|
||||
bytes data = 1;
|
||||
|
Reference in New Issue
Block a user