X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/24a1cdaa5b5a3a98b47ab6802d00e7c4d2a848df..aab9cf1b5d30c5e49152bff09dc1ee18d38973dc:/lib/cloud/azure/azure.go diff --git a/lib/cloud/azure/azure.go b/lib/cloud/azure/azure.go index 7b170958b6..494db854ed 100644 --- a/lib/cloud/azure/azure.go +++ b/lib/cloud/azure/azure.go @@ -514,20 +514,23 @@ func (az *azureInstanceSet) Create( AdminUsername: to.StringPtr(az.azconfig.AdminUsername), LinuxConfiguration: &compute.LinuxConfiguration{ DisablePasswordAuthentication: to.BoolPtr(true), - SSH: &compute.SSHConfiguration{ - PublicKeys: &[]compute.SSHPublicKey{ - { - Path: to.StringPtr("/home/" + az.azconfig.AdminUsername + "/.ssh/authorized_keys"), - KeyData: to.StringPtr(string(ssh.MarshalAuthorizedKey(publicKey))), - }, - }, - }, }, CustomData: &customData, }, }, } + if publicKey != nil { + vmParameters.VirtualMachineProperties.OsProfile.LinuxConfiguration.SSH = &compute.SSHConfiguration{ + PublicKeys: &[]compute.SSHPublicKey{ + { + Path: to.StringPtr("/home/" + az.azconfig.AdminUsername + "/.ssh/authorized_keys"), + KeyData: to.StringPtr(string(ssh.MarshalAuthorizedKey(publicKey))), + }, + }, + } + } + if instanceType.Preemptible { // Setting maxPrice to -1 is the equivalent of paying spot price, up to the // normal price. This means the node will not be pre-empted for price