Skip to content

Commit

Permalink
Merge pull request #943 from imjasonh/sort-with
Browse files Browse the repository at this point in the history
sort with key/values
  • Loading branch information
imjasonh authored Jan 20, 2024
2 parents 769f67b + 65adda8 commit eb44fc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/build/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"strconv"
"strings"

"github.com/chainguard-dev/clog"
"go.opentelemetry.io/otel"
"golang.org/x/exp/maps"

"gopkg.in/yaml.v3"

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

func (pctx *PipelineContext) dumpWith(ctx context.Context) {
log := clog.FromContext(ctx)
for k, v := range pctx.Pipeline.With {
log.Debug(" " + k + ": " + v)
ks := maps.Keys(pctx.Pipeline.With)
sort.Strings(ks)
for _, k := range ks {
log.Debugf(" %s: %s", k, pctx.Pipeline.With[k])
}
}

Expand Down

0 comments on commit eb44fc3

Please sign in to comment.