diff --git a/pkg/blockdevice/blockdevice.go b/pkg/blockdevice/blockdevice.go index f7c99de4..0091308d 100644 --- a/pkg/blockdevice/blockdevice.go +++ b/pkg/blockdevice/blockdevice.go @@ -88,7 +88,7 @@ func createTreeByNode(k *client.K8sClient, bdNames []string) error { rows = append(rows, metav1.TableRow{Cells: []interface{}{"", "", "", "", "", "", ""}}) } if len(rows) == 0 { - util.HandleEmptyTableError("Block Device", k.Ns, "") + return util.HandleEmptyTableError("Block Device", k.Ns, "") } else { // Show the output using cli-runtime util.TablePrinter(util.BDTreeListColumnDefinations, rows, printers.PrintOptions{Wide: true}) diff --git a/pkg/util/error_test.go b/pkg/util/error_test.go index c7dfe516..7f44b965 100644 --- a/pkg/util/error_test.go +++ b/pkg/util/error_test.go @@ -103,7 +103,7 @@ func TestHandleEmptyTableError(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - HandleEmptyTableError(tt.args.resource, tt.args.ns, tt.args.casType) + _ = HandleEmptyTableError(tt.args.resource, tt.args.ns, tt.args.casType) }) } }