Skip to content

Commit

Permalink
clear mutable attributes in resource Read() method of integer-style…
Browse files Browse the repository at this point in the history
… resource pools
  • Loading branch information
chrismarget-j committed Jul 30, 2024
1 parent 4ea21dd commit e681907
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apstra/resource_asn_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ func (o *resourceAsnPool) Read(ctx context.Context, req resource.ReadRequest, re
return
}

newState.SetMutablesToNull(ctx, &resp.Diagnostics)
if resp.Diagnostics.HasError() {
return
}

// set state
resp.Diagnostics.Append(resp.State.Set(ctx, &newState)...)
}
Expand Down
5 changes: 5 additions & 0 deletions apstra/resource_integer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ func (o *resourceIntegerPool) Read(ctx context.Context, req resource.ReadRequest
return
}

newState.SetMutablesToNull(ctx, &resp.Diagnostics)
if resp.Diagnostics.HasError() {
return
}

// set state
resp.Diagnostics.Append(resp.State.Set(ctx, &newState)...)
}
Expand Down
5 changes: 5 additions & 0 deletions apstra/resource_vni_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ func (o *resourceVniPool) Read(ctx context.Context, req resource.ReadRequest, re
return
}

newState.SetMutablesToNull(ctx, &resp.Diagnostics)
if resp.Diagnostics.HasError() {
return
}

// set state
resp.Diagnostics.Append(resp.State.Set(ctx, &newState)...)
}
Expand Down

0 comments on commit e681907

Please sign in to comment.