Skip to content

Commit

Permalink
Increase vm delete timeout to 300s
Browse files Browse the repository at this point in the history
  • Loading branch information
futuretea authored and guangbochen committed Sep 26, 2021
1 parent 1109fc3 commit 47e9fb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/provider/virtualmachine/resource_virtualmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import (
"github.com/harvester/terraform-provider-harvester/pkg/importer"
)

const (
vmDeleteTimeout = 300
)

func ResourceVirtualMachine() *schema.Resource {
return &schema.Resource{
CreateContext: resourceVirtualMachineCreate,
Expand Down Expand Up @@ -140,7 +144,7 @@ func resourceVirtualMachineDelete(ctx context.Context, d *schema.ResourceData, m
if err = c.HarvesterClient.KubevirtV1().VirtualMachines(namespace).Delete(ctx, name, deleteOptions); err != nil && !apierrors.IsNotFound(err) {
return diag.FromErr(err)
}
timeoutSeconds := int64(15)
timeoutSeconds := int64(vmDeleteTimeout)
events, err := c.HarvesterClient.KubevirtV1().VirtualMachines(namespace).Watch(ctx, metav1.ListOptions{
FieldSelector: fmt.Sprintf("metadata.name=%s", name),
Watch: true,
Expand Down

0 comments on commit 47e9fb5

Please sign in to comment.