Skip to content

Commit

Permalink
fix detailed diff v2
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Oct 11, 2024
1 parent eb6f421 commit 1fb28e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/tfbridge/detailed_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ func makeDetailedDiffV2(
diff shim.InstanceDiff,
assets AssetTable,
supportsSecrets bool,
oldInputs, newInputs resource.PropertyMap,
) (map[string]*pulumirpc.PropertyDiff, error) {
// We need to compare the new and olds after all transformations have been applied.
// ex. state upgrades, implementation-specific normalizations etc.
Expand Down
11 changes: 10 additions & 1 deletion pkg/tfbridge/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,16 @@ func (p *Provider) Diff(ctx context.Context, req *pulumirpc.DiffRequest) (*pulum
changes = pulumirpc.DiffResponse_DIFF_SOME
}

detailedDiff, err = makeDetailedDiffV2(ctx, schema, fields, res.TF, p.tf, state, diff, assets, p.supportsSecrets)
oldInputs, err := plugin.UnmarshalProperties(req.GetOldInputs(),
plugin.MarshalOptions{Label: fmt.Sprintf("%s.oldInputs", label), SkipNulls: true})
if err != nil {
return nil, err
}

detailedDiff, err = makeDetailedDiffV2(
ctx, schema, fields, res.TF, p.tf, state, diff, assets, p.supportsSecrets, oldInputs, news,
)

if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/tfbridge/recover_set_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ func recoverSetOrder(
propertyPath := SchemaPathToPropertyPath(setPath, tfs, ps)
recoverSetOrderSingle(target, origin, propertyPath)
}
}
}

0 comments on commit 1fb28e4

Please sign in to comment.