confidential-containers / cloud-api-adaptor

Ability to create Kata pods using cloud provider APIs aka the peer-pods approach
Apache License 2.0
47 stars 79 forks source link

azure: Delete network interface synchronously #1854

Closed kartikjoshi21 closed 2 months ago

kartikjoshi21 commented 3 months ago

Delete network interface synchronously if vm creation is failed

Fixes: #1842

kartikjoshi21 commented 3 months ago

there was a reason for turning this function into an async function (you can check git blame to verify), I think it also had to do with accidental resource leakage.

So we might have to have both: async delete for normal podvm termination, sync delete for cleanups after failed creation.

pkg/azure: Delete NIC in background

Due to NIC reservation error, we may need to retry/wait 180s to delete the NIC
when VM creation fails.