From e907ab821265910b203c8cbf0eece7a31300cda5 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Thu, 14 Nov 2024 20:05:15 +0300 Subject: [PATCH] fix: check for empty name and selector Signed-off-by: Vladislav Sukhin --- cmd/tcl/testworkflow-toolkit/commands/execute.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/tcl/testworkflow-toolkit/commands/execute.go b/cmd/tcl/testworkflow-toolkit/commands/execute.go index fa691b9a6e9..ce47f57f83b 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/execute.go +++ b/cmd/tcl/testworkflow-toolkit/commands/execute.go @@ -378,6 +378,10 @@ func NewExecuteCmd() *cobra.Command { ui.Fail(errors.Wrap(err, "unmarshal workflow definition")) } + if w.Name == "" && w.Selector == nil { + ui.Fail(errors.New("either workflow name or selector should be specified")) + } + var testWorkflowNames []string if w.Name != "" { testWorkflowNames = []string{w.Name}