Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

fix golangci-lint check error #438

Merged
merged 2 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions pkg/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down