Skip to content

Commit b00d7f5

Browse files
committed
Refactoring to clean up naming and comments
1 parent 9efd7fe commit b00d7f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/cloud/instance.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (c *client) GetOrCreateVMInstance(
274274
func (c *client) DestroyVMInstance(csMachine *infrav1.CloudStackMachine) error {
275275
// Attempt deletion regardless of machine state.
276276
p := c.csAsync.VirtualMachine.NewDestroyVirtualMachineParams(*csMachine.Spec.InstanceID)
277-
volIDs, err := c.listVMInstanceVolumeIDs(*csMachine.Spec.InstanceID)
277+
volIDs, err := c.listVMInstanceDatadiskVolumeIDs(*csMachine.Spec.InstanceID)
278278
if err != nil {
279279
return err
280280
}
@@ -303,9 +303,10 @@ func (c *client) DestroyVMInstance(csMachine *infrav1.CloudStackMachine) error {
303303
return errors.New("VM deletion in progress")
304304
}
305305

306-
func (c *client) listVMInstanceVolumeIDs(instanceID string) ([]string, error) {
306+
func (c *client) listVMInstanceDatadiskVolumeIDs(instanceID string) ([]string, error) {
307307
p := c.cs.Volume.NewListVolumesParams()
308308
p.SetVirtualmachineid(instanceID)
309+
// VM root volumes are destroyed automatically, no need to explicitly include
309310
p.SetType("DATADISK")
310311

311312
listVOLResp, err := c.csAsync.Volume.ListVolumes(p)

0 commit comments

Comments
 (0)