From 1571a5aa07c83bdef5cd6430dac8cb71b68e45d2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 16 Aug 2023 12:33:04 +0200 Subject: [PATCH] ctr: metrics: drop unused retval from printWindowsStats() The error return value is always nil, so we don't need it at all. Signed-off-by: Enrico Weigelt, metux IT consult --- cmd/ctr/commands/tasks/metrics.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/ctr/commands/tasks/metrics.go b/cmd/ctr/commands/tasks/metrics.go index 07facbaa5..ac6a0e45b 100644 --- a/cmd/ctr/commands/tasks/metrics.go +++ b/cmd/ctr/commands/tasks/metrics.go @@ -94,9 +94,7 @@ var metricsCommand = cli.Command{ case *v2.Metrics: printCgroup2MetricsTable(w, v) case *wstats.Statistics: - if err := printWindowsStats(w, v); err != nil { - return fmt.Errorf("cannot convert metrics data from windows.Statistics: %w", err) - } + printWindowsStats(w, v) } return w.Flush() case formatJSON: @@ -151,7 +149,7 @@ func printCgroup2MetricsTable(w *tabwriter.Writer, data *v2.Metrics) { } } -func printWindowsStats(w *tabwriter.Writer, windowsStats *wstats.Statistics) error { +func printWindowsStats(w *tabwriter.Writer, windowsStats *wstats.Statistics) { if windowsStats.GetLinux() != nil { stats := windowsStats.GetLinux() printCgroupMetricsTable(w, stats) @@ -162,7 +160,6 @@ func printWindowsStats(w *tabwriter.Writer, windowsStats *wstats.Statistics) err if windowsStats.VM != nil { printWindowsVMStatistics(w, windowsStats.VM) } - return nil } func printWindowsContainerStatistics(w *tabwriter.Writer, stats *wstats.WindowsContainerStatistics) {