Skip to content

Commit ebfc47a

Browse files
Leverage the dockerhub account for skopeo if set (#30)
* Leverage the dockerhub account if they are set in env skopeo directly pulls from docker.io which easily reaches the anon pull rate limit. Please see shared_database and observability failing because of skopeo (whatever the use of private mirror or mirror.gcr.io): https://github.com/cnti-testcatalog/testsuite/actions/runs/12674901774/job/35470396257?pr=2203 https://github.com/cnti-testcatalog/testsuite/actions/runs/12674901774/job/35470398665?pr=2203 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> Co-authored-by: Martin Matyas <martin.matyas@tietoevry.com>
1 parent 3f350cc commit ebfc47a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cluster_tools.cr

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,14 @@ module ClusterTools
249249
def self.official_content_digest_by_image_name(image_name)
250250
Log.info { "official_content_digest_by_image_name: #{image_name}"}
251251

252-
result = exec("skopeo inspect docker://#{image_name}")
252+
if ENV["DOCKERHUB_USERNAME"]? && ENV["DOCKERHUB_PASSWORD"]?
253+
Log.info { "Using USERNAME and PASSWORD for accessing the registry via skopeo" }
254+
registry_creds = "--creds #{ENV["DOCKERHUB_USERNAME"]}:#{ENV["DOCKERHUB_PASSWORD"]}"
255+
else
256+
Log.info { "Access the registry anonymously via skopeo" }
257+
registry_creds = ""
258+
end
259+
result = exec("skopeo inspect #{registry_creds} docker://#{image_name}")
253260
response = result[:output]
254261
if result[:status].success? && !response.empty?
255262
return JSON.parse(response)

0 commit comments

Comments
 (0)