From 1e04a7c9feac63686c32f0cfc41d953c8ce8cdb5 Mon Sep 17 00:00:00 2001 From: Venelin Date: Mon, 16 Dec 2024 13:32:55 +0200 Subject: [PATCH] Only return a detaied diff if a diff is detected --- pkg/tfbridge/provider.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/tfbridge/provider.go b/pkg/tfbridge/provider.go index 15cd9af21b..6c6dce29d3 100644 --- a/pkg/tfbridge/provider.go +++ b/pkg/tfbridge/provider.go @@ -1175,13 +1175,13 @@ func (p *Provider) Diff(ctx context.Context, req *pulumirpc.DiffRequest) (*pulum changes = pulumirpc.DiffResponse_DIFF_NONE } else { changes = pulumirpc.DiffResponse_DIFF_SOME - } - replaceDecision := diff.RequiresNew() - detailedDiff, err = makeDetailedDiffV2( - ctx, schema, fields, res.TF, p.tf, state, diff, assets, p.supportsSecrets, news, &replaceDecision) - if err != nil { - return nil, err + replaceDecision := diff.RequiresNew() + detailedDiff, err = makeDetailedDiffV2( + ctx, schema, fields, res.TF, p.tf, state, diff, assets, p.supportsSecrets, news, &replaceDecision) + if err != nil { + return nil, err + } } } else { dd := makeDetailedDiffExtra(ctx, schema, fields, olds, news, diff)