From ccb06111c8d1bdaf0c24ed5a52a077e039bac8b0 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Fri, 22 Dec 2023 23:47:19 +0300 Subject: [PATCH] Set diff state's Attributes to nil if the resource does not exist Signed-off-by: Alper Rifat Ulucinar --- pkg/controller/external_nofork.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/controller/external_nofork.go b/pkg/controller/external_nofork.go index 4bb73c60..0e7496dd 100644 --- a/pkg/controller/external_nofork.go +++ b/pkg/controller/external_nofork.go @@ -487,6 +487,8 @@ func (n *noForkExternal) Observe(ctx context.Context, mg xpresource.Managed) (ma stateValueMap = jsonMap newState.RawPlan = stateValue diffState = newState + } else if diffState != nil { + diffState.Attributes = nil } instanceDiff, err := n.getResourceDataDiff(mg.(resource.Terraformed), ctx, diffState, resourceExists) if err != nil {