mirror of https://github.com/docker/docs.git
Merge pull request #2501 from fsoppelsa/2478-sanitizekey
Sanitize keynames by replacing dots with underscores
This commit is contained in:
commit
760e814d43
|
|
@ -576,6 +576,7 @@ func (d *Driver) initNetwork() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) createSSHKey() error {
|
func (d *Driver) createSSHKey() error {
|
||||||
|
sanitizeKeyPairName(&d.KeyPairName)
|
||||||
log.WithField("Name", d.KeyPairName).Debug("Creating Key Pair...")
|
log.WithField("Name", d.KeyPairName).Debug("Creating Key Pair...")
|
||||||
if err := ssh.GenerateSSHKey(d.GetSSHKeyPath()); err != nil {
|
if err := ssh.GenerateSSHKey(d.GetSSHKeyPath()); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -685,3 +686,7 @@ func (d *Driver) lookForIPAddress() error {
|
||||||
func (d *Driver) publicSSHKeyPath() string {
|
func (d *Driver) publicSSHKeyPath() string {
|
||||||
return d.GetSSHKeyPath() + ".pub"
|
return d.GetSSHKeyPath() + ".pub"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sanitizeKeyPairName(s *string) {
|
||||||
|
*s = strings.Replace(*s, ".", "_", -1)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue