Skip to content

Commit

Permalink
remove client side check
Browse files Browse the repository at this point in the history
  • Loading branch information
agutierrez8 committed Aug 23, 2023
1 parent 69dd909 commit f9e4133
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions internal/vm/vm_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,20 +341,6 @@ func (r *vmResource) Update(ctx context.Context, req resource.UpdateRequest, res
return
}

instance, err := getVM(ctx, r.client, state.ID.ValueString())
if err != nil {
resp.Diagnostics.AddError("Failed to find instance", "Could not find a matching VM instance.")

return
}

if instance.State != vmStateShutOff {
resp.Diagnostics.AddError("Instance is running",
"VMs must be stopped before attaching or detaching disks. Please stop the VM and try again.")

return
}

// attach/detach disks if requested
addedDisks, removedDisks := getDisksDiff(state.Disks, plan.Disks)
if len(addedDisks) > 0 {
Expand Down

0 comments on commit f9e4133

Please sign in to comment.