Skip to content

Commit

Permalink
Write hypervisor cluster state earlier
Browse files Browse the repository at this point in the history
Ensure we write the state for a hypervisor cluster create
as soon as possible. This helps avoid the situation where
a hypervisor cluster was created but the id is not captured
in the terraform state file.
  • Loading branch information
stuart-mclaren-hpe committed Nov 18, 2024
1 parent f203f27 commit 2f59c42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/resources/hypervisorcluster/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ func (r *Resource) Create(
}

doCreate(ctx, *r.client, &data, &resp.Diagnostics)
// Write state to capture the id
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
if resp.Diagnostics.HasError() {
return
}
Expand Down

0 comments on commit 2f59c42

Please sign in to comment.