parent
b622a87c5d
commit
7562a6638a
|
@ -479,7 +479,7 @@ func (lbf *llbBridgeForwarder) Solve(ctx context.Context, req *pb.SolveRequest)
|
|||
if req.AllowResultArrayRef {
|
||||
refMap := make(map[string]*pb.Ref, len(res.Refs))
|
||||
for k, id := range ids {
|
||||
refMap[k] = &pb.Ref{Ids: []string{id}}
|
||||
refMap[k] = pb.NewRef(id)
|
||||
}
|
||||
pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: refMap}}
|
||||
} else {
|
||||
|
@ -495,7 +495,7 @@ func (lbf *llbBridgeForwarder) Solve(ctx context.Context, req *pb.SolveRequest)
|
|||
defaultID = id
|
||||
|
||||
if req.AllowResultArrayRef {
|
||||
pbRes.Result = &pb.Result_Ref{Ref: &pb.Ref{Ids: []string{id}}}
|
||||
pbRes.Result = &pb.Result_Ref{Ref: pb.NewRef(id)}
|
||||
} else {
|
||||
pbRes.Result = &pb.Result_RefDeprecated{RefDeprecated: id}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro
|
|||
retError = err
|
||||
continue
|
||||
}
|
||||
m[k] = &pb.Ref{Ids: []string{id}}
|
||||
m[k] = pb.NewRef(id)
|
||||
}
|
||||
pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: m}}
|
||||
} else {
|
||||
|
@ -120,7 +120,7 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro
|
|||
if err != nil {
|
||||
retError = err
|
||||
} else {
|
||||
pbRes.Result = &pb.Result_Ref{Ref: &pb.Ref{Ids: []string{id}}}
|
||||
pbRes.Result = &pb.Result_Ref{Ref: pb.NewRef(id)}
|
||||
}
|
||||
}
|
||||
if retError == nil {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package moby_buildkit_v1_frontend
|
||||
|
||||
func NewRef(id string) *Ref {
|
||||
var ref Ref
|
||||
if id != "" {
|
||||
ref.Ids = append(ref.Ids, id)
|
||||
}
|
||||
return &ref
|
||||
}
|
Loading…
Reference in New Issue