Skip to content

Commit

Permalink
NDEV-18337 different file for custom job defn
Browse files Browse the repository at this point in the history
  • Loading branch information
pns-nirmata committed Feb 26, 2024
1 parent 7d19783 commit f8402fd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/kubebench/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kubebench

import (
"embed"
"os"
)

//go:embed jobs/*.yaml
Expand All @@ -14,10 +15,13 @@ func embedYAMLs(benchmark, clusterType, customJobFile string) ([]byte, error) {
jobFile := "jobs/job.yaml"
if customJobFile != "" {
jobFile = customJobFile
} else if clusterType != "" {
jobFile = "jobs/job-" + clusterType + ".yaml"
data, err = os.ReadFile(customJobFile)
} else {
if clusterType != "" {
jobFile = "jobs/job-" + clusterType + ".yaml"
}
data, err = yamlDir.ReadFile(jobFile)
}
data, err = yamlDir.ReadFile(jobFile)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f8402fd

Please sign in to comment.