Skip to content

chore: use static params when dynamic param metadata is missing #17836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix leaked files
  • Loading branch information
Emyrk committed May 15, 2025
commit 13215d621fb2bfcd60cecc273daa8afbd3d640a7
2 changes: 1 addition & 1 deletion coderd/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

if tf.CachedModuleFiles.Valid {
moduleFilesFS, err := api.FileCache.Acquire(fileCtx, tf.CachedModuleFiles.UUID)
defer api.FileCache.Release(fileID)
defer api.FileCache.Release(tf.CachedModuleFiles.UUID)
if err != nil {
httpapi.Write(ctx, rw, http.StatusNotFound, codersdk.Response{
Message: "Internal error fetching Terraform modules.",
Expand Down Expand Up @@ -241,7 +241,7 @@
params = append(params, param)
}

api.handleParameterWebsocket(rw, r, func(ctx context.Context, values map[string]string) (*preview.Output, hcl.Diagnostics) {

Check failure on line 244 in coderd/parameters.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
for i := range params {
param := &params[i]
paramValue, ok := values[param.Name]
Expand Down
2 changes: 1 addition & 1 deletion codersdk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func (c *Client) Dial(ctx context.Context, path string, opts *websocket.DialOpti
}

conn, resp, err := websocket.Dial(ctx, u.String(), opts)
if resp.Body != nil {
if resp != nil && resp.Body != nil {
resp.Body.Close()
}
if err != nil {
Expand Down
Loading