Skip to content

Commit a5172d2

Browse files
authored
Merge pull request #13537 from fabriziopandini/add-other-to-prow-job-generator
🌱 Add other to prow job generator
2 parents 72b41fb + ef1b68b commit a5172d2

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

hack/tools/prowjob-gen/config.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ type Config struct {
3333

3434
// BranchConfig is the branch-based configuration struct.
3535
type BranchConfig struct {
36-
Interval string `json:"interval"`
37-
UpgradesInterval string `json:"upgradesInterval"`
38-
TestImage string `json:"testImage"`
39-
KubernetesVersionManagement string `json:"kubernetesVersionManagement"`
40-
KubebuilderEnvtestKubernetesVersion string `json:"kubebuilderEnvtestKubernetesVersion"`
41-
Upgrades []*Upgrade `json:"upgrades"`
36+
Interval string `json:"interval"`
37+
UpgradesInterval string `json:"upgradesInterval"`
38+
TestImage string `json:"testImage"`
39+
KubernetesVersionManagement string `json:"kubernetesVersionManagement"`
40+
KubebuilderEnvtestKubernetesVersion string `json:"kubebuilderEnvtestKubernetesVersion"`
41+
Upgrades []*Upgrade `json:"upgrades"`
42+
Other map[string]interface{} `json:"other"`
4243
}
4344

4445
// Template refers a template file and defines the target file name template.

hack/tools/prowjob-gen/test/test-configuration.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ prow_ignored:
99
upgrades:
1010
- from: "1.29"
1111
to: "1.30"
12-
12+
other:
13+
foo:
14+
- from: "1.29"
15+
to: "1.30"
1316
templates:
1417
- name: "test.yaml.tpl"
1518
template: "test-{{ .branch }}.yaml.tmp"

hack/tools/prowjob-gen/test/test-main.yaml.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ main
33
main
44
bar
55
foobar
6+
1.29
67
1.29

hack/tools/prowjob-gen/test/test.yaml.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
{{ ReplaceAll .branch "." "-" }}
33
{{ TrimPrefix "foobar" "foo" }}
44
{{ TrimPrefix "foobar" "bar" }}
5-
{{ (last $.config.Upgrades).From }}
5+
{{ (last $.config.Upgrades).From }}
6+
{{ (last $.config.Other.foo).from }}

0 commit comments

Comments
 (0)