@@ -2,8 +2,8 @@ package dynamicparameters
22
33import (
44"context"
5- "encoding/json"
65"io/fs"
6+ "log/slog"
77"sync"
88
99"github.com/google/uuid"
@@ -152,16 +152,10 @@ func (r *Loader) dynamicRenderer(ctx context.Context, db database.Store, cache *
152152terraformFS = files .NewOverlayFS (templateFS , []files.Overlay {{Path :".terraform/modules" ,FS :moduleFilesFS }})
153153}
154154
155- plan := json .RawMessage ("{}" )
156- if len (r .terraformValues .CachedPlan )> 0 {
157- plan = r .terraformValues .CachedPlan
158- }
159-
160155return & dynamicRenderer {
161156data :r ,
162157templateFS :terraformFS ,
163158db :db ,
164- plan :plan ,
165159ownerErrors :make (map [uuid.UUID ]error ),
166160close :func () {
167161// Up to 2 files are cached, and must be released when rendering is complete.
@@ -179,7 +173,6 @@ type dynamicRenderer struct {
179173db database.Store
180174data * Loader
181175templateFS fs.FS
182- plan json.RawMessage
183176
184177ownerErrors map [uuid.UUID ]error
185178currentOwner * previewtypes.WorkspaceOwner
@@ -213,6 +206,10 @@ func (r *dynamicRenderer) Render(ctx context.Context, ownerID uuid.UUID, values
213206PlanJSON :r .data .terraformValues .CachedPlan ,
214207ParameterValues :values ,
215208Owner :* r .currentOwner ,
209+ // Do not emit parser logs to coderd output logs.
210+ // TODO: Returning this logs in the output would benefit the caller.
211+ // Unsure how large the logs can be, so for now we just discard them.
212+ Logger :slog .New (slog .DiscardHandler ),
216213}
217214
218215return preview .Preview (ctx ,input ,r .templateFS )