Merge pull request #75487 from displague/machine-readable-kubeadm-join

Restore machine readability to the print-join-command output
k3s-v1.15.3
Kubernetes Prow Robot 2019-03-19 16:10:21 -07:00 committed by GitHub
commit e6272b887b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -225,7 +225,7 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, c
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
if printJoinCommand {
skipTokenPrint := false
@ -233,6 +233,8 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, c
if err != nil {
return errors.Wrap(err, "failed to get join command")
}
joinCommand = strings.ReplaceAll(joinCommand, "\\\n", "")
joinCommand = strings.ReplaceAll(joinCommand, "\t", "")
fmt.Fprintln(out, joinCommand)
} else {
fmt.Fprintln(out, internalcfg.BootstrapTokens[0].Token.String())