Skip to content

Commit e5a68bc

Browse files
petr-mullerclaude
andcommitted
prowgen: use preset for registry pull credentials volume
Third attempt to do #4994 after we had to revert #5019 Move the pull-secret volume and volumeMount from the hardcoded defaultPodSpec to a Prow preset. This is a proof of concept for using compositional Prow presets to deduplicate the ~28 lines of boilerplate volumes/mounts that are inlined into every one of the 126K+ generated Prowjob definitions. The preset is defined in openshift/release and matched via a new label added to all prowgen-generated jobs. The --image-import-pull-secret arg remains inline since presets cannot inject container args. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 77434bf commit e5a68bc

199 files changed

Lines changed: 317 additions & 1305 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/ci-operator-prowgen/testdata/zz_fixture_postsubmit_TestFromCIOperatorConfigToProwYaml_Custom_test_timeout.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ postsubmits:
2929
labels:
3030
ci-operator.openshift.io/is-promotion: "true"
3131
ci.openshift.io/generator: prowgen
32+
presets.ci.openshift.io/registry-pull: "true"
3233
max_concurrency: 1
3334
name: branch-ci-super-duper-branch-images
3435
spec:
@@ -55,9 +56,6 @@ postsubmits:
5556
- mountPath: /secrets/manifest-tool
5657
name: manifest-tool-local-pusher
5758
readOnly: true
58-
- mountPath: /etc/pull-secret
59-
name: pull-secret
60-
readOnly: true
6159
- mountPath: /etc/push-secret
6260
name: push-secret
6361
readOnly: true
@@ -69,9 +67,6 @@ postsubmits:
6967
- name: manifest-tool-local-pusher
7068
secret:
7169
secretName: manifest-tool-local-pusher
72-
- name: pull-secret
73-
secret:
74-
secretName: registry-pull-credentials
7570
- name: push-secret
7671
secret:
7772
secretName: registry-push-credentials-ci-central

cmd/ci-operator-prowgen/testdata/zz_fixture_postsubmit_TestFromCIOperatorConfigToProwYaml_Input_is_YAML_and_it_is_correctly_processed.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ postsubmits:
2929
labels:
3030
ci-operator.openshift.io/is-promotion: "true"
3131
ci.openshift.io/generator: prowgen
32+
presets.ci.openshift.io/registry-pull: "true"
3233
max_concurrency: 1
3334
name: branch-ci-super-duper-branch-images
3435
spec:
@@ -55,9 +56,6 @@ postsubmits:
5556
- mountPath: /secrets/manifest-tool
5657
name: manifest-tool-local-pusher
5758
readOnly: true
58-
- mountPath: /etc/pull-secret
59-
name: pull-secret
60-
readOnly: true
6159
- mountPath: /etc/push-secret
6260
name: push-secret
6361
readOnly: true
@@ -69,9 +67,6 @@ postsubmits:
6967
- name: manifest-tool-local-pusher
7068
secret:
7169
secretName: manifest-tool-local-pusher
72-
- name: pull-secret
73-
secret:
74-
secretName: registry-pull-credentials
7570
- name: push-secret
7671
secret:
7772
secretName: registry-push-credentials-ci-central

cmd/ci-operator-prowgen/testdata/zz_fixture_postsubmit_TestFromCIOperatorConfigToProwYaml_Using_a_variant_config__one_test_and_images__one_existing_job._Expect_one_presubmit__pre_post_submit_images_jobs._Existing_job_should_not_be_changed..yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ postsubmits:
3232
ci-operator.openshift.io/is-promotion: "true"
3333
ci-operator.openshift.io/variant: rhel
3434
ci.openshift.io/generator: prowgen
35+
presets.ci.openshift.io/registry-pull: "true"
3536
max_concurrency: 1
3637
name: branch-ci-super-duper-branch-rhel-images
3738
spec:
@@ -59,9 +60,6 @@ postsubmits:
5960
- mountPath: /secrets/manifest-tool
6061
name: manifest-tool-local-pusher
6162
readOnly: true
62-
- mountPath: /etc/pull-secret
63-
name: pull-secret
64-
readOnly: true
6563
- mountPath: /etc/push-secret
6664
name: push-secret
6765
readOnly: true
@@ -73,9 +71,6 @@ postsubmits:
7371
- name: manifest-tool-local-pusher
7472
secret:
7573
secretName: manifest-tool-local-pusher
76-
- name: pull-secret
77-
secret:
78-
secretName: registry-pull-credentials
7974
- name: push-secret
8075
secret:
8176
secretName: registry-push-credentials-ci-central

cmd/ci-operator-prowgen/testdata/zz_fixture_postsubmit_TestFromCIOperatorConfigToProwYaml_one_test_and_images__no_previous_jobs._Expect_test_presubmit__pre_post_submit_images_jobs.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ postsubmits:
1010
labels:
1111
ci-operator.openshift.io/is-promotion: "true"
1212
ci.openshift.io/generator: prowgen
13+
presets.ci.openshift.io/registry-pull: "true"
1314
max_concurrency: 1
1415
name: branch-ci-super-duper-branch-images
1516
spec:
@@ -36,9 +37,6 @@ postsubmits:
3637
- mountPath: /secrets/manifest-tool
3738
name: manifest-tool-local-pusher
3839
readOnly: true
39-
- mountPath: /etc/pull-secret
40-
name: pull-secret
41-
readOnly: true
4240
- mountPath: /etc/push-secret
4341
name: push-secret
4442
readOnly: true
@@ -50,9 +48,6 @@ postsubmits:
5048
- name: manifest-tool-local-pusher
5149
secret:
5250
secretName: manifest-tool-local-pusher
53-
- name: pull-secret
54-
secret:
55-
secretName: registry-pull-credentials
5651
- name: push-secret
5752
secret:
5853
secretName: registry-push-credentials-ci-central

cmd/ci-operator-prowgen/testdata/zz_fixture_presubmit_TestFromCIOperatorConfigToProwYaml_Custom_test_timeout.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ presubmits:
1212
labels:
1313
ci.openshift.io/generator: prowgen
1414
pj-rehearse.openshift.io/can-be-rehearsed: "true"
15+
presets.ci.openshift.io/registry-pull: "true"
1516
name: pull-ci-super-duper-branch-images
1617
rerun_command: /test images
1718
spec:
@@ -36,9 +37,6 @@ presubmits:
3637
- mountPath: /secrets/manifest-tool
3738
name: manifest-tool-local-pusher
3839
readOnly: true
39-
- mountPath: /etc/pull-secret
40-
name: pull-secret
41-
readOnly: true
4240
- mountPath: /etc/report
4341
name: result-aggregator
4442
readOnly: true
@@ -47,9 +45,6 @@ presubmits:
4745
- name: manifest-tool-local-pusher
4846
secret:
4947
secretName: manifest-tool-local-pusher
50-
- name: pull-secret
51-
secret:
52-
secretName: registry-pull-credentials
5348
- name: result-aggregator
5449
secret:
5550
secretName: result-aggregator
@@ -67,6 +62,7 @@ presubmits:
6762
labels:
6863
ci.openshift.io/generator: prowgen
6964
pj-rehearse.openshift.io/can-be-rehearsed: "true"
65+
presets.ci.openshift.io/registry-pull: "true"
7066
name: pull-ci-super-duper-branch-unit
7167
rerun_command: /test unit
7268
spec:
@@ -103,9 +99,6 @@ presubmits:
10399
- mountPath: /secrets/manifest-tool
104100
name: manifest-tool-local-pusher
105101
readOnly: true
106-
- mountPath: /etc/pull-secret
107-
name: pull-secret
108-
readOnly: true
109102
- mountPath: /etc/report
110103
name: result-aggregator
111104
readOnly: true
@@ -120,9 +113,6 @@ presubmits:
120113
- name: manifest-tool-local-pusher
121114
secret:
122115
secretName: manifest-tool-local-pusher
123-
- name: pull-secret
124-
secret:
125-
secretName: registry-pull-credentials
126116
- name: result-aggregator
127117
secret:
128118
secretName: result-aggregator

cmd/ci-operator-prowgen/testdata/zz_fixture_presubmit_TestFromCIOperatorConfigToProwYaml_Input_is_YAML_and_it_is_correctly_processed.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ presubmits:
1212
labels:
1313
ci.openshift.io/generator: prowgen
1414
pj-rehearse.openshift.io/can-be-rehearsed: "true"
15+
presets.ci.openshift.io/registry-pull: "true"
1516
name: pull-ci-super-duper-branch-images
1617
rerun_command: /test images
1718
spec:
@@ -36,9 +37,6 @@ presubmits:
3637
- mountPath: /secrets/manifest-tool
3738
name: manifest-tool-local-pusher
3839
readOnly: true
39-
- mountPath: /etc/pull-secret
40-
name: pull-secret
41-
readOnly: true
4240
- mountPath: /etc/report
4341
name: result-aggregator
4442
readOnly: true
@@ -47,9 +45,6 @@ presubmits:
4745
- name: manifest-tool-local-pusher
4846
secret:
4947
secretName: manifest-tool-local-pusher
50-
- name: pull-secret
51-
secret:
52-
secretName: registry-pull-credentials
5348
- name: result-aggregator
5449
secret:
5550
secretName: result-aggregator
@@ -66,6 +61,7 @@ presubmits:
6661
labels:
6762
ci.openshift.io/generator: prowgen
6863
pj-rehearse.openshift.io/can-be-rehearsed: "true"
64+
presets.ci.openshift.io/registry-pull: "true"
6965
name: pull-ci-super-duper-branch-unit
7066
rerun_command: /test unit
7167
spec:
@@ -98,9 +94,6 @@ presubmits:
9894
- mountPath: /secrets/manifest-tool
9995
name: manifest-tool-local-pusher
10096
readOnly: true
101-
- mountPath: /etc/pull-secret
102-
name: pull-secret
103-
readOnly: true
10497
- mountPath: /etc/report
10598
name: result-aggregator
10699
readOnly: true
@@ -109,9 +102,6 @@ presubmits:
109102
- name: manifest-tool-local-pusher
110103
secret:
111104
secretName: manifest-tool-local-pusher
112-
- name: pull-secret
113-
secret:
114-
secretName: registry-pull-credentials
115105
- name: result-aggregator
116106
secret:
117107
secretName: result-aggregator

cmd/ci-operator-prowgen/testdata/zz_fixture_presubmit_TestFromCIOperatorConfigToProwYaml_Using_a_variant_config__one_test_and_images__one_existing_job._Expect_one_presubmit__pre_post_submit_images_jobs._Existing_job_should_not_be_changed..yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ presubmits:
1313
ci-operator.openshift.io/variant: rhel
1414
ci.openshift.io/generator: prowgen
1515
pj-rehearse.openshift.io/can-be-rehearsed: "true"
16+
presets.ci.openshift.io/registry-pull: "true"
1617
name: pull-ci-super-duper-branch-rhel-images
1718
rerun_command: /test rhel-images
1819
spec:
@@ -38,9 +39,6 @@ presubmits:
3839
- mountPath: /secrets/manifest-tool
3940
name: manifest-tool-local-pusher
4041
readOnly: true
41-
- mountPath: /etc/pull-secret
42-
name: pull-secret
43-
readOnly: true
4442
- mountPath: /etc/report
4543
name: result-aggregator
4644
readOnly: true
@@ -49,9 +47,6 @@ presubmits:
4947
- name: manifest-tool-local-pusher
5048
secret:
5149
secretName: manifest-tool-local-pusher
52-
- name: pull-secret
53-
secret:
54-
secretName: registry-pull-credentials
5550
- name: result-aggregator
5651
secret:
5752
secretName: result-aggregator
@@ -69,6 +64,7 @@ presubmits:
6964
ci-operator.openshift.io/variant: rhel
7065
ci.openshift.io/generator: prowgen
7166
pj-rehearse.openshift.io/can-be-rehearsed: "true"
67+
presets.ci.openshift.io/registry-pull: "true"
7268
name: pull-ci-super-duper-branch-rhel-unit
7369
rerun_command: /test rhel-unit
7470
spec:
@@ -102,9 +98,6 @@ presubmits:
10298
- mountPath: /secrets/manifest-tool
10399
name: manifest-tool-local-pusher
104100
readOnly: true
105-
- mountPath: /etc/pull-secret
106-
name: pull-secret
107-
readOnly: true
108101
- mountPath: /etc/report
109102
name: result-aggregator
110103
readOnly: true
@@ -113,9 +106,6 @@ presubmits:
113106
- name: manifest-tool-local-pusher
114107
secret:
115108
secretName: manifest-tool-local-pusher
116-
- name: pull-secret
117-
secret:
118-
secretName: registry-pull-credentials
119109
- name: result-aggregator
120110
secret:
121111
secretName: result-aggregator

cmd/ci-operator-prowgen/testdata/zz_fixture_presubmit_TestFromCIOperatorConfigToProwYaml_one_test_and_images__no_previous_jobs._Expect_test_presubmit__pre_post_submit_images_jobs.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ presubmits:
1212
labels:
1313
ci.openshift.io/generator: prowgen
1414
pj-rehearse.openshift.io/can-be-rehearsed: "true"
15+
presets.ci.openshift.io/registry-pull: "true"
1516
name: pull-ci-super-duper-branch-images
1617
rerun_command: /test images
1718
spec:
@@ -36,9 +37,6 @@ presubmits:
3637
- mountPath: /secrets/manifest-tool
3738
name: manifest-tool-local-pusher
3839
readOnly: true
39-
- mountPath: /etc/pull-secret
40-
name: pull-secret
41-
readOnly: true
4240
- mountPath: /etc/report
4341
name: result-aggregator
4442
readOnly: true
@@ -47,9 +45,6 @@ presubmits:
4745
- name: manifest-tool-local-pusher
4846
secret:
4947
secretName: manifest-tool-local-pusher
50-
- name: pull-secret
51-
secret:
52-
secretName: registry-pull-credentials
5348
- name: result-aggregator
5449
secret:
5550
secretName: result-aggregator
@@ -66,6 +61,7 @@ presubmits:
6661
labels:
6762
ci.openshift.io/generator: prowgen
6863
pj-rehearse.openshift.io/can-be-rehearsed: "true"
64+
presets.ci.openshift.io/registry-pull: "true"
6965
name: pull-ci-super-duper-branch-unit
7066
rerun_command: /test unit
7167
spec:
@@ -98,9 +94,6 @@ presubmits:
9894
- mountPath: /secrets/manifest-tool
9995
name: manifest-tool-local-pusher
10096
readOnly: true
101-
- mountPath: /etc/pull-secret
102-
name: pull-secret
103-
readOnly: true
10497
- mountPath: /etc/report
10598
name: result-aggregator
10699
readOnly: true
@@ -109,9 +102,6 @@ presubmits:
109102
- name: manifest-tool-local-pusher
110103
secret:
111104
secretName: manifest-tool-local-pusher
112-
- name: pull-secret
113-
secret:
114-
secretName: registry-pull-credentials
115105
- name: result-aggregator
116106
secret:
117107
secretName: result-aggregator

cmd/multi-pr-prow-plugin/testdata/zz_fixture_TestGenerateProwJob_additional_PR_from_the_same_repo.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ spec:
5252
- mountPath: /secrets/manifest-tool
5353
name: manifest-tool-local-pusher
5454
readOnly: true
55-
- mountPath: /etc/pull-secret
56-
name: pull-secret
57-
readOnly: true
5855
- mountPath: /etc/report
5956
name: result-aggregator
6057
readOnly: true
@@ -63,9 +60,6 @@ spec:
6360
- name: manifest-tool-local-pusher
6461
secret:
6562
secretName: manifest-tool-local-pusher
66-
- name: pull-secret
67-
secret:
68-
secretName: registry-pull-credentials
6963
- name: result-aggregator
7064
secret:
7165
secretName: result-aggregator

cmd/multi-pr-prow-plugin/testdata/zz_fixture_TestGenerateProwJob_multiple_additional_PRs.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ spec:
6565
- mountPath: /secrets/manifest-tool
6666
name: manifest-tool-local-pusher
6767
readOnly: true
68-
- mountPath: /etc/pull-secret
69-
name: pull-secret
70-
readOnly: true
7168
- mountPath: /etc/report
7269
name: result-aggregator
7370
readOnly: true
@@ -76,9 +73,6 @@ spec:
7673
- name: manifest-tool-local-pusher
7774
secret:
7875
secretName: manifest-tool-local-pusher
79-
- name: pull-secret
80-
secret:
81-
secretName: registry-pull-credentials
8276
- name: result-aggregator
8377
secret:
8478
secretName: result-aggregator

0 commit comments

Comments
 (0)