mirror of https://github.com/kubernetes/kops.git
Merge pull request #7941 from prksu/fix-panic-when-ssh-key-not-exists-on-do
Fix panic when ssh key not exists on digitalocean
This commit is contained in:
commit
3ef957322e
|
|
@ -385,6 +385,10 @@ func (c *ApplyClusterCmd) Run() error {
|
|||
return fmt.Errorf("DigitalOcean support is currently (very) alpha and is feature-gated. export KOPS_FEATURE_FLAGS=AlphaAllowDO to enable it")
|
||||
}
|
||||
|
||||
if len(sshPublicKeys) == 0 && c.Cluster.Spec.SSHKeyName == "" {
|
||||
return fmt.Errorf("SSH public key must be specified when running with DigitalOcean (create with `kops create secret --name %s sshpublickey admin -i ~/.ssh/id_rsa.pub`)", cluster.ObjectMeta.Name)
|
||||
}
|
||||
|
||||
modelContext.SSHPublicKeys = sshPublicKeys
|
||||
|
||||
l.AddTypes(map[string]interface{}{
|
||||
|
|
|
|||
Loading…
Reference in New Issue