1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

fix ssh key gen bug windows

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett
2015-04-10 10:35:25 -04:00
parent dfa155938a
commit 7f55d3ba01

View File

@@ -11,6 +11,7 @@ import (
"fmt"
"io"
"os"
"runtime"
gossh "golang.org/x/crypto/ssh"
)
@@ -79,8 +80,12 @@ func (kp *KeyPair) WriteToFile(privateKeyPath string, publicKeyPath string) erro
return ErrUnableToWriteFile
}
if err := f.Chmod(0600); err != nil {
return err
// windows does not support chmod
switch runtime.GOOS {
case "darwin", "linux":
if err := f.Chmod(0600); err != nil {
return err
}
}
}