Skip to content

Commit c37eddc

Browse files
committed
Add CRO-operator upgrade tests
Signed-off-by: Max Cao <[email protected]>
1 parent 7ee4782 commit c37eddc

4 files changed

+269
-0
lines changed

ci-operator/config/openshift/cluster-resource-override-admission-operator/openshift-cluster-resource-override-admission-operator-main.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ base_images:
77
name: release
88
namespace: openshift
99
tag: rhel-9-release-golang-1.23-openshift-4.19
10+
operator-sdk:
11+
name: "4.19"
12+
namespace: origin
13+
tag: operator-sdk
14+
previous-bundle:
15+
name: "4.19"
16+
namespace: ocp
17+
tag: cluster-resource-override-admission-operator-bundle
18+
previous-operator:
19+
name: "4.19"
20+
namespace: ocp
21+
tag: cluster-resource-override-admission-operator
1022
binary_build_commands: make build --warn-undefined-variables
1123
build_root:
1224
from_repository: true
@@ -117,6 +129,56 @@ tests:
117129
requests:
118130
cpu: 100m
119131
workflow: ipi-aws
132+
- as: e2e-aws-upgrade
133+
skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$
134+
steps:
135+
cluster_profile: aws
136+
test:
137+
- as: install
138+
cli: latest
139+
commands: "export NS=clusterresourceoverride-operator\noc create ns $NS\n\n#
140+
Deploy the bundle which will fail to come up due to it pointing to the operator
141+
image via a tag that is only\n# available to the presubmit job it is created
142+
within. This pipeline image is removed shortly after said job\n# completes,
143+
so the csv needs to be patched to point the equivalent image that has been
144+
promoted.\noperator-sdk run bundle --timeout=10m -n $NS --security-context-config
145+
restricted \"$PREVIOUS_BUNDLE\" || true\nexport OLD_CSV_NAME=$(oc get csv
146+
-n $NS -o jsonpath='{.items[0].metadata.name}') \n\noc patch csv -n $NS $OLD_CSV_NAME
147+
--type='json' -p=\"[{\\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/spec/install/spec/deployments/0/spec/template/spec/containers/0/image\\\",
148+
\\\"value\\\": \\\"$PREVIOUS_OPERATOR\\\"}]\"\nsleep 10\n\n# Delete the deployment
149+
which will then be recreated by the subscription controller with the correct
150+
image.\noc delete deployment -n $NS clusterresourceoverride-operator\n\noc
151+
wait --timeout=10m --for=create -n $NS deployment clusterresourceoverride-operator\noc
152+
wait --timeout=10m --for condition=Available -n $NS deployment clusterresourceoverride-operator\n"
153+
dependencies:
154+
- env: PREVIOUS_BUNDLE
155+
name: previous-bundle
156+
- env: PREVIOUS_OPERATOR
157+
name: previous-operator
158+
from: operator-sdk
159+
resources:
160+
requests:
161+
cpu: 100m
162+
- as: upgrade
163+
cli: latest
164+
commands: |
165+
export NS=clusterresourceoverride-operator
166+
operator-sdk run bundle-upgrade --timeout 10m -n $NS --security-context-config restricted "$OO_BUNDLE"
167+
dependencies:
168+
- env: OO_BUNDLE
169+
name: cluster-resource-override-admission-operator-bundle
170+
from: operator-sdk
171+
resources:
172+
requests:
173+
cpu: 100m
174+
- as: test
175+
cli: latest
176+
commands: make e2e
177+
from: src
178+
resources:
179+
requests:
180+
cpu: 100m
181+
workflow: ipi-aws
120182
- as: verify-deps
121183
steps:
122184
env:

ci-operator/config/openshift/cluster-resource-override-admission-operator/openshift-cluster-resource-override-admission-operator-release-4.19.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ base_images:
77
name: release
88
namespace: openshift
99
tag: rhel-9-release-golang-1.23-openshift-4.19
10+
operator-sdk:
11+
name: "4.19"
12+
namespace: origin
13+
tag: operator-sdk
14+
previous-bundle:
15+
name: "4.18"
16+
namespace: ocp
17+
tag: cluster-resource-override-admission-operator-bundle
18+
previous-operator:
19+
name: "4.18"
20+
namespace: ocp
21+
tag: cluster-resource-override-admission-operator
1022
binary_build_commands: make build --warn-undefined-variables
1123
build_root:
1224
from_repository: true
@@ -117,6 +129,55 @@ tests:
117129
requests:
118130
cpu: 100m
119131
workflow: ipi-aws
132+
- as: e2e-aws-upgrade
133+
skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$
134+
steps:
135+
cluster_profile: aws
136+
test:
137+
- as: install
138+
cli: latest
139+
commands: "export NS=clusterresourceoverride-operator\noc create ns $NS\n\n#
140+
Deploy the bundle which will fail to come up due to it pointing to the operator
141+
image via a tag that is only\n# available to the presubmit job it is created
142+
within. This pipeline image is removed shortly after said job\n# completes,
143+
so the csv needs to be patched to point the equivalent image that has been
144+
promoted.\noperator-sdk run bundle --timeout=10m -n $NS --security-context-config
145+
restricted \"$PREVIOUS_BUNDLE\" || true\nexport OLD_CSV_NAME=$(oc get csv
146+
-n $NS -o jsonpath='{.items[0].metadata.name}') \n\noc patch csv -n $NS $OLD_CSV_NAME
147+
--type='json' -p=\"[{\\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/spec/install/spec/deployments/0/spec/template/spec/containers/0/image\\\",
148+
\\\"value\\\": \\\"$PREVIOUS_OPERATOR\\\"}]\"\nsleep 10\n\n# Delete the deployment
149+
which will then be recreated by the subscription controller with the correct
150+
image.\noc delete deployment -n $NS clusterresourceoverride-operator\n\noc
151+
wait --timeout=10m --for=create -n $NS deployment clusterresourceoverride-operator\noc
152+
wait --timeout=10m --for condition=Available -n $NS deployment clusterresourceoverride-operator\n"
153+
dependencies:
154+
- env: PREVIOUS_BUNDLE
155+
name: previous-bundle
156+
- env: PREVIOUS_OPERATOR
157+
name: previous-operator
158+
from: operator-sdk
159+
resources:
160+
requests:
161+
cpu: 100m
162+
- as: upgrade
163+
cli: latest
164+
commands: |
165+
export NS=clusterresourceoverride-operator
166+
operator-sdk run bundle-upgrade --timeout 10m -n $NS --security-context-config restricted "$OO_BUNDLE"
167+
dependencies:
168+
- env: OO_BUNDLE
169+
name: cluster-resource-override-admission-operator-bundle
170+
from: operator-sdk
171+
resources:
172+
requests:
173+
cpu: 100m
174+
- as: test
175+
cli: latest
176+
commands: make e2e
177+
from: src
178+
resources:
179+
requests:
180+
cpu: 100m
120181
- as: verify-deps
121182
steps:
122183
env:

ci-operator/jobs/openshift/cluster-resource-override-admission-operator/openshift-cluster-resource-override-admission-operator-main-presubmits.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,79 @@ presubmits:
199199
secret:
200200
secretName: result-aggregator
201201
trigger: (?m)^/test( | .* )e2e-aws-operator,?($|\s.*)
202+
- agent: kubernetes
203+
always_run: false
204+
branches:
205+
- ^main$
206+
- ^main-
207+
cluster: build10
208+
context: ci/prow/e2e-aws-upgrade
209+
decorate: true
210+
labels:
211+
ci-operator.openshift.io/cloud: aws
212+
ci-operator.openshift.io/cloud-cluster-profile: aws
213+
ci.openshift.io/generator: prowgen
214+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
215+
name: pull-ci-openshift-cluster-resource-override-admission-operator-main-e2e-aws-upgrade
216+
rerun_command: /test e2e-aws-upgrade
217+
skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$
218+
spec:
219+
containers:
220+
- args:
221+
- --gcs-upload-secret=/secrets/gcs/service-account.json
222+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
223+
- --lease-server-credentials-file=/etc/boskos/credentials
224+
- --report-credentials-file=/etc/report/credentials
225+
- --secret-dir=/secrets/ci-pull-credentials
226+
- --target=e2e-aws-upgrade
227+
command:
228+
- ci-operator
229+
image: ci-operator:latest
230+
imagePullPolicy: Always
231+
name: ""
232+
resources:
233+
requests:
234+
cpu: 10m
235+
volumeMounts:
236+
- mountPath: /etc/boskos
237+
name: boskos
238+
readOnly: true
239+
- mountPath: /secrets/ci-pull-credentials
240+
name: ci-pull-credentials
241+
readOnly: true
242+
- mountPath: /secrets/gcs
243+
name: gcs-credentials
244+
readOnly: true
245+
- mountPath: /secrets/manifest-tool
246+
name: manifest-tool-local-pusher
247+
readOnly: true
248+
- mountPath: /etc/pull-secret
249+
name: pull-secret
250+
readOnly: true
251+
- mountPath: /etc/report
252+
name: result-aggregator
253+
readOnly: true
254+
serviceAccountName: ci-operator
255+
volumes:
256+
- name: boskos
257+
secret:
258+
items:
259+
- key: credentials
260+
path: credentials
261+
secretName: boskos-credentials
262+
- name: ci-pull-credentials
263+
secret:
264+
secretName: ci-pull-credentials
265+
- name: manifest-tool-local-pusher
266+
secret:
267+
secretName: manifest-tool-local-pusher
268+
- name: pull-secret
269+
secret:
270+
secretName: registry-pull-credentials
271+
- name: result-aggregator
272+
secret:
273+
secretName: result-aggregator
274+
trigger: (?m)^/test( | .* )e2e-aws-upgrade,?($|\s.*)
202275
- agent: kubernetes
203276
always_run: true
204277
branches:

ci-operator/jobs/openshift/cluster-resource-override-admission-operator/openshift-cluster-resource-override-admission-operator-release-4.19-presubmits.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,79 @@ presubmits:
199199
secret:
200200
secretName: result-aggregator
201201
trigger: (?m)^/test( | .* )e2e-aws-operator,?($|\s.*)
202+
- agent: kubernetes
203+
always_run: false
204+
branches:
205+
- ^release-4\.19$
206+
- ^release-4\.19-
207+
cluster: build11
208+
context: ci/prow/e2e-aws-upgrade
209+
decorate: true
210+
labels:
211+
ci-operator.openshift.io/cloud: aws
212+
ci-operator.openshift.io/cloud-cluster-profile: aws
213+
ci.openshift.io/generator: prowgen
214+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
215+
name: pull-ci-openshift-cluster-resource-override-admission-operator-release-4.19-e2e-aws-upgrade
216+
rerun_command: /test e2e-aws-upgrade
217+
skip_if_only_changed: ^docs/|^\.github|\.md$|^(?:.*/)?(?:\.gitignore|OWNERS|OWNERS_ALIASES|PROJECT|LICENSE)$
218+
spec:
219+
containers:
220+
- args:
221+
- --gcs-upload-secret=/secrets/gcs/service-account.json
222+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
223+
- --lease-server-credentials-file=/etc/boskos/credentials
224+
- --report-credentials-file=/etc/report/credentials
225+
- --secret-dir=/secrets/ci-pull-credentials
226+
- --target=e2e-aws-upgrade
227+
command:
228+
- ci-operator
229+
image: ci-operator:latest
230+
imagePullPolicy: Always
231+
name: ""
232+
resources:
233+
requests:
234+
cpu: 10m
235+
volumeMounts:
236+
- mountPath: /etc/boskos
237+
name: boskos
238+
readOnly: true
239+
- mountPath: /secrets/ci-pull-credentials
240+
name: ci-pull-credentials
241+
readOnly: true
242+
- mountPath: /secrets/gcs
243+
name: gcs-credentials
244+
readOnly: true
245+
- mountPath: /secrets/manifest-tool
246+
name: manifest-tool-local-pusher
247+
readOnly: true
248+
- mountPath: /etc/pull-secret
249+
name: pull-secret
250+
readOnly: true
251+
- mountPath: /etc/report
252+
name: result-aggregator
253+
readOnly: true
254+
serviceAccountName: ci-operator
255+
volumes:
256+
- name: boskos
257+
secret:
258+
items:
259+
- key: credentials
260+
path: credentials
261+
secretName: boskos-credentials
262+
- name: ci-pull-credentials
263+
secret:
264+
secretName: ci-pull-credentials
265+
- name: manifest-tool-local-pusher
266+
secret:
267+
secretName: manifest-tool-local-pusher
268+
- name: pull-secret
269+
secret:
270+
secretName: registry-pull-credentials
271+
- name: result-aggregator
272+
secret:
273+
secretName: result-aggregator
274+
trigger: (?m)^/test( | .* )e2e-aws-upgrade,?($|\s.*)
202275
- agent: kubernetes
203276
always_run: true
204277
branches:

0 commit comments

Comments
 (0)