From a51938c246ecc3ddfacaf83697af40b463592f17 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Tue, 25 Jun 2024 18:20:34 +0200 Subject: [PATCH] stacks: move PlanTimestamp method for consistency --- .../internal/stackeval/component_instance.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/stacks/stackruntime/internal/stackeval/component_instance.go b/internal/stacks/stackruntime/internal/stackeval/component_instance.go index c4bb9710d2..487ccd3c3c 100644 --- a/internal/stacks/stackruntime/internal/stackeval/component_instance.go +++ b/internal/stacks/stackruntime/internal/stackeval/component_instance.go @@ -1200,6 +1200,12 @@ func (c *ComponentInstance) ResolveExpressionReference(ctx context.Context, ref return stack.resolveExpressionReference(ctx, ref, nil, c.repetition) } +// PlanTimestamp implements ExpressionScope, providing the timestamp at which +// the current plan is being run. +func (c *ComponentInstance) PlanTimestamp() time.Time { + return c.main.PlanTimestamp() +} + // PlanChanges implements Plannable by validating that all of the per-instance // arguments are suitable, and then asking the main Terraform language runtime // to produce a plan in terms of the component's selected module. @@ -1592,7 +1598,3 @@ func (c *ComponentInstance) tracingName() string { func (c *ComponentInstance) reportNamedPromises(cb func(id promising.PromiseID, name string)) { cb(c.moduleTreePlan.PromiseID(), c.Addr().String()+" plan") } - -func (c *ComponentInstance) PlanTimestamp() time.Time { - return c.main.PlanTimestamp() -}