Skip to content

Commit

Permalink
Merge pull request #39 from yftacherzog/RHTAPWATCH-694-remove-spec-fr…
Browse files Browse the repository at this point in the history
…om-snapshot

fix(RHTAPWATCH-694): snapshot should not have spec field
  • Loading branch information
yftacherzog authored Dec 31, 2023
2 parents 3e4b003 + de5167f commit 6eea7e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
26 changes: 12 additions & 14 deletions tests/test_rpm_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,18 @@ def test_get_unsigned_rpms(test_input: list[str], expected: list[str]) -> None:
dedent(
"""
{
"spec": {
"application": "test",
"components": [
{
"containerImage": "quay.io/container-image@sha256:123"
},
{
"containerImage": "quay.io/container-image@sha256:456"
},
{
"containerImage": "quay.io/container-image@sha256:789"
}
]
}
"application": "test",
"components": [
{
"containerImage": "quay.io/container-image@sha256:123"
},
{
"containerImage": "quay.io/container-image@sha256:456"
},
{
"containerImage": "quay.io/container-image@sha256:789"
}
]
}
"""
).strip(),
Expand Down
4 changes: 1 addition & 3 deletions verify_rpms/rpm_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ def parse_image_input(image_input: str) -> list[str]:
snapshot = loads(s=image_input)
except JSONDecodeError:
return [image_input]
components = snapshot["spec"]["components"]
container_images = [component["containerImage"] for component in components]
return container_images
return [component["containerImage"] for component in snapshot["components"]]


@dataclass(frozen=True)
Expand Down

0 comments on commit 6eea7e0

Please sign in to comment.