docker_registry2 1.16.0 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf700e5c43bdbd9216827748cc2010b4f4a2ab6fc83615478589e24200a17e80
4
- data.tar.gz: 10dc661ce6689a5a4009d64483c4e26c78bb8dae08412058e4a565cc79169c59
3
+ metadata.gz: 396635930a86cd9f517fe62ec5d697162800ceed5da3209b56c9951529c48acd
4
+ data.tar.gz: aa924fcb85dedc352020b686ecae75d2b755ee1d4d87ab4cc7f27991a0a3e84b
5
5
  SHA512:
6
- metadata.gz: e2f999e780c186e6e19c23698984f2897ddda4e312641cbea94fb1f6e873053c14a55b7fe6422508537eb6e9c3eb023086030156a3ec2214a828f886e956ddba
7
- data.tar.gz: 33166c81576a0f368ce6326c1d62726524e8143eeb9e9c579433efa172e87dea00f2a469359ff87238750b7595af7508798c090dcfd68a1d0e5c02192ed134db
6
+ metadata.gz: 2dfbaa1a8e21b917363855a5f31c57dbd08517d0f58fc1faf43520d6e321074d4b6083246ee3863a4e6a886d5f5dc9ba239eeef7deda747536db69a77f08a480
7
+ data.tar.gz: 6b034ef24e2f306d8a4a5047e03a101307c55698e0ce3295eefc15481abbc64034b07bc61b5c0651aad41bd03f2a6920f0cf98b81c733c845353d1e784db8aad
@@ -22,4 +22,8 @@ module DockerRegistry2
22
22
  def self.manifest(repository, tag)
23
23
  @reg.manifest(repository, tag)
24
24
  end
25
+
26
+ def self.manifest_digest(repository, tag)
27
+ @reg.manifest_digest(repository, tag)
28
+ end
25
29
  end
@@ -126,6 +126,14 @@ module DockerRegistry2
126
126
  end
127
127
  end
128
128
 
129
+ def manifest_digest(repo, tag)
130
+ tag_path = "/v2/#{repo}/manifests/#{tag}"
131
+ dohead(tag_path).headers[:docker_content_digest]
132
+ rescue DockerRegistry2::InvalidMethod
133
+ # Pre-2.3.0 registries didn't support manifest HEAD requests
134
+ doget(tag_path).headers[:docker_content_digest]
135
+ end
136
+
129
137
  def digest(image, tag, architecture = nil, os = nil, variant = nil)
130
138
  manifest = manifest(image, tag)
131
139
  parsed_manifest = JSON.parse(manifest.body)
@@ -252,7 +260,7 @@ module DockerRegistry2
252
260
  links = parse_link_header(header)
253
261
  if links[:next]
254
262
  query = URI(links[:next]).query
255
- link_key = @uri.host.eql?('quay.io') ? 'next_page' : 'last'
263
+ link_key = @uri.host.eql?('quay.io') || @uri.host.eql?('registry.access.redhat.com') ? 'next_page' : 'last'
256
264
  last = URI.decode_www_form(query).to_h[link_key]
257
265
 
258
266
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DockerRegistry2
4
- VERSION = '1.16.0'
4
+ VERSION = '1.18.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_registry2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avi Deitcher https://github.com/deitch
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-06-06 00:00:00.000000000 Z
14
+ date: 2023-07-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler