From 510b6e0a15b9d2c51537e00495c4922bb3f6891b Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Wed, 24 Jan 2024 13:28:06 +0300 Subject: [PATCH] fix diff state not being set to freshly observed state for non-existing resources Signed-off-by: Erhan Cagirici --- pkg/controller/external_nofork.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/external_nofork.go b/pkg/controller/external_nofork.go index 7e8cfab7..11d1831f 100644 --- a/pkg/controller/external_nofork.go +++ b/pkg/controller/external_nofork.go @@ -474,8 +474,8 @@ func (n *noForkExternal) Observe(ctx context.Context, mg xpresource.Managed) (ma if diag != nil && diag.HasError() { return managed.ExternalObservation{}, errors.Errorf("failed to observe the resource: %v", diag) } - diffState := n.opTracker.GetTfState() n.opTracker.SetTfState(newState) // TODO: missing RawConfig & RawPlan here... + diffState := n.opTracker.GetTfState() resourceExists := newState != nil && newState.ID != "" var stateValueMap map[string]any