Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve vulnerability status with Pyxis API #263

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ansible-collection-redhatci-ocp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Name: %{repo}
Version: 0.15.EPOCH

Release: VERS%{?dist}
Summary: Red Hat OCP CI Collection for Ansible

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,29 @@
{% if cert_project_id | default('') | length and preflight_dci_all_components_are_ga | default(True) %}
--submit
{% endif %}

- name: Get image digest
ansible.builtin.shell: >
set -eo pipefail;
skopeo inspect
{% if partner_creds | length %}
--authfile {{ partner_creds }}
{% else %}
--no-creds
{% endif %}
docker://{{ current_operator_image }} | jq -r '.Digest'
register: sha

- name: Use Pyxis API to check image vulnerability status
vars:
filter_params: "filter=image_id%3D%3D{{ sha.stdout }}"
ansible.builtin.uri:
url: >
{{ catalog_url }}/images?{{ filter_params }}&page_size=1&page=0
method: GET
status_code: 200
timeout: 120
register: vulnerability_status
rescue:
- name: Do not fail when preflight check container throws an error
ansible.builtin.debug:
Expand Down
Loading