mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 8effd45b
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
7
vendor/github.com/moby/buildkit/util/apicaps/caps.go
generated
vendored
7
vendor/github.com/moby/buildkit/util/apicaps/caps.go
generated
vendored
@ -122,6 +122,13 @@ func (s *CapSet) Supports(id CapID) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Contains checks if cap set contains cap. Note that unlike Supports() this
|
||||
// function only checks capability existence in remote set, not if cap has been initialized.
|
||||
func (s *CapSet) Contains(id CapID) bool {
|
||||
_, ok := s.set[string(id)]
|
||||
return ok
|
||||
}
|
||||
|
||||
// CapError is an error for unsupported capability
|
||||
type CapError struct {
|
||||
ID CapID
|
||||
|
5
vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go
generated
vendored
5
vendor/github.com/moby/buildkit/util/apicaps/pb/caps.pb.go
generated
vendored
@ -465,10 +465,7 @@ func (m *APICap) Unmarshal(dAtA []byte) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthCaps
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthCaps
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
|
58
vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go
generated
vendored
58
vendor/github.com/moby/buildkit/util/flightcontrol/flightcontrol.go
generated
vendored
@ -130,7 +130,11 @@ func (c *call) wait(ctx context.Context) (v interface{}, err error) {
|
||||
c.mu.Lock()
|
||||
// detect case where caller has just returned, let it clean up before
|
||||
select {
|
||||
case <-c.ready: // could return if no error
|
||||
case <-c.ready:
|
||||
c.mu.Unlock()
|
||||
<-c.cleaned
|
||||
return nil, errRetry
|
||||
case <-c.ctx.done: // could return if no error
|
||||
c.mu.Unlock()
|
||||
<-c.cleaned
|
||||
return nil, errRetry
|
||||
@ -141,6 +145,10 @@ func (c *call) wait(ctx context.Context) (v interface{}, err error) {
|
||||
if ok {
|
||||
c.progressState.add(pw)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
c.ctxs = append(c.ctxs, ctx)
|
||||
|
||||
c.mu.Unlock()
|
||||
@ -149,18 +157,16 @@ func (c *call) wait(ctx context.Context) (v interface{}, err error) {
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
select {
|
||||
case <-c.ctx.Done():
|
||||
if c.ctx.checkDone() {
|
||||
// if this cancelled the last context, then wait for function to shut down
|
||||
// and don't accept any more callers
|
||||
<-c.ready
|
||||
return c.result, c.err
|
||||
default:
|
||||
if ok {
|
||||
c.progressState.close(pw)
|
||||
}
|
||||
return nil, ctx.Err()
|
||||
}
|
||||
if ok {
|
||||
c.progressState.close(pw)
|
||||
}
|
||||
return nil, ctx.Err()
|
||||
case <-c.ready:
|
||||
return c.result, c.err // shared not implemented yet
|
||||
}
|
||||
@ -183,9 +189,6 @@ func (c *call) Deadline() (deadline time.Time, ok bool) {
|
||||
}
|
||||
|
||||
func (c *call) Done() <-chan struct{} {
|
||||
c.mu.Lock()
|
||||
c.ctx.signal()
|
||||
c.mu.Unlock()
|
||||
return c.ctx.done
|
||||
}
|
||||
|
||||
@ -238,23 +241,28 @@ func newContext(c *call) *sharedContext {
|
||||
return &sharedContext{call: c, done: make(chan struct{})}
|
||||
}
|
||||
|
||||
// call with lock
|
||||
func (c *sharedContext) signal() {
|
||||
func (sc *sharedContext) checkDone() bool {
|
||||
sc.mu.Lock()
|
||||
select {
|
||||
case <-c.done:
|
||||
case <-sc.done:
|
||||
sc.mu.Unlock()
|
||||
return true
|
||||
default:
|
||||
var err error
|
||||
for _, ctx := range c.ctxs {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
err = ctx.Err()
|
||||
default:
|
||||
return
|
||||
}
|
||||
}
|
||||
c.err = err
|
||||
close(c.done)
|
||||
}
|
||||
var err error
|
||||
for _, ctx := range sc.ctxs {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
err = ctx.Err()
|
||||
default:
|
||||
sc.mu.Unlock()
|
||||
return false
|
||||
}
|
||||
}
|
||||
sc.err = err
|
||||
close(sc.done)
|
||||
sc.mu.Unlock()
|
||||
return true
|
||||
}
|
||||
|
||||
type rawProgressWriter interface {
|
||||
|
11
vendor/github.com/moby/buildkit/util/sshutil/transport_validation.go
generated
vendored
Normal file
11
vendor/github.com/moby/buildkit/util/sshutil/transport_validation.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
package sshutil
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var gitSSHRegex = regexp.MustCompile("^[a-zA-Z0-9-_]+@[a-zA-Z0-9-.]+:.*$")
|
||||
|
||||
func IsImplicitSSHTransport(s string) bool {
|
||||
return gitSSHRegex.MatchString(s)
|
||||
}
|
Reference in New Issue
Block a user