From 080f05c071b167e7b211e8d382dc3a009d749d8e Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Thu, 11 Jul 2024 16:21:39 +0300 Subject: [PATCH] fix: remove duplicated param Signed-off-by: Vladislav Sukhin --- .../commands/tests/renderer/test_obj.go | 2 -- cmd/kubectl-testkube/commands/tests/run.go | 12 +++--------- .../commands/testsuites/renderer/testsuite_obj.go | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/cmd/kubectl-testkube/commands/tests/renderer/test_obj.go b/cmd/kubectl-testkube/commands/tests/renderer/test_obj.go index 4da43ad066b..33f6a88aa11 100644 --- a/cmd/kubectl-testkube/commands/tests/renderer/test_obj.go +++ b/cmd/kubectl-testkube/commands/tests/renderer/test_obj.go @@ -278,8 +278,6 @@ func TestRenderer(client client.Client, ui *ui.UI, obj interface{}) error { ui.NL() ui.Warn(" Variable secrets: ", variableSecrets...) } - - ui.Warn(" Disable webhooks: ", fmt.Sprint(test.ExecutionRequest.DisableWebhooks)) } return nil diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index 3343cb32e90..15f9f97ea52 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -83,6 +83,7 @@ func NewRunTestCmd() *cobra.Command { executionNamespace string attachDebugger bool debugFile string + disableWebhooks bool ) cmd := &cobra.Command{ @@ -150,13 +151,7 @@ func NewRunTestCmd() *cobra.Command { ExecutePostRunScriptBeforeScraping: executePostRunScriptBeforeScraping, SourceScripts: sourceScripts, ExecutionNamespace: executionNamespace, - } - - if cmd.Flag("enable-webhooks").Changed { - options.DisableWebhooks = false - } - if cmd.Flag("disable-webhooks").Changed { - options.DisableWebhooks = true + DisableWebhooks: disableWebhooks, } var fields = []struct { @@ -480,8 +475,7 @@ func NewRunTestCmd() *cobra.Command { cmd.Flags().StringVar(&executionNamespace, "execution-namespace", "", "namespace for test execution (Pro edition only)") cmd.Flags().StringVar(&debugFile, "debugger-file", "", "store debug info into file, stdout by default") cmd.Flags().BoolVar(&attachDebugger, "attach-debugger", false, "attach simple debugger for job, need KUBECONFIG for the agent to be active") - cmd.Flags().Bool("disable-webhooks", false, "disable webhooks") - cmd.Flags().Bool("enable-webhooks", false, "enable webhooks") + cmd.Flags().BoolVar(&disableWebhooks, "disable-webhooks", false, "disable webhooks") return cmd } diff --git a/cmd/kubectl-testkube/commands/testsuites/renderer/testsuite_obj.go b/cmd/kubectl-testkube/commands/testsuites/renderer/testsuite_obj.go index ecfe25f63e1..3a4926f6ef7 100644 --- a/cmd/kubectl-testkube/commands/testsuites/renderer/testsuite_obj.go +++ b/cmd/kubectl-testkube/commands/testsuites/renderer/testsuite_obj.go @@ -80,7 +80,6 @@ func TestSuiteRenderer(client client.Client, ui *ui.UI, obj interface{}) error { if ts.ExecutionRequest.PvcTemplateReference != "" { ui.Warn(" PVC template reference: ", ts.ExecutionRequest.PvcTemplateReference) } - ui.Warn(" Disable webhooks: ", fmt.Sprint(ts.ExecutionRequest.DisableWebhooks)) } batches := append(ts.Before, ts.Steps...)