Fixes: show insensitive plan details when resource in set with sensitive value (#1313)

Signed-off-by: Zejun Chen <tibazq@gmail.com>
Signed-off-by: chenzj <tibazq@gmail.com>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
This commit is contained in:
chenzj
2024-06-21 02:06:33 +08:00
committed by GitHub
parent 261b966562
commit 1ecb2dcae3
4 changed files with 327 additions and 62 deletions

View File

@@ -435,7 +435,7 @@ func MarshalResourceChanges(resources []*plans.ResourceInstanceChangeSrc, schema
if schema.ContainsSensitive() {
marks = append(marks, schema.ValueMarks(changeV.Before, nil)...)
}
bs := jsonstate.SensitiveAsBool(changeV.Before.MarkWithPaths(marks))
bs := jsonstate.SensitiveAsBoolWithPathValueMarks(changeV.Before, marks)
beforeSensitive, err = ctyjson.Marshal(bs, bs.Type())
if err != nil {
return nil, err
@@ -464,7 +464,7 @@ func MarshalResourceChanges(resources []*plans.ResourceInstanceChangeSrc, schema
if schema.ContainsSensitive() {
marks = append(marks, schema.ValueMarks(changeV.After, nil)...)
}
as := jsonstate.SensitiveAsBool(changeV.After.MarkWithPaths(marks))
as := jsonstate.SensitiveAsBoolWithPathValueMarks(changeV.After, marks)
afterSensitive, err = ctyjson.Marshal(as, as.Type())
if err != nil {
return nil, err