diff --git a/cmd/kubectl-testkube/commands/common/flags.go b/cmd/kubectl-testkube/commands/common/flags.go index 0363c96d009..d4fa0764983 100644 --- a/cmd/kubectl-testkube/commands/common/flags.go +++ b/cmd/kubectl-testkube/commands/common/flags.go @@ -185,10 +185,6 @@ func ProcessMasterFlags(cmd *cobra.Command, opts *HelmOptions, cfg *config.Data) } -func IsBothEnabledAndDisabledSet(cmd *cobra.Command) bool { - return cmd.Flag("enable-webhooks").Changed && cmd.Flag("disable-webhooks").Changed -} - // CommaList is a custom flag type for features type CommaList []string diff --git a/cmd/kubectl-testkube/commands/tests/common.go b/cmd/kubectl-testkube/commands/tests/common.go index e436977e09f..ed136379aa8 100644 --- a/cmd/kubectl-testkube/commands/tests/common.go +++ b/cmd/kubectl-testkube/commands/tests/common.go @@ -671,13 +671,6 @@ func newExecutionRequestFromFlags(cmd *cobra.Command) (request *testkube.Executi return nil, err } - if cmd.Flag("enable-webhooks").Changed { - request.DisableWebhooks = false - } - if cmd.Flag("disable-webhooks").Changed { - request.DisableWebhooks = true - } - return request, nil } @@ -1255,17 +1248,6 @@ func newExecutionUpdateRequestFromFlags(cmd *cobra.Command) (request *testkube.E request.SlavePodRequest = &emptyPodRequest } - disableWebhooks := false - if cmd.Flag("enable-webhooks").Changed { - request.DisableWebhooks = &disableWebhooks - nonEmpty = true - } - if cmd.Flag("disable-webhooks").Changed { - disableWebhooks = true - request.DisableWebhooks = &disableWebhooks - nonEmpty = true - } - if nonEmpty { return request, nil } diff --git a/cmd/kubectl-testkube/commands/tests/create.go b/cmd/kubectl-testkube/commands/tests/create.go index 69c2c427bf0..6f33385f7d5 100644 --- a/cmd/kubectl-testkube/commands/tests/create.go +++ b/cmd/kubectl-testkube/commands/tests/create.go @@ -110,10 +110,6 @@ func NewCreateTestsCmd() *cobra.Command { ui.Failf("pass valid test name (in '--name' flag)") } - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - namespace := cmd.Flag("namespace").Value.String() var client client.Client if !crdOnly { @@ -288,8 +284,6 @@ func AddCreateFlags(cmd *cobra.Command, flags *CreateCommonFlags) { cmd.Flags().StringVar(&flags.SlavePodTemplate, "slave-pod-template", "", "slave pod template file path for extensions to slave pod template") cmd.Flags().StringVar(&flags.SlavePodTemplateReference, "slave-pod-template-reference", "", "reference to slave pod template to use for the test") cmd.Flags().StringVar(&flags.ExecutionNamespace, "execution-namespace", "", "namespace for test execution (Pro edition only)") - cmd.Flags().Bool("disable-webhooks", false, "disable webhooks") - cmd.Flags().Bool("enable-webhooks", false, "enable webhooks") } func validateExecutorTypeAndContent(executorType, contentType string, executors testkube.ExecutorsDetails) error { diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index 15f9f97ea52..3784904053f 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -96,10 +96,6 @@ func NewRunTestCmd() *cobra.Command { watchEnabled = true } - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - outputFlag := cmd.Flag("output") outputType := render.OutputPretty if outputFlag != nil { diff --git a/cmd/kubectl-testkube/commands/tests/update.go b/cmd/kubectl-testkube/commands/tests/update.go index 6a719d99689..890b1b604cb 100644 --- a/cmd/kubectl-testkube/commands/tests/update.go +++ b/cmd/kubectl-testkube/commands/tests/update.go @@ -39,10 +39,6 @@ func NewUpdateTestsCmd() *cobra.Command { ui.Failf("pass valid test name (in '--name' flag)") } - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - client, namespace, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) diff --git a/cmd/kubectl-testkube/commands/testsuites/common.go b/cmd/kubectl-testkube/commands/testsuites/common.go index ff332d0a2ef..f8087cf39d8 100644 --- a/cmd/kubectl-testkube/commands/testsuites/common.go +++ b/cmd/kubectl-testkube/commands/testsuites/common.go @@ -117,10 +117,6 @@ func uiShellTestSuiteWatchCommandBlock(id string) { // NewTestSuiteUpsertOptionsFromFlags creates test suite upsert options from command flags func NewTestSuiteUpsertOptionsFromFlags(cmd *cobra.Command) (options apiclientv1.UpsertTestSuiteOptions, err error) { - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - data, err := common.NewDataFromFlags(cmd) if err != nil { return options, err @@ -260,22 +256,11 @@ func NewTestSuiteUpsertOptionsFromFlags(cmd *cobra.Command) (options apiclientv1 } } - if cmd.Flag("enable-webhooks").Changed { - options.ExecutionRequest.DisableWebhooks = false - } - if cmd.Flag("disable-webhooks").Changed { - options.ExecutionRequest.DisableWebhooks = true - } - return options, nil } // NewTestSuiteUpdateOptionsFromFlags creates test suite update options from command flags func NewTestSuiteUpdateOptionsFromFlags(cmd *cobra.Command) (options apiclientv1.UpdateTestSuiteOptions, err error) { - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - data, err := common.NewDataFromFlags(cmd) if err != nil { return options, err @@ -379,18 +364,6 @@ func NewTestSuiteUpdateOptionsFromFlags(cmd *cobra.Command) (options apiclientv1 nonEmpty = true } - var disableWebhook bool - if cmd.Flag("enable-webhooks").Changed { - nonEmpty = true - disableWebhook = false - executionRequest.DisableWebhooks = &disableWebhook - } - if cmd.Flag("disable-webhooks").Changed { - nonEmpty = true - disableWebhook = true - executionRequest.DisableWebhooks = &disableWebhook - } - var values = []struct { source string destination **string diff --git a/cmd/kubectl-testkube/commands/testsuites/create.go b/cmd/kubectl-testkube/commands/testsuites/create.go index f23ab92831a..08dc6745bc7 100644 --- a/cmd/kubectl-testkube/commands/testsuites/create.go +++ b/cmd/kubectl-testkube/commands/testsuites/create.go @@ -121,8 +121,6 @@ func NewCreateTestSuitesCmd() *cobra.Command { cmd.Flags().StringVar(&scraperTemplateReference, "scraper-template-reference", "", "reference to scraper template to use for the test") cmd.Flags().StringVar(&pvcTemplateReference, "pvc-template-reference", "", "reference to pvc template to use for the test") cmd.Flags().BoolVar(&update, "update", false, "update, if test suite already exists") - cmd.Flags().Bool("disable-webhooks", false, "disable webhooks") - cmd.Flags().Bool("enable-webhooks", false, "enable webhooks") return cmd } diff --git a/cmd/kubectl-testkube/commands/testsuites/run.go b/cmd/kubectl-testkube/commands/testsuites/run.go index 73ea3a33ec5..120ae56020f 100644 --- a/cmd/kubectl-testkube/commands/testsuites/run.go +++ b/cmd/kubectl-testkube/commands/testsuites/run.go @@ -48,6 +48,7 @@ func NewRunTestSuiteCmd() *cobra.Command { format string masks []string silentMode bool + disableWebhooks bool ) cmd := &cobra.Command{ @@ -67,10 +68,6 @@ func NewRunTestSuiteCmd() *cobra.Command { client, namespace, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - var executions []testkube.TestSuiteExecution options := apiv1.ExecuteTestSuiteOptions{ @@ -85,13 +82,7 @@ func NewRunTestSuiteCmd() *cobra.Command { JobTemplateReference: jobTemplateReference, ScraperTemplateReference: scraperTemplateReference, PvcTemplateReference: pvcTemplateReference, - } - - if cmd.Flag("enable-webhooks").Changed { - options.DisableWebhooks = false - } - if cmd.Flag("disable-webhooks").Changed { - options.DisableWebhooks = true + DisableWebhooks: disableWebhooks, } var fields = []struct { @@ -245,8 +236,7 @@ func NewRunTestSuiteCmd() *cobra.Command { cmd.Flags().StringVar(&format, "format", "folder", "data format for storing files, one of folder|archive") cmd.Flags().StringArrayVarP(&masks, "mask", "", []string{}, "regexp to filter downloaded files, single or comma separated, like report/.* or .*\\.json,.*\\.js$") cmd.Flags().BoolVarP(&silentMode, "silent", "", false, "don't print intermediate test suite execution") - 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/update.go b/cmd/kubectl-testkube/commands/testsuites/update.go index f6122584923..238c391d815 100644 --- a/cmd/kubectl-testkube/commands/testsuites/update.go +++ b/cmd/kubectl-testkube/commands/testsuites/update.go @@ -80,8 +80,6 @@ func UpdateTestSuitesCmd() *cobra.Command { cmd.Flags().StringVar(&cronJobTemplateReference, "cronjob-template-reference", "", "reference to cron job template to use for the test") cmd.Flags().StringVar(&scraperTemplateReference, "scraper-template-reference", "", "reference to scraper template to use for the test") cmd.Flags().StringVar(&pvcTemplateReference, "pvc-template-reference", "", "reference to pvc template to use for the test") - cmd.Flags().Bool("disable-webhooks", false, "disable webhooks") - cmd.Flags().Bool("enable-webhooks", false, "enable webhooks") return cmd } diff --git a/cmd/kubectl-testkube/commands/testworkflows/run.go b/cmd/kubectl-testkube/commands/testworkflows/run.go index 7a42b731e6e..ed460b9fceb 100644 --- a/cmd/kubectl-testkube/commands/testworkflows/run.go +++ b/cmd/kubectl-testkube/commands/testworkflows/run.go @@ -31,9 +31,10 @@ var ( func NewRunTestWorkflowCmd() *cobra.Command { var ( - executionName string - config map[string]string - watchEnabled bool + executionName string + config map[string]string + watchEnabled bool + disableWebhooks bool ) cmd := &cobra.Command{ @@ -43,10 +44,6 @@ func NewRunTestWorkflowCmd() *cobra.Command { Short: "Starts test workflow execution", Run: func(cmd *cobra.Command, args []string) { - if common.IsBothEnabledAndDisabledSet(cmd) { - ui.Failf("both --enable-webhooks and --disable-webhooks flags are set, please use only one") - } - outputFlag := cmd.Flag("output") outputType := render.OutputPretty if outputFlag != nil { @@ -58,14 +55,6 @@ func NewRunTestWorkflowCmd() *cobra.Command { client, _, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) - var disableWebhooks bool - if cmd.Flag("enable-webhooks").Changed { - disableWebhooks = false - } - if cmd.Flag("disable-webhooks").Changed { - disableWebhooks = true - } - name := args[0] execution, err := client.ExecuteTestWorkflow(name, testkube.TestWorkflowExecutionRequest{ Name: executionName, @@ -114,8 +103,7 @@ func NewRunTestWorkflowCmd() *cobra.Command { cmd.Flags().StringVarP(&executionName, "name", "n", "", "execution name, if empty will be autogenerated") cmd.Flags().StringToStringVarP(&config, "config", "", map[string]string{}, "configuration variables in a form of name1=val1 passed to executor") cmd.Flags().BoolVarP(&watchEnabled, "watch", "f", false, "watch for changes after start") - cmd.Flags().Bool("disable-webhooks", false, "disable webhooks for this execution") - cmd.Flags().Bool("enable-webhooks", false, "enable webhooks for this execution") + cmd.Flags().BoolVar(&disableWebhooks, "disable-webhooks", false, "disable webhooks for this execution") return cmd } diff --git a/cmd/tcl/testworkflow-toolkit/commands/execute.go b/cmd/tcl/testworkflow-toolkit/commands/execute.go index 8d8aa468ffd..9f655249991 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/execute.go +++ b/cmd/tcl/testworkflow-toolkit/commands/execute.go @@ -146,13 +146,14 @@ func buildTestExecution(test testworkflowsv1.StepExecuteTest, async, disableWebh }, nil } -func buildWorkflowExecution(workflow testworkflowsv1.StepExecuteWorkflow, async bool) (func() error, error) { +func buildWorkflowExecution(workflow testworkflowsv1.StepExecuteWorkflow, async, disableWebhooks bool) (func() error, error) { return func() (err error) { c := env.Testkube() exec, err := c.ExecuteTestWorkflow(workflow.Name, testkube.TestWorkflowExecutionRequest{ - Name: workflow.ExecutionName, - Config: testworkflows.MapConfigValueKubeToAPI(workflow.Config), + Name: workflow.ExecutionName, + Config: testworkflows.MapConfigValueKubeToAPI(workflow.Config), + DisableWebhooks: disableWebhooks, }) execName := exec.Name if err != nil { @@ -346,7 +347,7 @@ func NewExecuteCmd() *cobra.Command { if err != nil { ui.Fail(errors.Wrapf(err, "'%s' workflow: computing execution", spec.Name)) } - fn, err := buildWorkflowExecution(*spec, async) + fn, err := buildWorkflowExecution(*spec, async, disableWebhooks) if err != nil { ui.Fail(err) } diff --git a/docs/docs/cli/testkube_create_test.md b/docs/docs/cli/testkube_create_test.md index 4599ae2819d..b063de7fe87 100644 --- a/docs/docs/cli/testkube_create_test.md +++ b/docs/docs/cli/testkube_create_test.md @@ -28,8 +28,6 @@ testkube create test [flags] --cronjob-template string cron job template file path for extensions to cron job template --cronjob-template-reference string reference to cron job template to use for the test --description string test description - --disable-webhooks disable webhooks - --enable-webhooks enable webhooks --env stringToString envs in a form of name1=val1 passed to executor (default []) --execute-postrun-script-before-scraping whether to execute postrun scipt before scraping or not (prebuilt executor only) --execution-name string execution name, if empty will be autogenerated diff --git a/docs/docs/cli/testkube_create_testsuite.md b/docs/docs/cli/testkube_create_testsuite.md index 0982a691dde..b18294d128e 100644 --- a/docs/docs/cli/testkube_create_testsuite.md +++ b/docs/docs/cli/testkube_create_testsuite.md @@ -15,8 +15,6 @@ testkube create testsuite [flags] ``` --cronjob-template string cron job template file path for extensions to cron job template --cronjob-template-reference string reference to cron job template to use for the test - --disable-webhooks disable webhooks - --enable-webhooks enable webhooks --execution-name string execution name, if empty will be autogenerated -f, --file string JSON test suite file - will be read from stdin if not specified, look at testkube.TestUpsertRequest -h, --help help for testsuite diff --git a/docs/docs/cli/testkube_generate_tests-crds.md b/docs/docs/cli/testkube_generate_tests-crds.md index a6566e42d86..79fa5113b2c 100644 --- a/docs/docs/cli/testkube_generate_tests-crds.md +++ b/docs/docs/cli/testkube_generate_tests-crds.md @@ -28,8 +28,6 @@ testkube generate tests-crds [flags] --cronjob-template string cron job template file path for extensions to cron job template --cronjob-template-reference string reference to cron job template to use for the test --description string test description - --disable-webhooks disable webhooks - --enable-webhooks enable webhooks --env stringToString envs in a form of name1=val1 passed to executor (default []) --execute-postrun-script-before-scraping whether to execute postrun scipt before scraping or not (prebuilt executor only) --execution-name string execution name, if empty will be autogenerated diff --git a/docs/docs/cli/testkube_run_test.md b/docs/docs/cli/testkube_run_test.md index b893b8ad0ff..bb8c3fd8b86 100644 --- a/docs/docs/cli/testkube_run_test.md +++ b/docs/docs/cli/testkube_run_test.md @@ -33,7 +33,6 @@ testkube run test [flags] --disable-webhooks disable webhooks -d, --download-artifacts download artifacts automatically --download-dir string download dir (default "artifacts") - --enable-webhooks enable webhooks --execute-postrun-script-before-scraping whether to execute postrun scipt before scraping or not (prebuilt executor only) --execution-label stringToString execution-label key value pair: --execution-label key1=value1 (default []) --execution-namespace string namespace for test execution (Pro edition only) diff --git a/docs/docs/cli/testkube_run_testsuite.md b/docs/docs/cli/testkube_run_testsuite.md index f96d69df2c6..0172faaaa58 100644 --- a/docs/docs/cli/testkube_run_testsuite.md +++ b/docs/docs/cli/testkube_run_testsuite.md @@ -18,7 +18,6 @@ testkube run testsuite [flags] --disable-webhooks disable webhooks -d, --download-artifacts download artifacts automatically --download-dir string download dir (default "artifacts") - --enable-webhooks enable webhooks --execution-label stringToString execution-label adds a label to execution in form of key value pair: --execution-label key1=value1 (default []) --format string data format for storing files, one of folder|archive (default "folder") --git-branch string if uri is git repository we can set additional branch parameter diff --git a/docs/docs/cli/testkube_run_testworkflow.md b/docs/docs/cli/testkube_run_testworkflow.md index 1d7658dd59b..7c6d5caf83b 100644 --- a/docs/docs/cli/testkube_run_testworkflow.md +++ b/docs/docs/cli/testkube_run_testworkflow.md @@ -11,7 +11,6 @@ testkube run testworkflow [name] [flags] ``` --config stringToString configuration variables in a form of name1=val1 passed to executor (default []) --disable-webhooks disable webhooks for this execution - --enable-webhooks enable webhooks for this execution -h, --help help for testworkflow -n, --name string execution name, if empty will be autogenerated -f, --watch watch for changes after start diff --git a/docs/docs/cli/testkube_update_test.md b/docs/docs/cli/testkube_update_test.md index 73761b86ef4..70836df9110 100644 --- a/docs/docs/cli/testkube_update_test.md +++ b/docs/docs/cli/testkube_update_test.md @@ -28,8 +28,6 @@ testkube update test [flags] --cronjob-template string cron job template file path for extensions to cron job template --cronjob-template-reference string reference to cron job template to use for the test --description string test description - --disable-webhooks disable webhooks - --enable-webhooks enable webhooks --env stringToString envs in a form of name1=val1 passed to executor (default []) --execute-postrun-script-before-scraping whether to execute postrun scipt before scraping or not (prebuilt executor only) --execution-name string execution name, if empty will be autogenerated diff --git a/docs/docs/cli/testkube_update_testsuite.md b/docs/docs/cli/testkube_update_testsuite.md index a0b74cf4cb6..aba8477f0d3 100644 --- a/docs/docs/cli/testkube_update_testsuite.md +++ b/docs/docs/cli/testkube_update_testsuite.md @@ -15,8 +15,6 @@ testkube update testsuite [flags] ``` --cronjob-template string cron job template file path for extensions to cron job template --cronjob-template-reference string reference to cron job template to use for the test - --disable-webhooks disable webhooks - --enable-webhooks enable webhooks --execution-name string execution name, if empty will be autogenerated -f, --file string JSON test file - will be read from stdin if not specified, look at testkube.TestUpsertRequest -h, --help help for testsuite diff --git a/pkg/api/v1/testkube/model_test_suite_execution_extended.go b/pkg/api/v1/testkube/model_test_suite_execution_extended.go index 2f7e45d70a7..7d5c3dff2b0 100644 --- a/pkg/api/v1/testkube/model_test_suite_execution_extended.go +++ b/pkg/api/v1/testkube/model_test_suite_execution_extended.go @@ -39,11 +39,11 @@ func NewStartedTestSuiteExecution(testSuite TestSuite, request TestSuiteExecutio Variables: map[string]Variable{}, RunningContext: request.RunningContext, TestSuiteExecutionName: request.TestSuiteExecutionName, + DisableWebhooks: request.DisableWebhooks, } if testSuite.ExecutionRequest != nil { testExecution.Variables = testSuite.ExecutionRequest.Variables - testExecution.DisableWebhooks = testSuite.ExecutionRequest.DisableWebhooks } // override variables from request diff --git a/pkg/mapper/tests/kube_openapi.go b/pkg/mapper/tests/kube_openapi.go index 767e746ff0d..14b4e90e33c 100644 --- a/pkg/mapper/tests/kube_openapi.go +++ b/pkg/mapper/tests/kube_openapi.go @@ -195,7 +195,6 @@ func MapExecutionRequestFromSpec(specExecutionRequest *testsv3.ExecutionRequest) EnvConfigMaps: MapEnvReferences(specExecutionRequest.EnvConfigMaps), EnvSecrets: MapEnvReferences(specExecutionRequest.EnvSecrets), SlavePodRequest: podRequest, - DisableWebhooks: specExecutionRequest.DisableWebhooks, } // Pro edition only (tcl protected code) @@ -527,7 +526,6 @@ func MapSpecExecutionRequestToExecutionUpdateRequest( executionRequest.EnvSecrets = &envSecrets executionRequest.ExecutePostRunScriptBeforeScraping = &request.ExecutePostRunScriptBeforeScraping executionRequest.SourceScripts = &request.SourceScripts - executionRequest.DisableWebhooks = &request.DisableWebhooks // Pro edition only (tcl protected code) mappertcl.MapSpecExecutionRequestToExecutionUpdateRequest(request, executionRequest) diff --git a/pkg/mapper/tests/openapi_kube.go b/pkg/mapper/tests/openapi_kube.go index 80f73ed3912..00c6b36e96f 100644 --- a/pkg/mapper/tests/openapi_kube.go +++ b/pkg/mapper/tests/openapi_kube.go @@ -207,7 +207,6 @@ func MapExecutionRequestToSpecExecutionRequest(executionRequest *testkube.Execut EnvConfigMaps: mapEnvReferences(executionRequest.EnvConfigMaps), EnvSecrets: mapEnvReferences(executionRequest.EnvSecrets), SlavePodRequest: podRequest, - DisableWebhooks: executionRequest.DisableWebhooks, } // Pro edition only (tcl protected code) @@ -635,11 +634,6 @@ func MapExecutionUpdateRequestToSpecExecutionRequest(executionRequest *testkube. emptyExecution = false } - if executionRequest.DisableWebhooks != nil { - request.DisableWebhooks = *executionRequest.DisableWebhooks - emptyExecution = false - } - // Pro edition only (tcl protected code) if !mappertcl.MapExecutionUpdateRequestToSpecExecutionRequest(executionRequest, request) { emptyExecution = false diff --git a/pkg/mapper/testsuites/kube_openapi.go b/pkg/mapper/testsuites/kube_openapi.go index 7b5549289b0..4f384847350 100644 --- a/pkg/mapper/testsuites/kube_openapi.go +++ b/pkg/mapper/testsuites/kube_openapi.go @@ -192,7 +192,6 @@ func MapExecutionRequestFromSpec(specExecutionRequest *testsuitesv3.TestSuiteExe PvcTemplateReference: specExecutionRequest.PvcTemplateReference, ScraperTemplate: specExecutionRequest.ScraperTemplate, ScraperTemplateReference: specExecutionRequest.ScraperTemplateReference, - DisableWebhooks: specExecutionRequest.DisableWebhooks, } } @@ -354,7 +353,6 @@ func MapSpecExecutionRequestToExecutionUpdateRequest(request *testsuitesv3.TestS vars := MergeVariablesAndParams(request.Variables, nil) executionRequest.Variables = &vars - executionRequest.DisableWebhooks = &request.DisableWebhooks return executionRequest } @@ -406,6 +404,5 @@ func MapTestStepExecutionRequestCRDToAPI(request *testsuitesv3.TestSuiteStepExec PvcTemplate: request.PvcTemplate, PvcTemplateReference: request.PvcTemplateReference, RunningContext: runningContext, - DisableWebhooks: request.DisableWebhooks, } } diff --git a/pkg/mapper/testsuites/openapi_kube.go b/pkg/mapper/testsuites/openapi_kube.go index 6ea10a9c95f..6195612252b 100644 --- a/pkg/mapper/testsuites/openapi_kube.go +++ b/pkg/mapper/testsuites/openapi_kube.go @@ -230,7 +230,6 @@ func MapExecutionRequestToSpecExecutionRequest(executionRequest *testkube.TestSu ScraperTemplateReference: executionRequest.ScraperTemplateReference, PvcTemplate: executionRequest.PvcTemplate, PvcTemplateReference: executionRequest.PvcTemplateReference, - DisableWebhooks: executionRequest.DisableWebhooks, } } @@ -404,11 +403,6 @@ func MapExecutionUpdateRequestToSpecExecutionRequest(executionRequest *testkube. empty = false } - if executionRequest.DisableWebhooks != nil { - request.DisableWebhooks = *executionRequest.DisableWebhooks - empty = false - } - if empty { return nil } @@ -487,7 +481,6 @@ func MapTestStepExecutionRequestCRD(request *testkube.TestSuiteStepExecutionRequ PvcTemplate: request.PvcTemplate, PvcTemplateReference: request.PvcTemplateReference, RunningContext: runningContext, - DisableWebhooks: request.DisableWebhooks, } } diff --git a/pkg/scheduler/test_scheduler.go b/pkg/scheduler/test_scheduler.go index e7f374c5183..9a654c49d55 100644 --- a/pkg/scheduler/test_scheduler.go +++ b/pkg/scheduler/test_scheduler.go @@ -59,10 +59,6 @@ func (s *Scheduler) executeTest(ctx context.Context, test testkube.Test, request request.Name = fmt.Sprintf("%s-%d", request.Name, request.Number) } - if !request.DisableWebhooks && test.ExecutionRequest != nil { - request.DisableWebhooks = test.ExecutionRequest.DisableWebhooks - } - // test name + test execution name should be unique execution, _ = s.testResults.GetByNameAndTest(ctx, request.Name, test.Name) diff --git a/pkg/scheduler/testsuite_scheduler.go b/pkg/scheduler/testsuite_scheduler.go index edff555e354..66f7bbd56f2 100644 --- a/pkg/scheduler/testsuite_scheduler.go +++ b/pkg/scheduler/testsuite_scheduler.go @@ -118,10 +118,6 @@ func (s *Scheduler) executeTestSuite(ctx context.Context, testSuite testkube.Tes request.Name = fmt.Sprintf("ts-%s-%d", testSuite.Name, request.Number) } - if testSuite.ExecutionRequest != nil && testSuite.ExecutionRequest.DisableWebhooks { - request.DisableWebhooks = testSuite.ExecutionRequest.DisableWebhooks - } - testsuiteExecution = testkube.NewStartedTestSuiteExecution(testSuite, request) err = s.testsuiteResults.Insert(ctx, testsuiteExecution) if err != nil {