MCPcopy Index your code
hub / github.com/coder/coder / CheckPresets

Function CheckPresets

coderd/dynamicparameters/presets.go:10–28  ·  view source on GitHub ↗

CheckPresets extracts the preset related diagnostics from a template version preset

(output *preview.Output, diags hcl.Diagnostics)

Source from the content-addressed store, hash-verified

8
9// CheckPresets extracts the preset related diagnostics from a template version preset
10func CheckPresets(output *preview.Output, diags hcl.Diagnostics) *DiagnosticError {
11 de := presetValidationError(diags)
12 if output == nil {
13 return de
14 }
15
16 presets := output.Presets
17 for _, preset := range presets {
18 if hcl.Diagnostics(preset.Diagnostics).HasErrors() {
19 de.Extend(preset.Name, hcl.Diagnostics(preset.Diagnostics))
20 }
21 }
22
23 if de.HasError() {
24 return de
25 }
26
27 return nil
28}

Callers 1

Calls 3

presetValidationErrorFunction · 0.85
ExtendMethod · 0.80
HasErrorMethod · 0.80

Tested by

no test coverage detected