Skip to content

Commit

Permalink
Change streaming behaviour when joining nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Feb 28, 2023
1 parent 92c9c3a commit 7dc8d01
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,23 @@ func MakeJoin() *cobra.Command {
fmt.Printf("ssh: %s\n", getTokenCommand)
}

res, err := sshOperator.Execute(getTokenCommand)
streamToStdio := false
res, err := sshOperator.ExecuteStdio(getTokenCommand, streamToStdio)

if err != nil {
return errors.Wrap(err, "unable to get join-token from server")
}

if len(res.StdErr) > 0 {
fmt.Printf("Logs: %s", res.StdErr)
fmt.Printf("Error or warning getting node-token: %s\n", res.StdErr)
} else {
fmt.Printf("Received node-token from %s.. ok.\n", serverHost)
}

if closeSSHAgent != nil {
closeSSHAgent()
}

sshOperator.Close()

joinToken := string(res.StdOut)
Expand Down

0 comments on commit 7dc8d01

Please sign in to comment.