parent
e07f3883e3
commit
35fcb28a00
|
@ -827,18 +827,17 @@ func (m *Vertex) GetError() string {
|
|||
}
|
||||
|
||||
type VertexStatus struct {
|
||||
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||
Vertex github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=vertex,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"vertex"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Current int64 `protobuf:"varint,4,opt,name=current,proto3" json:"current,omitempty"`
|
||||
Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
|
||||
// TODO: add started, completed
|
||||
Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
|
||||
Started *time.Time `protobuf:"bytes,7,opt,name=started,proto3,stdtime" json:"started,omitempty"`
|
||||
Completed *time.Time `protobuf:"bytes,8,opt,name=completed,proto3,stdtime" json:"completed,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||
Vertex github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=vertex,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"vertex"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Current int64 `protobuf:"varint,4,opt,name=current,proto3" json:"current,omitempty"`
|
||||
Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
|
||||
Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
|
||||
Started *time.Time `protobuf:"bytes,7,opt,name=started,proto3,stdtime" json:"started,omitempty"`
|
||||
Completed *time.Time `protobuf:"bytes,8,opt,name=completed,proto3,stdtime" json:"completed,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *VertexStatus) Reset() { *m = VertexStatus{} }
|
||||
|
|
|
@ -121,7 +121,6 @@ message VertexStatus {
|
|||
string name = 3;
|
||||
int64 current = 4;
|
||||
int64 total = 5;
|
||||
// TODO: add started, completed
|
||||
google.protobuf.Timestamp timestamp = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
|
||||
google.protobuf.Timestamp started = 7 [(gogoproto.stdtime) = true ];
|
||||
google.protobuf.Timestamp completed = 8 [(gogoproto.stdtime) = true ];
|
||||
|
|
|
@ -235,7 +235,7 @@ func newStorageItem(id string, b *bolt.Bucket, s *Store) (*StorageItem, error) {
|
|||
return si, nil
|
||||
}
|
||||
|
||||
func (s *StorageItem) Storage() *Store { // TODO: used in local source. how to remove this?
|
||||
func (s *StorageItem) Storage() *Store {
|
||||
return s.storage
|
||||
}
|
||||
|
||||
|
|
|
@ -341,13 +341,13 @@ func prepareSyncedDirs(def *llb.Definition, localDirs map[string]string) ([]file
|
|||
return nil, errors.Wrap(err, "failed to parse llb proto op")
|
||||
}
|
||||
if src := op.GetSource(); src != nil {
|
||||
if strings.HasPrefix(src.Identifier, "local://") { // TODO: just make a type property
|
||||
if strings.HasPrefix(src.Identifier, "local://") {
|
||||
name := strings.TrimPrefix(src.Identifier, "local://")
|
||||
d, ok := localDirs[name]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("local directory %s not enabled", name)
|
||||
}
|
||||
dirs = append(dirs, filesync.SyncedDir{Name: name, Dir: d, Map: resetUIDAndGID}) // TODO: excludes
|
||||
dirs = append(dirs, filesync.SyncedDir{Name: name, Dir: d, Map: resetUIDAndGID})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ func (sp *fsSyncProvider) TarStream(stream FileSync_TarStreamServer) error {
|
|||
func (sp *fsSyncProvider) handle(method string, stream grpc.ServerStream) (retErr error) {
|
||||
var pr *protocol
|
||||
for _, p := range supportedProtocols {
|
||||
if method == p.name && isProtoSupported(p.name) {
|
||||
if method == p.name {
|
||||
pr = &p
|
||||
break
|
||||
}
|
||||
|
@ -133,14 +133,6 @@ type protocol struct {
|
|||
recvFn func(stream grpc.ClientStream, destDir string, cu CacheUpdater, progress progressCb, differ fsutil.DiffType, mapFunc func(string, *fstypes.Stat) bool) error
|
||||
}
|
||||
|
||||
func isProtoSupported(p string) bool {
|
||||
// TODO: this should be removed after testing if stability is confirmed
|
||||
if override := os.Getenv("BUILD_STREAM_PROTOCOL"); override != "" {
|
||||
return strings.EqualFold(p, override)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
var supportedProtocols = []protocol{
|
||||
{
|
||||
name: "diffcopy",
|
||||
|
@ -174,7 +166,7 @@ type CacheUpdater interface {
|
|||
func FSSync(ctx context.Context, c session.Caller, opt FSSendRequestOpt) error {
|
||||
var pr *protocol
|
||||
for _, p := range supportedProtocols {
|
||||
if isProtoSupported(p.name) && c.Supports(session.MethodURL(_FileSync_serviceDesc.ServiceName, p.name)) {
|
||||
if c.Supports(session.MethodURL(_FileSync_serviceDesc.ServiceName, p.name)) {
|
||||
pr = &p
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue