gardener / machine-controller-manager-provider-azure

This repository is the out of tree implementation of the machine driver for Azure cloud provider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix OS Disk name

unmarshall opened this issue · comments

What happened:
The new code broke the naming convention with which OS Disks are created. In the case the VM is created with cascade delete set for OS Disk this will not be an issue. Since the cleanup of OS Disk will also happen when the VM is deleted. However, in case there is an older VM which does not have a cascade delete policy set for OS Disk and assume that the VM no longer exists. In that case when the new code attempts to delete the left over NICs and Disks (OS and Data disks) then it will delete everything except OS Disk due to bug in the way OS Disk name is created. There is an extra hyphen in the name that gets added.

What you expected to happen:
The OS Disk name should be correctly created

How to reproduce it (as minimally and precisely as possible):
Create a machine, delete the VM using az cli or azure portal and then delete the machine.