Skip to content

Commit 804f4f0

Browse files
authored
Revert "[ISV-4837] Incorrect behaviour of the operator pipelines when a PR af…" (#682)
This reverts commit 02d8e9f.
1 parent 3a02f5a commit 804f4f0

File tree

3 files changed

+28
-51
lines changed

3 files changed

+28
-51
lines changed

ansible/roles/operator-pipeline/templates/openshift/pipelines/operator-hosted-pipeline.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,8 @@ spec:
440440
kind: Task
441441
runAfter:
442442
- build-fragment-images
443-
when:
444-
- &bundleAdded
445-
input: "$(tasks.detect-changes.results.added_bundle)"
443+
when: &bundleAdded
444+
- input: "$(tasks.detect-changes.results.added_bundle)"
446445
operator: notin
447446
values: [""]
448447
params:
@@ -466,8 +465,6 @@ spec:
466465
name: content-hash
467466
runAfter:
468467
- apply-test-waivers
469-
when:
470-
- *bundleAdded
471468
params:
472469
- name: pipeline_image
473470
value: "$(params.pipeline_image)"
@@ -487,8 +484,8 @@ spec:
487484
params:
488485
- name: pipeline_image
489486
value: "$(params.pipeline_image)"
490-
- name: operator_path
491-
value: "$(tasks.detect-changes.results.operator_path)"
487+
- name: bundle_path
488+
value: "$(tasks.detect-changes.results.bundle_path)"
492489
- name: cert_project_required
493490
value: "$(params.cert_project_required)"
494491
workspaces:
@@ -540,9 +537,8 @@ spec:
540537
- get-pyxis-certification-data
541538
taskRef:
542539
name: verify-project
543-
when:
544-
- &certProjectExists
545-
input: "$(tasks.certification-project-check.results.certification_project_id)"
540+
when: &certProjectExists
541+
- input: "$(tasks.certification-project-check.results.certification_project_id)"
546542
operator: "notin"
547543
values: [""]
548544
params:
@@ -562,8 +558,7 @@ spec:
562558
- verify-project
563559
taskRef:
564560
name: update-cert-project-status
565-
when:
566-
- *certProjectExists
561+
when: *certProjectExists
567562
params:
568563
- name: pipeline_image
569564
value: "$(params.pipeline_image)"
@@ -588,8 +583,7 @@ spec:
588583
- update-cert-project-status
589584
taskRef:
590585
name: reserve-operator-name
591-
when:
592-
- *certProjectExists
586+
when: *certProjectExists
593587
params:
594588
- name: pipeline_image
595589
value: "$(params.pipeline_image)"
@@ -668,12 +662,10 @@ spec:
668662
- static-tests-results
669663
taskRef:
670664
name: yaml-lint
671-
when:
672-
- &operatorOrBundleChange
673-
input: "$(tasks.detect-changes.results.affected_catalogs)"
665+
when: &operatorOrBundleChange
666+
- input: "$(tasks.detect-changes.results.affected_catalogs)"
674667
operator: in
675668
values: [""]
676-
- *bundleAdded
677669
params:
678670
- name: pipeline_image
679671
value: "$(params.pipeline_image)"
@@ -786,8 +778,7 @@ spec:
786778
- name: make-bundle-repo-public
787779
runAfter:
788780
- build-bundle
789-
when:
790-
- *operatorOrBundleChange
781+
when: *operatorOrBundleChange
791782
taskRef:
792783
name: set-quay-repo-visibility
793784
params:
@@ -853,8 +844,7 @@ spec:
853844
- name: add-bundle-to-index
854845
runAfter:
855846
- add-fbc-fragments-to-index
856-
when:
857-
- *operatorOrBundleChange
847+
when: *operatorOrBundleChange
858848
taskRef:
859849
name: add-bundle-to-index
860850
params:
@@ -888,8 +878,7 @@ spec:
888878
- name: make-index-repo-public
889879
runAfter:
890880
- add-bundle-to-index
891-
when:
892-
- *operatorOrBundleChange
881+
when: *operatorOrBundleChange
893882
taskRef:
894883
name: set-quay-repo-visibility
895884
params:
@@ -909,8 +898,6 @@ spec:
909898
- name: get-ci-results-attempt
910899
runAfter:
911900
- make-index-repo-public
912-
when:
913-
- *bundleAdded
914901
taskRef:
915902
name: get-ci-results-attempt
916903
params:
@@ -996,7 +983,6 @@ spec:
996983
- input: "$(tasks.detect-changes.results.affected_catalogs)"
997984
operator: in
998985
values: [""]
999-
- *bundleAdded
1000986
params:
1001987
- name: pipeline_image
1002988
value: "$(params.pipeline_image)"
@@ -1037,7 +1023,9 @@ spec:
10371023
kind: Task
10381024
name: evaluate-preflight-result
10391025
when:
1040-
- *bundleAdded
1026+
- input: "$(tasks.detect-changes.results.added_bundle)"
1027+
operator: notin
1028+
values: [""]
10411029
- input: "$(tasks.detect-changes.results.affected_catalogs)"
10421030
operator: in
10431031
values: [""]
@@ -1068,8 +1056,6 @@ spec:
10681056
- evaluate-preflight-result
10691057
taskRef:
10701058
name: get-ci-results
1071-
when:
1072-
- *bundleAdded
10731059
params:
10741060
- name: pipeline_image
10751061
value: "$(params.pipeline_image)"
@@ -1215,9 +1201,7 @@ spec:
12151201
- name: upload-pipeline-logs
12161202
taskRef:
12171203
name: upload-pipeline-logs
1218-
when:
1219-
- *certProjectExists
1220-
- *bundleAdded
1204+
when: *certProjectExists
12211205
params:
12221206
- name: pipeline_image
12231207
value: "$(params.pipeline_image)"
@@ -1281,8 +1265,7 @@ spec:
12811265
- name: github-add-connect-url-comment
12821266
taskRef:
12831267
name: github-add-comment
1284-
when:
1285-
- *certProjectExists
1268+
when: *certProjectExists
12861269
params:
12871270
- name: pipeline_image
12881271
value: "$(params.pipeline_image)"

ansible/roles/operator-pipeline/templates/openshift/pipelines/operator-release-pipeline.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ spec:
237237
- name: content-hash
238238
runAfter:
239239
- read-config
240-
when:
241-
- &bundleAdded
242-
input: "$(tasks.detect-changes.results.added_bundle)"
243-
operator: notin
244-
values: [""]
245240
taskRef:
246241
name: content-hash
247242
params:
@@ -263,8 +258,8 @@ spec:
263258
params:
264259
- name: pipeline_image
265260
value: "$(params.pipeline_image)"
266-
- name: operator_path
267-
value: "$(tasks.detect-changes.results.operator_path)"
261+
- name: bundle_path
262+
value: "$(tasks.detect-changes.results.bundle_path)"
268263
- name: cert_project_required
269264
value: "$(params.cert_project_required)"
270265
workspaces:
@@ -346,9 +341,8 @@ spec:
346341
- copy-bundle-image-to-released-registry
347342
taskRef:
348343
name: publish-pyxis-data
349-
when:
350-
- &certProjectExists
351-
input: "$(tasks.certification-project-check.results.certification_project_id)"
344+
when: &certProjectExists
345+
- input: "$(tasks.certification-project-check.results.certification_project_id)"
352346
operator: "notin"
353347
values: [""]
354348
- input: "$(tasks.detect-changes.results.added_bundle)"
@@ -678,9 +672,7 @@ spec:
678672
- name: upload-pipeline-logs
679673
taskRef:
680674
name: upload-pipeline-logs
681-
when:
682-
- *certProjectExists
683-
- *bundleAdded
675+
when: *certProjectExists
684676
params:
685677
- name: pipeline_image
686678
value: "$(params.pipeline_image)"

ansible/roles/operator-pipeline/templates/openshift/tasks/cert-project-check.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ metadata:
66
spec:
77
params:
88
- name: pipeline_image
9-
- name: operator_path
10-
description: path indicating the location of the certified operator within the repository
9+
- name: bundle_path
10+
description: path indicating the location of the certified bundle within the repository
1111
- name: cert_project_required
1212
description: A flag determines whether a cert project ID needs to be present
1313
default: "true"
@@ -31,7 +31,9 @@ spec:
3131
exit 0
3232
fi
3333
34-
CI_FILE_PATH="$(params.operator_path)/ci.yaml"
34+
PKG_PATH=$(dirname $(realpath $(params.bundle_path)))
35+
36+
CI_FILE_PATH="$PKG_PATH/ci.yaml"
3537
3638
CERT_PROJECT_ID=$(cat $CI_FILE_PATH | yq -r '.cert_project_id | select (.!=null)')
3739

0 commit comments

Comments
 (0)