Skip to content

Commit a2294e1

Browse files
committed
export clair vulnerability data on tarball build
1 parent bd62cce commit a2294e1

2 files changed

Lines changed: 12 additions & 17 deletions

File tree

.github/workflows/build-push-tarball.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ jobs:
3939
run: |
4040
echo -n "${{ steps.meta.outputs.tag }}" > .version
4141
42+
- name: Export Clair vulnerability data
43+
# if: github.event_name != 'pull_request'
44+
run: |
45+
curl -L -o /tmp/clairctl https://github.com/quay/clair/releases/download/v4.9.0/clairctl-linux-amd64 && chmod +x /tmp/clairctl
46+
/tmp/clairctl --config ./data/clair/minimal_config.yaml export-updaters --strict ./data/clair/updates.json.gz
47+
4248
- name: Install ORAS
4349
uses: oras-project/setup-oras@v1
4450
with:

operators/quay-operator/clair_disconnected.yaml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,13 @@
1717
state: directory
1818
mode: '0777'
1919

20-
- name: Create minimal Clair config for export
21-
ansible.builtin.copy:
22-
dest: "{{ workingDir }}/data/clair/config.yaml"
23-
content: |
24-
http_listen_addr: :8080
25-
introspection_addr: :8081
26-
indexer:
27-
connstring: ""
28-
scanlock_retry: 10
29-
layer_scan_concurrency: 5
30-
matcher:
31-
connstring: ""
32-
max_conn_pool: 100
33-
notifier:
34-
connstring: ""
35-
delivery_interval: 1m
20+
- name: Check if Clair updates file exists
21+
ansible.builtin.stat:
22+
path: "{{ workingDir }}/data/clair/updates.json.gz"
23+
register: clair_updates_stat_file
3624

3725
- name: Export vulnerability data on Landing Zone
26+
when: not clair_updates_stat_file.stat.exists
3827
containers.podman.podman_container:
3928
name: clair-exporter
4029
image: "{{ clair_pod.spec.containers[0].image | regex_replace('^registry\\.redhat\\.io', quayHostname + ':8443') }}"
@@ -44,7 +33,7 @@
4433
volumes:
4534
- "{{ workingDir }}/data/clair:/data:Z"
4635
entrypoint: "/usr/bin/clairctl"
47-
command: "--config /data/config.yaml export-updaters /data/updates.json.gz"
36+
command: "--config /data/minimal_config.yaml export-updaters --strict /data/updates.json.gz"
4837
detach: false
4938

5039
- name: Ensure directory /var/www/html/clair/

0 commit comments

Comments
 (0)