Skip to content

Commit 8bd01f9

Browse files
committed
azure: Support control plane disk encryption
Adding disk encryption set to control plane machines if provided by the user to encrypt the disk.
1 parent a6f102c commit 8bd01f9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/asset/machines/azure/azuremachines.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
8888
additionalCapabilities := &capz.AdditionalCapabilities{
8989
UltraSSDEnabled: &ultrassd,
9090
}
91+
if pool.Platform.Azure.DiskEncryptionSet != nil {
92+
osDisk.ManagedDisk.DiskEncryptionSet = &capz.DiskEncryptionSetParameters{
93+
ID: mpool.OSDisk.DiskEncryptionSet.ToID(),
94+
}
95+
}
9196

9297
machineProfile := generateSecurityProfile(mpool)
9398
securityProfile := &capz.SecurityProfile{
@@ -161,6 +166,7 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
161166
})
162167
}
163168

169+
osDisk.ManagedDisk.DiskEncryptionSet = nil
164170
bootstrapAzureMachine := &capz.AzureMachine{
165171
ObjectMeta: metav1.ObjectMeta{
166172
Name: capiutils.GenerateBoostrapMachineName(clusterID),

0 commit comments

Comments
 (0)