Unverified Commit 82481fad authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #75489 from neolit123/automated-cherry-pick-of-#75487-origin-release-1.14

Automated cherry pick of #75487: Restore machine readability to the print-join-command output
parents 5052da0e 6af50b95
...@@ -225,7 +225,7 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, c ...@@ -225,7 +225,7 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, c
return err return err
} }
// if --print-join-command was specified, print the full `kubeadm join` command // if --print-join-command was specified, print a machine-readable full `kubeadm join` command
// otherwise, just print the token // otherwise, just print the token
if printJoinCommand { if printJoinCommand {
skipTokenPrint := false skipTokenPrint := false
...@@ -233,6 +233,8 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, c ...@@ -233,6 +233,8 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, c
if err != nil { if err != nil {
return errors.Wrap(err, "failed to get join command") return errors.Wrap(err, "failed to get join command")
} }
joinCommand = strings.ReplaceAll(joinCommand, "\\\n", "")
joinCommand = strings.ReplaceAll(joinCommand, "\t", "")
fmt.Fprintln(out, joinCommand) fmt.Fprintln(out, joinCommand)
} else { } else {
fmt.Fprintln(out, internalcfg.BootstrapTokens[0].Token.String()) fmt.Fprintln(out, internalcfg.BootstrapTokens[0].Token.String())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment