MCPcopy
hub / github.com/opentofu/opentofu / stubAllVariables

Function stubAllVariables

internal/cloud/backend_context.go:194–219  ·  view source on GitHub ↗
(vv map[string]backend.UnparsedVariableValue, decls map[string]*configs.Variable)

Source from the content-addressed store, hash-verified

192}
193
194func stubAllVariables(vv map[string]backend.UnparsedVariableValue, decls map[string]*configs.Variable) tofu.InputValues {
195 ret := make(tofu.InputValues, len(decls))
196
197 for name, cfg := range decls {
198 raw, exists := vv[name]
199 if !exists {
200 ret[name] = &tofu.InputValue{
201 Value: cty.UnknownVal(cfg.Type),
202 SourceType: tofu.ValueFromConfig,
203 }
204 continue
205 }
206
207 val, diags := raw.ParseVariableValue(cfg.ParsingMode)
208 if diags.HasErrors() {
209 ret[name] = &tofu.InputValue{
210 Value: cty.UnknownVal(cfg.Type),
211 SourceType: tofu.ValueFromConfig,
212 }
213 continue
214 }
215 ret[name] = val
216 }
217
218 return ret
219}
220
221// remoteStoredVariableValue is a backend.UnparsedVariableValue implementation
222// that translates from the go-tfe representation of stored variables into

Callers 1

LocalRunMethod · 0.70

Calls 2

HasErrorsMethod · 0.80
ParseVariableValueMethod · 0.65

Tested by

no test coverage detected