Skip to content

Commit

Permalink
Merge pull request #55 from nmars/cvp-1320
Browse files Browse the repository at this point in the history
[CVP-1320] Add check for mediatype.v1 label
  • Loading branch information
nmars authored Oct 9, 2020
2 parents c886c57 + 2a47e82 commit 83bd6a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/parse_operator_bundle/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ required_labels:
valid_ocp_versions:
- "v4.5"
- "v4.6"
label_mediatype_v1_expected_value: 'registry+v1'
6 changes: 6 additions & 0 deletions roles/parse_operator_bundle/tasks/bundle_sanity_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
when:
- annotations_vars.annotations['operators.operatorframework.io.bundle.mediatype.v1'] != skopeo_inspect_json.Labels['operators.operatorframework.io.bundle.mediatype.v1']

- name: "Check if the operators.operatorframework.io.bundle.mediatype.v1 is set to the expected value"
fail:
msg: "The operators.operatorframework.io.bundle.mediatype.v1 value doesn't match the expected value \"{{ label_mediatype_v1_expected_value }}\""
when:
- annotations_vars.annotations['operators.operatorframework.io.bundle.mediatype.v1'] != label_mediatype_v1_expected_value

- name: "Check if the operators.operatorframework.io.bundle.metadata.v1 from annotation.yaml matches the bundle image label"
fail:
msg: "The operators.operatorframework.io.bundle.metadata.v1 value in the annotations yaml doesn't match the corresponding bundle image label!!"
Expand Down

0 comments on commit 83bd6a2

Please sign in to comment.