diff --git a/pkg/cmd/get.go b/pkg/cmd/get.go index 0f796da13..2718ff11c 100644 --- a/pkg/cmd/get.go +++ b/pkg/cmd/get.go @@ -164,7 +164,7 @@ func getGarden(name string, configReader ConfigReader, targetReader TargetReader return err } if outputFormat == "yaml" { - fmt.Fprint(ioStreams.Out, fmt.Sprintf("%s\n", kubeconfig)) + fmt.Fprintf(ioStreams.Out, "%s\n", kubeconfig) } else if outputFormat == "json" { y, err := yaml2.YAMLToJSON(kubeconfig) if err != nil { @@ -215,7 +215,7 @@ func getSeed(name string, targetReader TargetReader, ioStreams IOStreams) error return err } if outputFormat == "yaml" { - fmt.Fprint(ioStreams.Out, fmt.Sprintf("%s\n", kubeSecret.Data["kubeconfig"])) + fmt.Fprintf(ioStreams.Out, "%s\n", kubeSecret.Data["kubeconfig"]) } else if outputFormat == "json" { y, err := yaml2.YAMLToJSON(kubeSecret.Data["kubeconfig"]) if err != nil { @@ -315,7 +315,7 @@ func getShoot(name string, targetReader TargetReader, kubeconfigWriter Kubeconfi return err } if outputFormat == "yaml" { - fmt.Fprint(ioStreams.Out, fmt.Sprintf("%s\n", kubeSecret.Data["kubeconfig"])) + fmt.Fprintf(ioStreams.Out, "%s\n", kubeSecret.Data["kubeconfig"]) } else if outputFormat == "json" { y, err := yaml2.YAMLToJSON(kubeSecret.Data["kubeconfig"]) if err != nil { diff --git a/pkg/cmd/info.go b/pkg/cmd/info.go index f79cfd073..34e0d8302 100644 --- a/pkg/cmd/info.go +++ b/pkg/cmd/info.go @@ -77,15 +77,15 @@ func NewInfoCmd(targetReader TargetReader, ioStreams IOStreams) *cobra.Command { fmt.Fprintf(ioStreams.Out, "Garden: %s\n", targetStack[0].Name) w := tabwriter.NewWriter(ioStreams.Out, 6, 0, 20, ' ', 0) - fmt.Fprintln(w, fmt.Sprintf("%s\t%s\t%s\t%s", "Seed", "Total", "Active", "Hibernated")) - fmt.Fprintln(w, fmt.Sprintf("%s\t%s\t%s\t%s", "----", "-----", "------", "----------")) + fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", "Seed", "Total", "Active", "Hibernated") + fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", "----", "-----", "------", "----------") for _, seed := range sortedSeeds { - fmt.Fprintln(w, fmt.Sprintf("%s\t%d\t%d\t%d", seed, totalShootsCountPerSeed[seed], totalShootsCountPerSeed[seed]-hibernatedShootsCountPerSeed[seed], hibernatedShootsCountPerSeed[seed])) + fmt.Fprintf(w, "%s\t%d\t%d\t%d\n", seed, totalShootsCountPerSeed[seed], totalShootsCountPerSeed[seed]-hibernatedShootsCountPerSeed[seed], hibernatedShootsCountPerSeed[seed]) } - fmt.Fprintln(w, fmt.Sprintf("%s\t%s\t%s\t%s", "----", "-----", "------", "----------")) - fmt.Fprintln(w, fmt.Sprintf("%s\t%d\t%d\t%d", "TOTAL", len(shootList.Items), len(shootList.Items)-hibernatedShootsCount-unscheduled, hibernatedShootsCount)) - fmt.Fprintln(w, fmt.Sprintf("%s\t%d", "Unscheduled", unscheduled)) + fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", "----", "-----", "------", "----------") + fmt.Fprintf(w, "%s\t%d\t%d\t%d\n", "TOTAL", len(shootList.Items), len(shootList.Items)-hibernatedShootsCount-unscheduled, hibernatedShootsCount) + fmt.Fprintf(w, "%s\t%d\n", "Unscheduled", unscheduled) fmt.Fprintln(w) w.Flush() diff --git a/pkg/cmd/logs.go b/pkg/cmd/logs.go index 57e5adca0..d7764b11f 100644 --- a/pkg/cmd/logs.go +++ b/pkg/cmd/logs.go @@ -99,7 +99,7 @@ func validateFlags(flags *logFlags) { fmt.Println("Incorrect value for flag: --tail, value must be greater 0") os.Exit(2) } else if flags.loki && flags.tail > maxLokiLogs { - fmt.Println(fmt.Sprintf("Maximum number of logs that can be fetched from loki is %d", maxLokiLogs)) + fmt.Printf("Maximum number of logs that can be fetched from loki is %d", maxLokiLogs) os.Exit(2) } } diff --git a/pkg/cmd/ssh.go b/pkg/cmd/ssh.go index e0862e7da..ff51254da 100644 --- a/pkg/cmd/ssh.go +++ b/pkg/cmd/ssh.go @@ -125,7 +125,7 @@ func printNodeNames(shootName string) error { fmt.Println("Nodes:") for _, machine := range machineList.Items { - fmt.Println(fmt.Sprintf("%s (%s)", machine.Status.Node, string(machine.Status.CurrentStatus.Phase))) + fmt.Printf("%s (%s)", machine.Status.Node, string(machine.Status.CurrentStatus.Phase)) } return nil