Use parentheses for merge+diff vertex names.

This is easier to read than quotes, which result in lots of escaping in
progress output.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
master
Erik Sipsma 2022-02-01 13:47:56 -08:00
parent e8f5f523aa
commit 553d3eafda
1 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,6 @@ package llbsolver
import (
"fmt"
"strconv"
"strings"
"github.com/containerd/containerd/platforms"
@ -271,9 +270,9 @@ func llbOpName(pbOp *pb.Op, load func(digest.Digest) (solver.Vertex, error)) (st
if err != nil {
return "", err
}
subnames[i] = strconv.Quote(subvtx.Name())
subnames[i] = subvtx.Name()
}
return "merge " + strings.Join(subnames, " + "), nil
return "merge " + fmt.Sprintf("(%s)", strings.Join(subnames, ", ")), nil
case *pb.Op_Diff:
var lowerName string
if op.Diff.Lower.Input == -1 {
@ -283,7 +282,7 @@ func llbOpName(pbOp *pb.Op, load func(digest.Digest) (solver.Vertex, error)) (st
if err != nil {
return "", err
}
lowerName = strconv.Quote(lowerVtx.Name())
lowerName = fmt.Sprintf("(%s)", lowerVtx.Name())
}
var upperName string
if op.Diff.Upper.Input == -1 {
@ -293,7 +292,7 @@ func llbOpName(pbOp *pb.Op, load func(digest.Digest) (solver.Vertex, error)) (st
if err != nil {
return "", err
}
upperName = strconv.Quote(upperVtx.Name())
upperName = fmt.Sprintf("(%s)", upperVtx.Name())
}
return "diff " + lowerName + " -> " + upperName, nil
default: