mirror of https://github.com/kubernetes/kops.git
Fix panic when ssh key not exists on digitalocean
This commit is contained in:
parent
644df24b6f
commit
cc3f8aa88d
|
|
@ -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