From 0ea44f4fc3635a30b8b845025a734e2d8751731d Mon Sep 17 00:00:00 2001 From: Bryce Soghigian <49734722+Bryce-Soghigian@users.noreply.github.com> Date: Tue, 28 Jan 2025 03:57:12 +0000 Subject: [PATCH] refactor: using deleteIfNicExists directly in cleanupAzureResources --- pkg/providers/instance/instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index 4cec2b34a..b8c2fb77f 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -671,7 +671,7 @@ func (p *DefaultProvider) cleanupAzureResources(ctx context.Context, resourceNam // nic, disk and all associated resources will be removed. If the VM was not created successfully and a nic was found, // then we attempt to delete the nic. - nicErr := p.DeleteNic(ctx, resourceName) + nicErr := deleteNicIfExists(ctx, p.azClient.networkInterfacesClient, p.resourceGroup, resourceName) if nicErr != nil { logging.FromContext(ctx).Errorf("networkinterface.Delete for %s failed: %v", resourceName, nicErr) }