Skip to content

Commit 5e09c69

Browse files
committed
Allow requiresreplace plan modifier to run for write-only attributes
Signed-off-by: Andrei Ciobanu <[email protected]>
1 parent 7ab0d80 commit 5e09c69

36 files changed

+1588
-70
lines changed

internal/fwserver/attribute_plan_modification.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ func AttributePlanModifyBool(ctx context.Context, attribute fwxschema.AttributeW
786786
Private: req.Private,
787787
State: req.State,
788788
StateValue: stateValue,
789+
WriteOnly: attribute.IsWriteOnly(),
789790
}
790791

791792
for _, planModifier := range attribute.BoolPlanModifiers() {
@@ -946,6 +947,7 @@ func AttributePlanModifyFloat32(ctx context.Context, attribute fwxschema.Attribu
946947
Private: req.Private,
947948
State: req.State,
948949
StateValue: stateValue,
950+
WriteOnly: attribute.IsWriteOnly(),
949951
}
950952

951953
for _, planModifier := range attribute.Float32PlanModifiers() {
@@ -1106,6 +1108,7 @@ func AttributePlanModifyFloat64(ctx context.Context, attribute fwxschema.Attribu
11061108
Private: req.Private,
11071109
State: req.State,
11081110
StateValue: stateValue,
1111+
WriteOnly: attribute.IsWriteOnly(),
11091112
}
11101113

11111114
for _, planModifier := range attribute.Float64PlanModifiers() {
@@ -1266,6 +1269,7 @@ func AttributePlanModifyInt32(ctx context.Context, attribute fwxschema.Attribute
12661269
Private: req.Private,
12671270
State: req.State,
12681271
StateValue: stateValue,
1272+
WriteOnly: attribute.IsWriteOnly(),
12691273
}
12701274

12711275
for _, planModifier := range attribute.Int32PlanModifiers() {
@@ -1426,6 +1430,7 @@ func AttributePlanModifyInt64(ctx context.Context, attribute fwxschema.Attribute
14261430
Private: req.Private,
14271431
State: req.State,
14281432
StateValue: stateValue,
1433+
WriteOnly: attribute.IsWriteOnly(),
14291434
}
14301435

14311436
for _, planModifier := range attribute.Int64PlanModifiers() {
@@ -1586,6 +1591,7 @@ func AttributePlanModifyList(ctx context.Context, attribute fwxschema.AttributeW
15861591
Private: req.Private,
15871592
State: req.State,
15881593
StateValue: stateValue,
1594+
WriteOnly: attribute.IsWriteOnly(),
15891595
}
15901596

15911597
for _, planModifier := range attribute.ListPlanModifiers() {
@@ -1746,6 +1752,7 @@ func AttributePlanModifyMap(ctx context.Context, attribute fwxschema.AttributeWi
17461752
Private: req.Private,
17471753
State: req.State,
17481754
StateValue: stateValue,
1755+
WriteOnly: attribute.IsWriteOnly(),
17491756
}
17501757

17511758
for _, planModifier := range attribute.MapPlanModifiers() {
@@ -1906,6 +1913,7 @@ func AttributePlanModifyNumber(ctx context.Context, attribute fwxschema.Attribut
19061913
Private: req.Private,
19071914
State: req.State,
19081915
StateValue: stateValue,
1916+
WriteOnly: attribute.IsWriteOnly(),
19091917
}
19101918

19111919
for _, planModifier := range attribute.NumberPlanModifiers() {
@@ -2066,6 +2074,7 @@ func AttributePlanModifyObject(ctx context.Context, attribute fwxschema.Attribut
20662074
Private: req.Private,
20672075
State: req.State,
20682076
StateValue: stateValue,
2077+
WriteOnly: attribute.IsWriteOnly(),
20692078
}
20702079

20712080
for _, planModifier := range attribute.ObjectPlanModifiers() {
@@ -2386,6 +2395,7 @@ func AttributePlanModifyString(ctx context.Context, attribute fwxschema.Attribut
23862395
Private: req.Private,
23872396
State: req.State,
23882397
StateValue: stateValue,
2398+
WriteOnly: attribute.IsWriteOnly(),
23892399
}
23902400

23912401
for _, planModifier := range attribute.StringPlanModifiers() {
@@ -2546,6 +2556,7 @@ func AttributePlanModifyDynamic(ctx context.Context, attribute fwxschema.Attribu
25462556
Private: req.Private,
25472557
State: req.State,
25482558
StateValue: stateValue,
2559+
WriteOnly: attribute.IsWriteOnly(),
25492560
}
25502561

25512562
for _, planModifier := range attribute.DynamicPlanModifiers() {

0 commit comments

Comments
 (0)