|
1 | 1 | #!/usr/bin/python |
2 | 2 |
|
3 | | -# Copyright Red Hat, Inc. |
4 | | -# All Rights Reserved. |
5 | | -# |
6 | | -# Licensed under the Apache License, Version 2.0 (the "License"); you may |
7 | | -# not use this file except in compliance with the License. You may obtain |
8 | | -# a copy of the License at |
9 | | -# |
10 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
11 | | -# |
12 | | -# Unless required by applicable law or agreed to in writing, software |
13 | | -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
14 | | -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
15 | | -# License for the specific language governing permissions and limitations |
16 | | -# under the License. |
| 3 | +# Copyright: (c) 2026, Nemanja Marjanovic <nemarjan@redhat.com> |
| 4 | +# Apache License Version 2.0 (see LICENSE) |
17 | 5 |
|
18 | 6 | from __future__ import absolute_import, division, print_function |
19 | 7 |
|
|
27 | 15 |
|
28 | 16 | description: |
29 | 17 | - Reads the YAML produced by the env_op_images pulled-images report role task. |
30 | | - - Parses CRI-O journal lines for C(msg="Pulled image: ...@sha256:..."). |
| 18 | + - "Parses CRI-O journal lines for C(msg=\"Pulled image: ...@sha256:...\")." |
31 | 19 | - Adds per-row verification fields using trusted mirror domains from |
32 | 20 | C(summary.mirror_rules). |
33 | 21 |
|
|
60 | 48 | type: str |
61 | 49 |
|
62 | 50 | author: |
63 | | - - Red Hat |
| 51 | + - "Nemanja Marjanovic (@nemarjan)" |
64 | 52 |
|
65 | 53 | notes: |
66 | 54 | - Requires PyYAML on the controller (same as other cifmw.general modules). |
|
78 | 66 | changed: |
79 | 67 | description: Whether the output file was written. |
80 | 68 | type: bool |
| 69 | + returned: always |
81 | 70 | trusted_mirrors: |
82 | 71 | description: Hostnames extracted from mirror rules in the report summary. |
83 | 72 | type: list |
84 | 73 | elements: str |
| 74 | + returned: always |
85 | 75 | log_files: |
86 | 76 | description: Number of log files read. |
87 | 77 | type: int |
| 78 | + returned: always |
88 | 79 | entries_with_digest: |
89 | 80 | description: Image rows that had a sha256 digest in C(image_id). |
90 | 81 | type: int |
| 82 | + returned: always |
91 | 83 | """ |
92 | 84 |
|
93 | 85 | import glob |
@@ -186,7 +178,9 @@ def run_module(): |
186 | 178 | actual_uri = log_evidence[img_sha] |
187 | 179 | actual_domain = actual_uri.split("/")[0].strip() |
188 | 180 | is_mirror_domain = actual_domain in trusted_mirrors |
189 | | - img["node_verified_image_origin"] = "mirror" if is_mirror_domain else "source" |
| 181 | + img["node_verified_image_origin"] = ( |
| 182 | + "mirror" if is_mirror_domain else "source" |
| 183 | + ) |
190 | 184 | img["log_evidence_uri"] = actual_uri |
191 | 185 | expected_domain = img.get("expected_pull_location") or "" |
192 | 186 | img["verification_status"] = ( |
|
0 commit comments