10000 chore: use static params when dynamic param metadata is missing by Emyrk · Pull Request #17836 · coder/coder · GitHub
[go: up one dir, main page]

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
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
move release to only if err == nil
  • Loading branch information
Emyrk committed May 15, 2025
commit ef15df1170b5520b8f8d9d89e05622dedeb6c34a
4 changes: 2 additions & 2 deletions coderd/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ func (api *API) handleDynamicParameters(rw http.ResponseWriter, r *http.Request,

// Add the file first. Calling `Release` if it fails is a no-op, so this is safe.
templateFS, err := api.FileCache.Acquire(fileCtx, fileID)
defer api.FileCache.Release(fileID)
if err != nil {
httpapi.Write(ctx, rw, http.StatusNotFound, codersdk.Response{
Message: "Internal error fetching template version Terraform.",
Detail: err.Error(),
})
return
}
defer api.FileCache.Release(fileID)

// Having the Terraform plan available for the evaluation engine is helpful
// for populating values from data blocks, but isn't strictly required. If
Expand All @@ -120,14 +120,14 @@ func (api *API) handleDynamicParameters(rw http.ResponseWriter, r *http.Request,

if tf.CachedModuleFiles.Valid {
moduleFilesFS, err := api.FileCache.Acquire(fileCtx, tf.CachedModuleFiles.UUID)
defer api.FileCache.Release(tf.CachedModuleFiles.UUID)
if err != nil {
httpapi.Write(ctx, rw, http.StatusNotFound, codersdk.Response{
Message: "Internal error fetching Terraform modules.",
Detail: err.Error(),
})
return
}
defer api.FileCache.Release(tf.CachedModuleFiles.UUID)

templateFS = files.NewOverlayFS(templateFS, []files.Overlay{{Path: ".terraform/modules", FS: moduleFilesFS}})
}
Expand Down
Loading
0