(ctx context.Context, eval *StaticEvaluator)
| 256 | } |
| 257 | |
| 258 | func (mc *ModuleCall) decodeStaticVersion(ctx context.Context, eval *StaticEvaluator) hcl.Diagnostics { |
| 259 | var diags hcl.Diagnostics |
| 260 | |
| 261 | if mc.VersionAttr == nil { |
| 262 | return diags |
| 263 | } |
| 264 | |
| 265 | val, valDiags := eval.Evaluate(ctx, mc.VersionAttr.Expr, StaticIdentifier{ |
| 266 | Module: eval.call.addr, |
| 267 | Subject: fmt.Sprintf("module.%s.version", mc.Name), |
| 268 | DeclRange: mc.VersionAttr.Range, |
| 269 | }) |
| 270 | diags = diags.Extend(valDiags) |
| 271 | if diags.HasErrors() { |
| 272 | return diags |
| 273 | } |
| 274 | |
| 275 | // If the version evaluates to null, treat it as if no version was specified |
| 276 | if val.IsNull() { |
| 277 | mc.VersionAttr = nil |
| 278 | return diags |
| 279 | } |
| 280 | |
| 281 | var verDiags hcl.Diagnostics |
| 282 | mc.Version, verDiags = decodeVersionConstraintValue(mc.VersionAttr, val) |
| 283 | return diags.Extend(verDiags) |
| 284 | } |
| 285 | |
| 286 | func (mc *ModuleCall) decodeStaticVariables(ctx context.Context, eval *StaticEvaluator) { |
| 287 | attr, _ := mc.Config.JustAttributes() |
no test coverage detected