vendor: update git url handling with changes to buildkit

The git ssh url parsing API changed a bit and broke how buildx utilized
the API. This updates the affected method with the new method of
identifying an SSH url.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
Jonathan A. Sternberg
2023-08-25 13:42:18 -05:00
parent da6662975f
commit fc7f066caa
28 changed files with 525 additions and 435 deletions

View File

@@ -277,7 +277,7 @@ func (sp *fsSyncTarget) DiffCopy(stream FileSend_DiffCopyServer) (err error) {
}
defer func() {
err1 := wc.Close()
if err != nil {
if err == nil {
err = err1
}
}()
@@ -351,13 +351,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 +373,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
}
}
}

View File

@@ -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;