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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84f24ef09e48aade18e1be3bf794cc1b207a9bb0
4
- data.tar.gz: cead2099decd0352e11904a082cc6b2130e2d053
3
+ metadata.gz: cc027533b4e27f508e12ec413cdc2420b603fc8f
4
+ data.tar.gz: 74910f2c54e639a68887506ca30ce1e9e6407e8a
5
5
  SHA512:
6
- metadata.gz: 47ebfefbac872d301808cec92cd9a0869677844ba693269453150280e4155eee03560ede2e569c3c866a17f4f1293739e586b8653e9926ec981e4d0ec3dc80a4
7
- data.tar.gz: d47f3d587234753a1e47c63807364221a9980f4f960b2ccd84486266dc770a5fe0e9d6dd7b127c6b7e6959a6b096af6b62e20c303a2f19a277b5c290f3c2eaac
6
+ metadata.gz: 4ee8961274aa7457480c86cf1ecb88aba0a1000bc589d6cf62a0cd68cc99f9dc5db6ba0b69e41b216f82c6af3e9ab257a47df2d3562e941bf1aaa3933c62304e
7
+ data.tar.gz: 3faa680ba20a338d1bb58ae7ec144d3f895bbc5525cd0cb056aebb7f200b4fb443412f3395d8dfc07c02c6435726746e9d6ab291f64f301c38e79d6dad6cabe3
@@ -172,7 +172,8 @@ module Kubeclient
172
172
  result.fetch('metadata', {}).fetch('resourceVersion', nil)
173
173
  end
174
174
 
175
- collection = result['items'].map { |item| new_entity(item, klass) }
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
@@ -1,4 +1,4 @@
1
1
  # Kubernetes REST-API Client
2
2
  module Kubeclient
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "kind": "PersistentVolumeClaimList",
3
+ "apiVersion": "v1beta3",
4
+ "metadata": {
5
+ "selfLink": "/api/v1beta3/persistentvolumeclaims",
6
+ "resourceVersion": "1089012"
7
+ }
8
+ }
@@ -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.0
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