Skip to content

Commit

Permalink
add note about stripping secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Nov 26, 2024
1 parent 3129c6d commit ea8fb88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/tfbridge/detailed_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ func MakeDetailedDiffV2(
ps map[string]*SchemaInfo,
priorProps, props, newInputs resource.PropertyMap,
) map[string]*pulumirpc.PropertyDiff {
// Strip secrets and outputs from the properties before calculating the diff.
// This allows the rest of the algorithm to focus on the actual changes and not
// have to deal with the extra noise.
// This is safe to do here because the detailed diff we return to the engine
// is only represented by paths to the values and not the values themselves.
// The engine will then takes care of masking secrets.
stripSecretsAndOutputs := func(props resource.PropertyMap) resource.PropertyMap {
propsVal := propertyvalue.RemoveSecretsAndOutputs(resource.NewProperty(props))
return propsVal.ObjectValue()
Expand Down

0 comments on commit ea8fb88

Please sign in to comment.