Skip to content

Commit e1a6d27

Browse files
add note about stripping secrets
1 parent 3129c6d commit e1a6d27

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pkg/pf/tests/util.go

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func bridgedProvider(prov *providerbuilder.Provider) info.Provider {
5555
Name: prov.TypeName,
5656
Version: "0.0.1",
5757
MetadataInfo: &tfbridge0.MetadataInfo{},
58+
EnableAccurateBridgePreview: true,
5859
}
5960

6061
provider.MustComputeTokens(tokens.SingleModule(prov.TypeName, "index", tokens.MakeStandard(prov.TypeName)))

pkg/tfbridge/detailed_diff.go

+6
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,12 @@ func MakeDetailedDiffV2(
483483
ps map[string]*SchemaInfo,
484484
priorProps, props, newInputs resource.PropertyMap,
485485
) map[string]*pulumirpc.PropertyDiff {
486+
// Strip secrets and outputs from the properties before calculating the diff.
487+
// This allows the rest of the algorithm to focus on the actual changes and not
488+
// have to deal with the extra noise.
489+
// This is safe to do here because the detailed diff we return to the engine
490+
// is only represented by paths to the values and not the values themselves.
491+
// The engine will then takes care of masking secrets.
486492
stripSecretsAndOutputs := func(props resource.PropertyMap) resource.PropertyMap {
487493
propsVal := propertyvalue.RemoveSecretsAndOutputs(resource.NewProperty(props))
488494
return propsVal.ObjectValue()

0 commit comments

Comments
 (0)