@@ -9,15 +9,15 @@ import (
99 "scripts/camunda-core/pkg/logging"
1010)
1111
12- // Entry represents a single matrix entry — one scenario + one flow combination.
12+ // Entry represents a single matrix entry — one scenario + one flow + one platform combination.
1313type Entry struct {
1414 Version string `json:"version"`
1515 ChartPath string `json:"chartPath"`
1616 Scenario string `json:"scenario"`
1717 Shortname string `json:"shortname"`
1818 Auth string `json:"auth"`
1919 Flow string `json:"flow"`
20- Platforms [] string `json:"platforms ,omitempty"`
20+ Platform string `json:"platform ,omitempty"`
2121 Exclude []string `json:"exclude,omitempty"`
2222 Enabled bool `json:"enabled"`
2323}
@@ -36,7 +36,7 @@ type FilterOptions struct {
3636 ScenarioFilter string
3737 // FlowFilter limits output to entries with this specific flow.
3838 FlowFilter string
39- // Platform limits output to entries whose platforms list contains this value .
39+ // Platform limits output to entries targeting this platform .
4040 Platform string
4141}
4242
@@ -124,19 +124,28 @@ func Generate(repoRoot string, opts GenerateOptions) ([]Entry, error) {
124124 continue
125125 }
126126
127- // Create one entry per permitted flow
127+ // Create one entry per permitted flow per platform.
128+ // If no platforms are specified, create one entry with an empty platform
129+ // (defaults to "gke" at execution time via resolvePlatform).
130+ platforms := scenario .Platforms
131+ if len (platforms ) == 0 {
132+ platforms = []string {"" }
133+ }
134+
128135 for _ , flow := range permittedFlows {
129- entries = append (entries , Entry {
130- Version : version ,
131- ChartPath : chartDir ,
132- Scenario : scenario .Name ,
133- Shortname : scenario .Shortname ,
134- Auth : scenario .Auth ,
135- Flow : flow ,
136- Platforms : scenario .Platforms ,
137- Exclude : scenario .Exclude ,
138- Enabled : scenario .Enabled ,
139- })
136+ for _ , platform := range platforms {
137+ entries = append (entries , Entry {
138+ Version : version ,
139+ ChartPath : chartDir ,
140+ Scenario : scenario .Name ,
141+ Shortname : scenario .Shortname ,
142+ Auth : scenario .Auth ,
143+ Flow : flow ,
144+ Platform : platform ,
145+ Exclude : scenario .Exclude ,
146+ Enabled : scenario .Enabled ,
147+ })
148+ }
140149 }
141150 }
142151 }
@@ -159,7 +168,7 @@ func Filter(entries []Entry, opts FilterOptions) []Entry {
159168 continue
160169 }
161170 if opts .Platform != "" {
162- if len ( e . Platforms ) > 0 && ! containsString ( e . Platforms , opts .Platform ) {
171+ if e . Platform != "" && e . Platform != opts .Platform {
163172 continue
164173 }
165174 }
@@ -168,16 +177,6 @@ func Filter(entries []Entry, opts FilterOptions) []Entry {
168177 return filtered
169178}
170179
171- // containsString checks if a slice contains a specific string.
172- func containsString (slice []string , s string ) bool {
173- for _ , v := range slice {
174- if v == s {
175- return true
176- }
177- }
178- return false
179- }
180-
181180// Print outputs the matrix entries in the requested format.
182181func Print (entries []Entry , format string ) (string , error ) {
183182 switch format {
@@ -209,25 +208,25 @@ func printTable(entries []Entry) string {
209208
210209 // Header
211210 fmt .Fprintf (& b , "%-8s %-6s %-25s %-10s %-10s %-16s %-12s %-8s\n " ,
212- "ENABLED" , "VER" , "SCENARIO" , "SHORT" , "AUTH" , "FLOW" , "PLATFORMS " , "EXCLUDE" )
211+ "ENABLED" , "VER" , "SCENARIO" , "SHORT" , "AUTH" , "FLOW" , "PLATFORM " , "EXCLUDE" )
213212 fmt .Fprintf (& b , "%-8s %-6s %-25s %-10s %-10s %-16s %-12s %-8s\n " ,
214- "-------" , "---" , "--------" , "-----" , "----" , "----" , "--------- " , "-------" )
213+ "-------" , "---" , "--------" , "-----" , "----" , "----" , "--------" , "-------" )
215214
216215 for _ , e := range entries {
217216 enabled := "yes"
218217 if ! e .Enabled {
219218 enabled = "no"
220219 }
221- platforms := strings . Join ( e . Platforms , "," )
222- if platforms == "" {
223- platforms = "-"
220+ platform := e . Platform
221+ if platform == "" {
222+ platform = "-"
224223 }
225224 exclude := strings .Join (e .Exclude , "," )
226225 if exclude == "" {
227226 exclude = "-"
228227 }
229228 fmt .Fprintf (& b , "%-8s %-6s %-25s %-10s %-10s %-16s %-12s %s\n " ,
230- enabled , e .Version , e .Scenario , e .Shortname , e .Auth , e .Flow , platforms , exclude )
229+ enabled , e .Version , e .Scenario , e .Shortname , e .Auth , e .Flow , platform , exclude )
231230 }
232231
233232 fmt .Fprintf (& b , "\n Total: %d entries\n " , len (entries ))
0 commit comments