Skip to content

Commit 9e07443

Browse files
authored
fix: ensure consistent chart state when ignore_errors=true and deployment fails (#385)
Signed-off-by: elizadimarco <eliza.dimarco@chainguard.dev>
1 parent 50b9451 commit 9e07443

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

internal/provider/resource_deployment.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,7 @@ func (r *deploymentResource) Create(ctx context.Context, req resource.CreateRequ
130130
"Deployment Creation Failed",
131131
fmt.Sprintf("Failed to create deployment for repo %q: %v. Continuing due to ignore_errors=true.", plan.ID.ValueString(), err),
132132
)
133-
// Set empty state to indicate deployment wasn't created
134-
plan.Charts = types.ListNull(types.ObjectType{
135-
AttrTypes: map[string]attr.Type{
136-
"source": types.StringType,
137-
"repo": types.StringType,
138-
},
139-
})
133+
// Keep the planned charts in state for consistency between plan and apply
140134
resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...)
141135
return
142136
}

0 commit comments

Comments
 (0)