Skip to content

Commit

Permalink
Merge pull request #9 from gotwarlost/debug-response
Browse files Browse the repository at this point in the history
fix debug response when a response var is present
  • Loading branch information
gotwarlost committed May 7, 2024
2 parents ccc663e + 70511a0 commit a4ef7be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/fn/fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ func (f *Cue) Eval(in *fnv1beta1.RunFunctionRequest, script string, opts EvalOpt
return nil, errors.Wrap(err, "marshal cue output")
}
if opts.Debug.Enabled {
log.Printf("[response:begin]\n%s\n[response:end]\n", f.getDebugString(resBytes, opts.Debug.Raw))
preamble = ""
if opts.ResponseVar != "" {
preamble = opts.ResponseVar + ":"
}
log.Printf("[response:begin]\n%s %s\n[response:end]\n", preamble, f.getDebugString(resBytes, opts.Debug.Raw))
}

var ret fnv1beta1.RunFunctionResponse
Expand Down

0 comments on commit a4ef7be

Please sign in to comment.