Skip to content

Commit

Permalink
Add tuningPatch configuration to all generated documents (#20)
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 authored Jul 19, 2023
1 parent f3629c0 commit 076355e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/runner/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func runBenchmark(cfg config.Config, clusterMetadata ocpmetadata.ClusterMetadata
Timestamp: ts,
ClusterMetadata: clusterMetadata,
}
result.Config.Tuning = currentTuning // It's usefult to index the current tunning configuration in the all benchmark's documents
log.Infof("Running sample %d/%d: %v", i, cfg.Samples, cfg.Duration)
for _, pod := range clientPods {
wg.Add(1)
Expand Down
4 changes: 3 additions & 1 deletion pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var restConfig *rest.Config
var clientSet *kubernetes.Clientset
var dynamicClient *dynamic.DynamicClient
var orClientSet *openshiftrouteclientset.Clientset
var currentTuning string

func Start(uuid, baseUUID, baseIndex string, tolerancy int, indexer *indexers.Indexer, cleanupAssets bool) error {
var err error
Expand Down Expand Up @@ -97,7 +98,8 @@ func Start(uuid, baseUUID, baseIndex string, tolerancy int, indexer *indexers.In
return err
}
if cfg.Tuning != "" {
if err = ApplyTunning(cfg.Tuning); err != nil {
currentTuning = cfg.Tuning
if err = applyTunning(cfg.Tuning); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/tuning.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// ApplyTunning applies the given json merge patch to the default ingresscontroller CR
// and then waits for the ingres-controller deployment reconciliation to take place
func ApplyTunning(tuningPatch string) error {
func applyTunning(tuningPatch string) error {
log.Infof("Applying tuning patch to ingress controller: %v", tuningPatch)
_, err := dynamicClient.Resource(schema.GroupVersionResource{
Group: "operator.openshift.io",
Expand Down

0 comments on commit 076355e

Please sign in to comment.