Skip to content

Commit 9f1afc4

Browse files
committed
Fix duplicate image_tag in local-spice-api example
Avoid replace on new resource in PlanModifyMap
1 parent fb43178 commit 9f1afc4

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

examples/local-spice-api/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ resource "spiceai_deployment" "test" {
4141
spicepod = spiceai_app.test.spicepod
4242
image_tag = spiceai_app.test.image_tag
4343
replicas = spiceai_app.test.replicas
44+
image_tag = spiceai_app.test.image_tag
4445
}
4546

4647
# Use app defaults

internal/provider/resource_deployment.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ func (m mapPlanModifierRequiresReplace) MarkdownDescription(ctx context.Context)
527527
}
528528

529529
func (m mapPlanModifierRequiresReplace) PlanModifyMap(ctx context.Context, req planmodifier.MapRequest, resp *planmodifier.MapResponse) {
530-
if req.StateValue.IsNull() {
530+
// If there's no state (new resource), don't require replace
531+
if req.State.Raw.IsNull() {
531532
return
532533
}
533534

0 commit comments

Comments
 (0)