Skip to content

Commit 0dbdf33

Browse files
authored
pkg/apiserver: fix scenario count in debug log (#4333)
i.e. DEBU[2026-02-18T12:34:31+01:00] 1 scenarios for machine 1 DEBU[2026-02-18T12:34:31+01:00] Returning list of scenarios : []
1 parent 441c1b0 commit 0dbdf33

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/apiserver/apic.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,14 @@ func (a *apic) FetchScenariosListFromDB(ctx context.Context) ([]string, error) {
9494
if err != nil {
9595
return nil, fmt.Errorf("while listing machines: %w", err)
9696
}
97+
9798
// merge all scenarios together
9899
for _, v := range machines {
100+
if v.Scenarios == "" {
101+
log.Debugf("No scenarios for machine %d", v.ID)
102+
continue
103+
}
104+
99105
machineScenarios := strings.Split(v.Scenarios, ",")
100106
log.Debugf("%d scenarios for machine %d", len(machineScenarios), v.ID)
101107

0 commit comments

Comments
 (0)