Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
clear allocations plan beforehand
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiggi33 committed Aug 19, 2024
1 parent 4af57a0 commit 140606c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/provider/node_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ func (r *nodeResource) Create(ctx context.Context, req resource.CreateRequest, r
plan.CreatedAt = types.StringValue(node.CreatedAt.Format(time.RFC3339))
plan.UpdatedAt = types.StringValue(node.UpdatedAt.Format(time.RFC3339))

plan.Allocations = make([]Allocation, len(nodeAllocations))

for _, allocation := range nodeAllocations {
plan.Allocations = append(plan.Allocations, Allocation{
ID: types.Int32Value(allocation.ID),
Expand Down Expand Up @@ -489,6 +491,8 @@ func (r *nodeResource) Update(ctx context.Context, req resource.UpdateRequest, r
plan.CreatedAt = types.StringValue(node.CreatedAt.Format(time.RFC3339))
plan.UpdatedAt = types.StringValue(node.UpdatedAt.Format(time.RFC3339))

plan.Allocations = make([]Allocation, len(nodeAllocations))

for _, allocation := range nodeAllocations {
plan.Allocations = append(plan.Allocations, Allocation{
ID: types.Int32Value(allocation.ID),
Expand Down

0 comments on commit 140606c

Please sign in to comment.