From 980de9d38b5e61b674c21e9e20313510006b100f Mon Sep 17 00:00:00 2001 From: aaa <1693291525@qq.com> Date: Wed, 10 Apr 2019 03:17:40 -0400 Subject: [PATCH] Use fmt.printf() to end with a newline update pull request --- cmd/kubeadm/app/cmd/phases/workflow/doc_test.go | 6 +++--- cmd/kubeadm/app/phases/upgrade/postupgrade.go | 2 +- cmd/kubeadm/app/util/arguments.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/kubeadm/app/cmd/phases/workflow/doc_test.go b/cmd/kubeadm/app/cmd/phases/workflow/doc_test.go index 88123c4f1f..894e7cd0af 100644 --- a/cmd/kubeadm/app/cmd/phases/workflow/doc_test.go +++ b/cmd/kubeadm/app/cmd/phases/workflow/doc_test.go @@ -50,7 +50,7 @@ func ExamplePhase() { } // implement your phase logic... - fmt.Printf("%v", d.Data()) + fmt.Printf("%v\n", d.Data()) return nil }, } @@ -67,7 +67,7 @@ func ExamplePhase() { } // implement your phase logic... - fmt.Printf("%v", d.Data()) + fmt.Printf("%v\n", d.Data()) return nil }, } @@ -91,7 +91,7 @@ func ExampleRunner_Run() { } // implement your phase logic... - fmt.Printf("%v", d.Data()) + fmt.Printf("%v\n", d.Data()) return nil }, } diff --git a/cmd/kubeadm/app/phases/upgrade/postupgrade.go b/cmd/kubeadm/app/phases/upgrade/postupgrade.go index ca1e51ad59..d8ffb23a65 100644 --- a/cmd/kubeadm/app/phases/upgrade/postupgrade.go +++ b/cmd/kubeadm/app/phases/upgrade/postupgrade.go @@ -174,7 +174,7 @@ func BackupAPIServerCertIfNeeded(cfg *kubeadmapi.InitConfiguration, dryRun bool) // Don't fail the upgrade phase if failing to backup kube-apiserver cert and key, just continue rotating the cert // TODO: We might want to reconsider this choice. if err := backupAPIServerCertAndKey(certAndKeyDir); err != nil { - fmt.Printf("[postupgrade] WARNING: failed to backup kube-apiserver cert and key: %v", err) + fmt.Printf("[postupgrade] WARNING: failed to backup kube-apiserver cert and key: %v\n", err) } return certsphase.CreateCertAndKeyFilesWithCA( &certsphase.KubeadmCertAPIServer, diff --git a/cmd/kubeadm/app/util/arguments.go b/cmd/kubeadm/app/util/arguments.go index afba856c42..7f88b471a2 100644 --- a/cmd/kubeadm/app/util/arguments.go +++ b/cmd/kubeadm/app/util/arguments.go @@ -63,7 +63,7 @@ func ParseArgumentListToMap(arguments []string) map[string]string { // Warn in all other cases, but don't error out. This can happen only if the user has edited the argument list by hand, so they might know what they are doing if err != nil { if i != 0 { - fmt.Printf("[kubeadm] WARNING: The component argument %q could not be parsed correctly. The argument must be of the form %q. Skipping...", arg, "--") + fmt.Printf("[kubeadm] WARNING: The component argument %q could not be parsed correctly. The argument must be of the form %q. Skipping...\n", arg, "--") } continue }