From 553d3eafda99758ee2a45094752dbb29ee1d4677 Mon Sep 17 00:00:00 2001 From: Erik Sipsma Date: Tue, 1 Feb 2022 13:47:56 -0800 Subject: [PATCH] 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 --- solver/llbsolver/vertex.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/solver/llbsolver/vertex.go b/solver/llbsolver/vertex.go index 721410c8..0c9460f9 100644 --- a/solver/llbsolver/vertex.go +++ b/solver/llbsolver/vertex.go @@ -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: