kubeclient 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kubeclient might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/kubeclient/common.rb +2 -1
- data/lib/kubeclient/version.rb +1 -1
- data/test/json/persistent_volume_claims_nil_items.json +8 -0
- data/test/test_kubeclient.rb +10 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc027533b4e27f508e12ec413cdc2420b603fc8f
|
4
|
+
data.tar.gz: 74910f2c54e639a68887506ca30ce1e9e6407e8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee8961274aa7457480c86cf1ecb88aba0a1000bc589d6cf62a0cd68cc99f9dc5db6ba0b69e41b216f82c6af3e9ab257a47df2d3562e941bf1aaa3933c62304e
|
7
|
+
data.tar.gz: 3faa680ba20a338d1bb58ae7ec144d3f895bbc5525cd0cb056aebb7f200b4fb443412f3395d8dfc07c02c6435726746e9d6ab291f64f301c38e79d6dad6cabe3
|
data/lib/kubeclient/common.rb
CHANGED
@@ -172,7 +172,8 @@ module Kubeclient
|
|
172
172
|
result.fetch('metadata', {}).fetch('resourceVersion', nil)
|
173
173
|
end
|
174
174
|
|
175
|
-
|
175
|
+
# result['items'] might be nil due to https://github.com/kubernetes/kubernetes/issues/13096
|
176
|
+
collection = result['items'].to_a.map { |item| new_entity(item, klass) }
|
176
177
|
|
177
178
|
Kubeclient::Common::EntityList.new(entity_type, resource_version, collection)
|
178
179
|
end
|
data/lib/kubeclient/version.rb
CHANGED
data/test/test_kubeclient.rb
CHANGED
@@ -491,6 +491,16 @@ class KubeClientTest < MiniTest::Test
|
|
491
491
|
assert_equal 'Bearer token', client.headers[:Authorization]
|
492
492
|
end
|
493
493
|
|
494
|
+
def test_nil_items
|
495
|
+
# handle https://github.com/kubernetes/kubernetes/issues/13096
|
496
|
+
stub_request(:get, %r{/persistentvolumeclaims})
|
497
|
+
.to_return(body: open_test_json_file('persistent_volume_claims_nil_items.json'),
|
498
|
+
status: 200)
|
499
|
+
|
500
|
+
client = Kubeclient::Client.new 'http://localhost:8080/api/', 'v1'
|
501
|
+
client.get_persistent_volume_claims
|
502
|
+
end
|
503
|
+
|
494
504
|
private
|
495
505
|
|
496
506
|
# dup method creates a shallow copy which is not good in this case
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubeclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alissa Bonas
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- test/json/persistent_volume.json
|
176
176
|
- test/json/persistent_volume_claim.json
|
177
177
|
- test/json/persistent_volume_claim_list.json
|
178
|
+
- test/json/persistent_volume_claims_nil_items.json
|
178
179
|
- test/json/persistent_volume_list.json
|
179
180
|
- test/json/pod_b3.json
|
180
181
|
- test/json/pod_list_b3.json
|
@@ -245,6 +246,7 @@ test_files:
|
|
245
246
|
- test/json/persistent_volume.json
|
246
247
|
- test/json/persistent_volume_claim.json
|
247
248
|
- test/json/persistent_volume_claim_list.json
|
249
|
+
- test/json/persistent_volume_claims_nil_items.json
|
248
250
|
- test/json/persistent_volume_list.json
|
249
251
|
- test/json/pod_b3.json
|
250
252
|
- test/json/pod_list_b3.json
|