From ca7f7abb8e9fe022536b714be1c7f2b85733eda1 Mon Sep 17 00:00:00 2001 From: Vishal Thapar <5137689+vthapar@users.noreply.github.com> Date: Wed, 17 Mar 2021 02:58:12 +0530 Subject: [PATCH] Fix linting errors and address review comments Signed-off-by: Vishal Thapar <5137689+vthapar@users.noreply.github.com> --- pkg/subctl/cmd/gather.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/subctl/cmd/gather.go b/pkg/subctl/cmd/gather.go index c0d1d91b8..49687c30d 100644 --- a/pkg/subctl/cmd/gather.go +++ b/pkg/subctl/cmd/gather.go @@ -101,6 +101,8 @@ func gatherConnectivity(status *cli.Status, dataType string) error { status.QueueWarningMessage("Gather Connectivity Logs not implemented yet") case Resources: status.QueueWarningMessage("Gather Connectivity Resources not implemented yet") + default: + return fmt.Errorf("unsupported data type %s", dataType) } return nil } @@ -111,13 +113,20 @@ func gatherDiscovery(status *cli.Status, dataType string) error { status.QueueWarningMessage("Gather ServiceDiscovery Logs not implemented yet") case Resources: status.QueueWarningMessage("Gather ServiceDiscovery Resources not implemented yet") + default: + return fmt.Errorf("unsupported data type %s", dataType) } return nil } func gatherBroker(status *cli.Status, dataType string) error { - if dataType == Resources { + switch dataType { + case Logs: + status.QueueSuccessMessage("No logs to gather on Broker") + case Resources: status.QueueWarningMessage("Gather Broker Resources not implemented yet") + default: + return fmt.Errorf("unsupported data type %s", dataType) } return nil } @@ -128,6 +137,8 @@ func gatherOperator(status *cli.Status, dataType string) error { status.QueueWarningMessage("Gather Operator Logs not implemented yet") case Resources: status.QueueWarningMessage("Gather Operator Resources not implemented yet") + default: + return fmt.Errorf("unsupported data type %s", dataType) } return nil }