@@ -31,7 +31,7 @@ type Renderer interface {
31
31
Close ()
32
32
}
33
33
34
- var ErrorTemplateVersionNotReady = xerrors .New ("template version job not finished" )
34
+ var ErrTemplateVersionNotReady = xerrors .New ("template version job not finished" )
35
35
36
36
// Loader is used to load the necessary coder objects for rendering a template
37
37
// 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 {
91
91
}
92
92
93
93
if ! r .job .CompletedAt .Valid {
94
- return ErrorTemplateVersionNotReady
94
+ return ErrTemplateVersionNotReady
95
95
}
96
96
97
97
if r .terraformValues == nil {
@@ -131,7 +131,9 @@ func (r *Loader) Renderer(ctx context.Context, db database.Store, cache *files.C
131
131
// Renderer caches all the necessary files when rendering a template version's
132
132
// parameters. It must be closed after use to release the cached files.
133
133
func (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
135
137
fileCtx := dbauthz .AsFileReader (ctx )
136
138
templateFS , err := cache .Acquire (fileCtx , r .job .FileID )
137
139
if err != nil {
@@ -174,9 +176,8 @@ type DynamicRenderer struct {
174
176
templateFS fs.FS
175
177
plan json.RawMessage
176
178
177
- ownerErrors map [uuid.UUID ]error
178
- currentOwner * previewtypes.WorkspaceOwner
179
- currentOwnerID uuid.UUID
179
+ ownerErrors map [uuid.UUID ]error
180
+ currentOwner * previewtypes.WorkspaceOwner
180
181
181
182
once sync.Once
182
183
close func ()
0 commit comments