Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions src/cloud-providers/azure/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,29 +544,26 @@ func (p *azureProvider) getVMParameters(instanceSize, diskName, cloudConfig stri
if len(userDataB64) > 64*1024 {
return nil, fmt.Errorf("base64 encoded userData is greater than 64KB")
}
var managedDiskParams *armcompute.ManagedDiskParameters
var securityProfile *armcompute.SecurityProfile
if !p.serviceConfig.DisableCVM {
managedDiskParams = &armcompute.ManagedDiskParameters{
StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS),
SecurityProfile: &armcompute.VMDiskSecurityProfile{
SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly),
},
}

securityProfile = &armcompute.SecurityProfile{
SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM),
UefiSettings: &armcompute.UefiSettings{
SecureBootEnabled: to.Ptr(p.serviceConfig.EnableSecureBoot),
VTpmEnabled: to.Ptr(true),
},
}
} else {
managedDiskParams = &armcompute.ManagedDiskParameters{
StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS),
securityType := armcompute.SecurityTypesTrustedLaunch
managedDiskParams := &armcompute.ManagedDiskParameters{
StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS),
}

if !p.serviceConfig.DisableCVM {
securityType = armcompute.SecurityTypesConfidentialVM
managedDiskParams.SecurityProfile = &armcompute.VMDiskSecurityProfile{
SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly),
}
}

securityProfile = nil
securityProfile = &armcompute.SecurityProfile{
SecurityType: to.Ptr(securityType),
UefiSettings: &armcompute.UefiSettings{
SecureBootEnabled: to.Ptr(p.serviceConfig.EnableSecureBoot),
VTpmEnabled: to.Ptr(true),
},
}

imgRef := &armcompute.ImageReference{
Expand Down
Loading