Skip to content

Commit eb44fc3

Browse files
authored
Merge pull request #943 from imjasonh/sort-with
sort with key/values
2 parents 769f67b + 65adda8 commit eb44fc3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/build/pipeline.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ import (
2020
"fmt"
2121
"os"
2222
"path/filepath"
23+
"sort"
2324
"strconv"
2425
"strings"
2526

2627
"github.com/chainguard-dev/clog"
2728
"go.opentelemetry.io/otel"
29+
"golang.org/x/exp/maps"
2830

2931
"gopkg.in/yaml.v3"
3032

@@ -268,8 +270,10 @@ func (pctx *PipelineContext) loadUse(ctx context.Context, pb *PipelineBuild, use
268270

269271
func (pctx *PipelineContext) dumpWith(ctx context.Context) {
270272
log := clog.FromContext(ctx)
271-
for k, v := range pctx.Pipeline.With {
272-
log.Debug(" " + k + ": " + v)
273+
ks := maps.Keys(pctx.Pipeline.With)
274+
sort.Strings(ks)
275+
for _, k := range ks {
276+
log.Debugf(" %s: %s", k, pctx.Pipeline.With[k])
273277
}
274278
}
275279

0 commit comments

Comments
 (0)