don't generate ssh key on existing cluster
@@ -243,7 +243,8 @@ func (a *Apiloader) LoadContainerServiceForAgentPoolOnlyCluster(
return nil, IsSSHAutoGenerated, e
}
- if managedCluster.Properties.LinuxProfile == nil {
+ // only generate ssh key on new cluster
+ if !hasExistingCS && managedCluster.Properties.LinuxProfile == nil {
linuxProfile := &v20180331.LinuxProfile{}
linuxProfile.AdminUsername = "azureuser"
_, publicKey, err := helpers.CreateSSH(rand.Reader, a.Translator)
