diff --git a/cmd/kube-burner/ocp.go b/cmd/kube-burner/ocp.go index e461e5c1e..85d82a1be 100644 --- a/cmd/kube-burner/ocp.go +++ b/cmd/kube-burner/ocp.go @@ -64,11 +64,6 @@ func openShiftCmd() *cobra.Command { } wh.SetKubeBurnerFlags() } - ocpCmd.PersistentPostRun = func(cmd *cobra.Command, args []string) { - if *esServer != "" { - wh.IndexMetadata() - } - } ocpCmd.AddCommand( workloads.NewClusterDensity(&wh), workloads.NewNodeDensity(&wh), diff --git a/docs/ocp.md b/docs/ocp.md index 219f5324e..f394023f2 100644 --- a/docs/ocp.md +++ b/docs/ocp.md @@ -51,7 +51,9 @@ This wrapper provides the following benefits among others: - Prevents modifying configuration files to tweak some of the parameters of the workloads - Discovers the Prometheus URL and authentication token, so the user does not have to perform those operations before using them. -It's also possible to customize the configuration before running the workload by extracting and them running it: +## Customizing workloads + +It's possible to customize the workload configuration before running the workload by extracting, updating and finally running it: ```console $ kube-burner ocp node-density --extract diff --git a/pkg/workloads/helpers.go b/pkg/workloads/helpers.go index 14443676f..11e39492f 100644 --- a/pkg/workloads/helpers.go +++ b/pkg/workloads/helpers.go @@ -124,10 +124,11 @@ func (wh *WorkloadHelper) GatherMetadata() error { return nil } -func (wh *WorkloadHelper) IndexMetadata() { +func (wh *WorkloadHelper) indexMetadata() { wh.Metadata.EndDate = time.Now().UTC() if wh.envVars["ES_SERVER"] == "" { log.Info("No metadata will be indexed") + return } esEndpoint := fmt.Sprintf("%v/%v/_doc", wh.envVars["ES_SERVER"], wh.envVars["ES_INDEX"]) body, _ := json.Marshal(wh.Metadata) @@ -174,7 +175,7 @@ func (wh *WorkloadHelper) run(workload string) { log.Fatal(err) } wh.Metadata.Passed = rc == 0 - wh.IndexMetadata() + wh.indexMetadata() os.Exit(rc) } diff --git a/pkg/workloads/node-density-cni.go b/pkg/workloads/node-density-cni.go index 659e176dc..c8c6e6710 100644 --- a/pkg/workloads/node-density-cni.go +++ b/pkg/workloads/node-density-cni.go @@ -49,7 +49,7 @@ func NewNodeDensityCNI(wh *WorkloadHelper) *cobra.Command { if err != nil { log.Fatal(err) } - os.Setenv("JOB_ITERATIONS", fmt.Sprint(totalPods-podCount)) + os.Setenv("JOB_ITERATIONS", fmt.Sprint((totalPods-podCount)/2)) }, Run: func(cmd *cobra.Command, args []string) { wh.run(cmd.Name())