Skip to content

Commit

Permalink
Add error message in gather for missing SSH keys.
Browse files Browse the repository at this point in the history
Error message displays when gather command failed and no ssh keys were passed. The message recommends ensuring ssh keys were in keyring or specifying the key in a flag.
  • Loading branch information
patrickdillon committed Jul 17, 2019
1 parent e4c3adb commit 00307d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/openshift-install/gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ func runGatherBootstrapCmd(directory string) error {
func logGatherBootstrap(bootstrap string, port int, masters []string, directory string) error {
logrus.Info("Pulling debug logs from the bootstrap machine")
client, err := ssh.NewClient("core", fmt.Sprintf("%s:%d", bootstrap, port), gatherBootstrapOpts.sshKeys)
if err != nil {
if err != nil && len(gatherBootstrapOpts.sshKeys) == 0 {
return errors.Wrap(err, "failed to create SSH client, ensure the proper ssh key is in your keyring or specify with --key")
} else if err != nil {
return errors.Wrap(err, "failed to create SSH client")
}
if err := ssh.Run(client, fmt.Sprintf("/usr/local/bin/installer-gather.sh %s", strings.Join(masters, " "))); err != nil {
Expand Down

0 comments on commit 00307d1

Please sign in to comment.