Skip to content

Commit

Permalink
image-builder-mk3: log JSON as an object instead of a string
Browse files Browse the repository at this point in the history
Signed-off-by: JenTing Hsiao <[email protected]>
  • Loading branch information
jenting authored and roboquat committed Nov 24, 2022
1 parent b0c039f commit 9e8b89e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/image-builder-mk3/pkg/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ func (o *Orchestrator) ResolveBaseImage(ctx context.Context, req *protocol.Resol

reqs, _ := protojson.Marshal(req)
safeReqs, _ := log.RedactJSON(reqs)
log.WithField("req", string(safeReqs)).Debug("ResolveBaseImage")
safeReqsLog := make(map[string]interface{})
_ = json.Unmarshal(safeReqs, &safeReqsLog)
log.WithFields(safeReqsLog).Debug("ResolveBaseImage")

reqauth := o.AuthResolver.ResolveRequestAuth(req.Auth)

Expand All @@ -173,7 +175,9 @@ func (o *Orchestrator) ResolveWorkspaceImage(ctx context.Context, req *protocol.

reqs, _ := protojson.Marshal(req)
safeReqs, _ := log.RedactJSON(reqs)
log.WithField("req", string(safeReqs)).Debug("ResolveWorkspaceImage")
safeReqsLog := make(map[string]interface{})
_ = json.Unmarshal(safeReqs, &safeReqsLog)
log.WithFields(safeReqsLog).Debug("ResolveWorkspaceImage")

reqauth := o.AuthResolver.ResolveRequestAuth(req.Auth)
baseref, err := o.getBaseImageRef(ctx, req.Source, reqauth)
Expand Down

0 comments on commit 9e8b89e

Please sign in to comment.