Skip to content

Commit

Permalink
Merge pull request #135 from rishabh-11/master
Browse files Browse the repository at this point in the history
Add logs for successful deletion of NIC, Disk and VM
  • Loading branch information
unmarshall authored Mar 1, 2024
2 parents 1d9430c + 5a60e1e commit a2ae616
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/azure/access/helpers/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package helpers

import (
"context"
"k8s.io/klog/v2"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
Expand Down Expand Up @@ -44,5 +45,6 @@ func DeleteDisk(ctx context.Context, client *armcompute.DisksClient, resourceGro
if err != nil {
errors.LogAzAPIError(err, "Polling failed while waiting for Deleting for [resourceGroup: %s, Name: %s]", diskName, resourceGroup)
}
klog.Infof("Successfully deleted Disk: %s, for ResourceGroup: %s", diskName, resourceGroup)
return
}
2 changes: 2 additions & 0 deletions pkg/azure/access/helpers/nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package helpers

import (
"context"
"k8s.io/klog/v2"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
Expand Down Expand Up @@ -55,6 +56,7 @@ func DeleteNIC(ctx context.Context, client *armnetwork.InterfacesClient, resourc
if err != nil {
errors.LogAzAPIError(err, "Polling failed while waiting for Deleting of NIC [ResourceGroup: %s, Name: %s]", resourceGroup, nicName)
}
klog.Infof("Successfully deleted NIC: %s, for ResourceGroup: %s", nicName, resourceGroup)
return
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/azure/access/helpers/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package helpers

import (
"context"
"k8s.io/klog/v2"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
Expand Down Expand Up @@ -76,6 +77,7 @@ func DeleteVirtualMachine(ctx context.Context, vmAccess *armcompute.VirtualMachi
errors.LogAzAPIError(err, "Polling failed while waiting for delete of VM: %s for ResourceGroup: %s", vmName, resourceGroup)
return
}
klog.Infof("Successfully deleted VM: %s, for ResourceGroup: %s", vmName, resourceGroup)
return
}

Expand Down

0 comments on commit a2ae616

Please sign in to comment.