docker_registry2 1.7.1 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/docker_registry2.rb +1 -0
- data/lib/registry/manifest.rb +9 -0
- data/lib/registry/registry.rb +6 -1
- data/lib/registry/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19ca637dbdf39b4614e28d2650e79da21fe23ad0996abcde2a4d93b4df6c8eb1
|
4
|
+
data.tar.gz: 9ab57fce26b7b7f1d61e00c6c4fa3b141dcdecaeb1d3a1918f3476542d29a8c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 772e70eb519763985de74098cee52c7cd7a252516dacf2e9da0f6ecfdec2e8cdcc822a80548577de15b7d73ba0bdc8edff1b9fed6a24c97c71178928840d5966
|
7
|
+
data.tar.gz: 1d92a8c1c4994440cd3884592627b537f9ddcaa0836329f1bad4262561896b9b9f67b9dcb33a5ede29bf172e0281b6a694d4575a503820ac62cb557160e1c3f1
|
data/README.md
CHANGED
@@ -222,13 +222,13 @@ Repeat until you have all of the results. The last one has no more pagination, a
|
|
222
222
|
|
223
223
|
|
224
224
|
#### manifest
|
225
|
+
|
225
226
|
````ruby
|
226
227
|
manifest = reg.manifest("namespace/repo","2.5.6")
|
227
228
|
````
|
228
229
|
|
229
230
|
Returns the manifest for the given tag of the given repository. For the format and syntax of the manifest, see the [registry API](https://github.com/docker/distribution/blob/master/docs/spec/api.md) and the [manifest issue](https://github.com/docker/docker/issues/8093).
|
230
231
|
|
231
|
-
|
232
232
|
If the given repository and/or tag is not found, return an empty object `{}`.
|
233
233
|
|
234
234
|
The following exceptions are thrown:
|
@@ -236,6 +236,13 @@ The following exceptions are thrown:
|
|
236
236
|
* `RegistryAuthenticationException`: username and password are invalid
|
237
237
|
* `RegistryAuthorizationException`: registry does not support tags using the given credentials, probably because the repository is private and the credentials provided do not have access
|
238
238
|
|
239
|
+
The manifest, of course, is requested via http `GET`. While the returned manifest is an object parsed from the JSON of the manifest _body_, sometimes the http _headers_ are valuable as well. Thus the returned manifest object has a method `headers`, which returns the http headers from the request.
|
240
|
+
|
241
|
+
```ruby
|
242
|
+
manifest = reg.manifest("namespace/repo","2.5.6")
|
243
|
+
manifest.headers
|
244
|
+
```
|
245
|
+
|
239
246
|
#### digest
|
240
247
|
````ruby
|
241
248
|
digest = reg.digest("namespace/repo", "2.5.6")
|
data/lib/docker_registry2.rb
CHANGED
data/lib/registry/registry.rb
CHANGED
@@ -99,7 +99,12 @@ class DockerRegistry2::Registry
|
|
99
99
|
|
100
100
|
def manifest(repo,tag)
|
101
101
|
# first get the manifest
|
102
|
-
|
102
|
+
response = doget "/v2/#{repo}/manifests/#{tag}"
|
103
|
+
parsed = JSON.parse response.body
|
104
|
+
manifest = DockerRegistry2::Manifest[parsed]
|
105
|
+
manifest.body = response.body
|
106
|
+
manifest.headers = response.headers
|
107
|
+
manifest
|
103
108
|
end
|
104
109
|
|
105
110
|
def digest(repo, tag)
|
data/lib/registry/version.rb
CHANGED
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.
|
4
|
+
version: 1.8.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: 2019-
|
14
|
+
date: 2019-08-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- docker_registry2.gemspec
|
80
80
|
- lib/docker_registry2.rb
|
81
81
|
- lib/registry/exceptions.rb
|
82
|
+
- lib/registry/manifest.rb
|
82
83
|
- lib/registry/registry.rb
|
83
84
|
- lib/registry/version.rb
|
84
85
|
homepage: https://github.com/deitch/docker_registry2
|