Skip to content

Commit 4c6f67e

Browse files
Adapt api requests to new manifest-based schema
1 parent bf40887 commit 4c6f67e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

lib/quayio/scanner/repository.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ module Scanner
66
Repository = Struct.new(:quayio_token, :org, :repo, :tag) do
77
MAX_ATTEMPTS = 5
88

9-
def id
10-
@id ||= fetch_id
11-
end
12-
139
def scan
14-
api_call("/image/#{id}/security?vulnerabilities=true")
10+
api_call("/manifest/#{manifest_ref}/security?vulnerabilities=true")
1511
end
1612

1713
private
1814

19-
def fetch_id
20-
result = api_call("/tag/#{tag}/images")
21-
(result['images'].first)['id']
15+
def manifest_ref
16+
@manifest_ref ||= fetch_manifest_ref
17+
end
18+
19+
def fetch_manifest_ref
20+
result = api_call("/tag/?specificTag=#{tag}&onlyActiveTags=1")
21+
(result['tags'].first)['manifest_digest']
2222
end
2323

2424
def api_call(uri)

0 commit comments

Comments
 (0)