mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
return error with non-unique workload name in scheduler_perf_test
This commit is contained in:
parent
338b06fb69
commit
0e994e9481
@ -111,15 +111,15 @@ func (tc *testCase) collectsMetrics() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tc *testCase) workloadNamesUnique() bool {
|
func (tc *testCase) workloadNamesUnique() error {
|
||||||
workloadUniqueNames := map[string]bool{}
|
workloadUniqueNames := map[string]bool{}
|
||||||
for _, w := range tc.Workloads {
|
for _, w := range tc.Workloads {
|
||||||
if workloadUniqueNames[w.Name] {
|
if workloadUniqueNames[w.Name] {
|
||||||
return false
|
return fmt.Errorf("%s: workload name %s is not unique", tc.Name, w.Name)
|
||||||
}
|
}
|
||||||
workloadUniqueNames[w.Name] = true
|
workloadUniqueNames[w.Name] = true
|
||||||
}
|
}
|
||||||
return true
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// workload is a subtest under a testCase that tests the scheduler performance
|
// workload is a subtest under a testCase that tests the scheduler performance
|
||||||
@ -786,8 +786,8 @@ func validateTestCases(testCases []*testCase) error {
|
|||||||
if len(tc.Workloads) == 0 {
|
if len(tc.Workloads) == 0 {
|
||||||
return fmt.Errorf("%s: no workloads defined", tc.Name)
|
return fmt.Errorf("%s: no workloads defined", tc.Name)
|
||||||
}
|
}
|
||||||
if !tc.workloadNamesUnique() {
|
if err := tc.workloadNamesUnique(); err != nil {
|
||||||
return fmt.Errorf("%s: workload names are not unique", tc.Name)
|
return err
|
||||||
}
|
}
|
||||||
if len(tc.WorkloadTemplate) == 0 {
|
if len(tc.WorkloadTemplate) == 0 {
|
||||||
return fmt.Errorf("%s: no ops defined", tc.Name)
|
return fmt.Errorf("%s: no ops defined", tc.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user