threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

🐞 [Bug]: Deleting a VM with IPv4 interface linked to a domain will not remove the associated name and gateway contracts #3485

Open sameh-farouk opened 2 weeks ago

sameh-farouk commented 2 weeks ago

Is there an existing issue for this?

which package/s did you face the problem with?

Dashboard, grid_client

What happened?

When I click the actions button next to a VM and link a domain with an IP reserved by the VM, then proceed to delete the VM, the client leaves the name contract and gateway workload that were supposedly routing traffic to the now-removed VM.

Steps To Reproduce

  1. go to https://staging.dashboard.dev.grid.tf/#/deploy/virtual-machines/full-virtual-machine/
  2. Deploy a VM with IPv4 address
  3. Add a new domain. Make sure to pick the IPv4 interface
  4. Verify that the name contract and the gateway contract were successfully created.
  5. Select the VM, from the full-virtual-machine page, and delete it.
  6. revisit the contracts page and verify that the name contract and gateway's node contract are left behind.

which network/s did you face the problem on?

Dev

version

NA

Twin ID/s

No response

Node ID/s

No response

Farm ID/s

No response

Contract ID/s

No response

Relevant screenshots/screen records

Screenshot_20240930_164118

I tried that twice, and here is the result

Screenshot_20240930_164735

Relevant log output

NA
maayarosama commented 2 weeks ago

This might happen because we check if the backends in the gateway is wiregaurd ip connected to the vm. In this case the solution need to check on all network interfaces https://github.com/threefoldtech/tfgrid-sdk-ts/blob/205fd89574b83e7651aeac91d69592a130c5cf8a/packages/playground/src/utils/delete_deployment.ts#L122

0oM4R commented 3 days ago

work completed : add a function that pass all ips to the delete function and edit the filtration prop

WIP: some gws on interfaces like ipv4 didn't got listed checking..