@@ -31,7 +31,7 @@ type Renderer interface {
3131Close ()
3232}
3333
34- var ErrorTemplateVersionNotReady = xerrors .New ("template version job not finished" )
34+ var ErrTemplateVersionNotReady = xerrors .New ("template version job not finished" )
3535
3636// Loader is used to load the necessary coder objects for rendering a template
3737// version's parameters. The output is a Renderer, which is the object that uses
@@ -91,7 +91,7 @@ func (r *Loader) Load(ctx context.Context, db database.Store) error {
9191}
9292
9393if ! r .job .CompletedAt .Valid {
94- return ErrorTemplateVersionNotReady
94+ return ErrTemplateVersionNotReady
9595}
9696
9797if r .terraformValues == nil {
@@ -131,7 +131,9 @@ func (r *Loader) Renderer(ctx context.Context, db database.Store, cache *files.C
131131// Renderer caches all the necessary files when rendering a template version's
132132// parameters. It must be closed after use to release the cached files.
133133func (r * Loader )dynamicRenderer (ctx context.Context ,db database.Store ,cache * files.Cache ) (* DynamicRenderer ,error ) {
134- // If they can read the template version, then they can read the file.
134+ // If they can read the template version, then they can read the file for
135+ // parameter loading purposes.
136+ //nolint:gocritic
135137fileCtx := dbauthz .AsFileReader (ctx )
136138templateFS ,err := cache .Acquire (fileCtx ,r .job .FileID )
137139if err != nil {
@@ -174,9 +176,8 @@ type DynamicRenderer struct {
174176templateFS fs.FS
175177plan json.RawMessage
176178
177- ownerErrors map [uuid.UUID ]error
178- currentOwner * previewtypes.WorkspaceOwner
179- currentOwnerID uuid.UUID
179+ ownerErrors map [uuid.UUID ]error
180+ currentOwner * previewtypes.WorkspaceOwner
180181
181182once sync.Once
182183close func ()