kubeclient 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of kubeclient might be problematic. Click here for more details.

Files changed (39) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +11 -1
  3. data/README.md +18 -0
  4. data/RELEASING.md +40 -40
  5. data/lib/kubeclient/common.rb +57 -22
  6. data/lib/kubeclient/entity_list.rb +7 -2
  7. data/lib/kubeclient/version.rb +1 -1
  8. data/test/config/allinone.kubeconfig +3 -3
  9. data/test/config/external-ca.pem +14 -14
  10. data/test/config/external-cert.pem +17 -17
  11. data/test/config/external-key.rsa +25 -25
  12. data/test/json/config.istio.io_api_resource_list.json +679 -0
  13. data/test/json/created_security_context_constraint.json +65 -0
  14. data/test/json/pods_1.json +265 -0
  15. data/test/json/pods_2.json +102 -0
  16. data/test/json/pods_410.json +9 -0
  17. data/test/json/security.openshift.io_api_resource_list.json +69 -0
  18. data/test/json/security_context_constraint_list.json +375 -0
  19. data/test/test_common.rb +21 -2
  20. data/test/test_component_status.rb +1 -2
  21. data/test/test_config.rb +4 -4
  22. data/test/test_endpoint.rb +27 -8
  23. data/test/test_helper.rb +5 -0
  24. data/test/test_kubeclient.rb +4 -9
  25. data/test/test_limit_range.rb +1 -3
  26. data/test/test_missing_methods.rb +30 -4
  27. data/test/test_namespace.rb +3 -6
  28. data/test/test_node.rb +2 -4
  29. data/test/test_persistent_volume.rb +1 -2
  30. data/test/test_persistent_volume_claim.rb +1 -3
  31. data/test/test_pod.rb +54 -2
  32. data/test/test_replication_controller.rb +2 -7
  33. data/test/test_resource_quota.rb +1 -3
  34. data/test/test_secret.rb +3 -12
  35. data/test/test_security_context_constraint.rb +62 -0
  36. data/test/test_service.rb +10 -31
  37. data/test/test_service_account.rb +1 -3
  38. data/test/test_watch.rb +7 -16
  39. metadata +19 -3
@@ -3,12 +3,10 @@ require_relative 'test_helper'
3
3
  # ServiceAccount tests
4
4
  class TestServiceAccount < MiniTest::Test
5
5
  def test_get_from_json_v1
6
+ stub_core_api_list
6
7
  stub_request(:get, %r{/serviceaccounts})
7
8
  .to_return(body: open_test_file('service_account.json'),
8
9
  status: 200)
9
- stub_request(:get, %r{/api/v1$})
10
- .to_return(body: open_test_file('core_api_resource_list.json'),
11
- status: 200)
12
10
 
13
11
  client = Kubeclient::Client.new('http://localhost:8080/api/', 'v1')
14
12
  account = client.get_service_account('default')
@@ -3,7 +3,7 @@ require_relative 'test_helper'
3
3
  # Watch entity tests
4
4
  class TestWatch < MiniTest::Test
5
5
  def test_watch_pod_success
6
- stub_resource_list
6
+ stub_core_api_list
7
7
 
8
8
  expected = [
9
9
  { 'type' => 'ADDED', 'resourceVersion' => '1389' },
@@ -28,7 +28,7 @@ class TestWatch < MiniTest::Test
28
28
  end
29
29
 
30
30
  def test_watch_pod_raw
31
- stub_resource_list
31
+ stub_core_api_list
32
32
 
33
33
  stub_request(:get, %r{/watch/pods}).to_return(
34
34
  body: open_test_file('watch_stream.json'),
@@ -43,7 +43,7 @@ class TestWatch < MiniTest::Test
43
43
  end
44
44
 
45
45
  def test_watch_pod_failure
46
- stub_resource_list
46
+ stub_core_api_list
47
47
  stub_request(:get, %r{/watch/pods}).to_return(status: 404)
48
48
 
49
49
  client = Kubeclient::Client.new('http://localhost:8080/api/', 'v1')
@@ -72,7 +72,7 @@ class TestWatch < MiniTest::Test
72
72
  def test_watch_with_resource_version
73
73
  api_host = 'http://localhost:8080/api'
74
74
  version = '1995'
75
- stub_resource_list
75
+ stub_core_api_list
76
76
  stub_request(:get, %r{.*\/watch/events})
77
77
  .to_return(body: open_test_file('watch_stream.json'),
78
78
  status: 200)
@@ -90,7 +90,7 @@ class TestWatch < MiniTest::Test
90
90
  api_host = 'http://localhost:8080/api'
91
91
  selector = 'name=redis-master'
92
92
 
93
- stub_resource_list
93
+ stub_core_api_list
94
94
  stub_request(:get, %r{.*\/watch/events})
95
95
  .to_return(body: open_test_file('watch_stream.json'),
96
96
  status: 200)
@@ -108,7 +108,7 @@ class TestWatch < MiniTest::Test
108
108
  api_host = 'http://localhost:8080/api'
109
109
  selector = 'involvedObject.kind=Pod'
110
110
 
111
- stub_resource_list
111
+ stub_core_api_list
112
112
  stub_request(:get, %r{.*\/watch/events})
113
113
  .to_return(body: open_test_file('watch_stream.json'),
114
114
  status: 200)
@@ -125,7 +125,7 @@ class TestWatch < MiniTest::Test
125
125
  def test_watch_with_finish_and_ebadf
126
126
  api_host = 'http://localhost:8080/api'
127
127
 
128
- stub_resource_list
128
+ stub_core_api_list
129
129
  stub_request(:get, %r{.*\/watch/events})
130
130
  .to_return(body: open_test_file('watch_stream.json'), status: 200)
131
131
 
@@ -140,13 +140,4 @@ class TestWatch < MiniTest::Test
140
140
 
141
141
  assert_requested(:get, "#{api_host}/v1/watch/events", times: 1)
142
142
  end
143
-
144
- private
145
-
146
- def stub_resource_list
147
- stub_request(:get, %r{/api/v1$}).to_return(
148
- body: open_test_file('core_api_resource_list.json'),
149
- status: 200
150
- )
151
- end
152
143
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubeclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alissa Bonas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-23 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -210,6 +210,7 @@ files:
210
210
  - test/json/bindings_list.json
211
211
  - test/json/component_status.json
212
212
  - test/json/component_status_list.json
213
+ - test/json/config.istio.io_api_resource_list.json
213
214
  - test/json/config_map_list.json
214
215
  - test/json/core_api_resource_list.json
215
216
  - test/json/core_api_resource_list_without_kind.json
@@ -217,6 +218,7 @@ files:
217
218
  - test/json/created_endpoint.json
218
219
  - test/json/created_namespace.json
219
220
  - test/json/created_secret.json
221
+ - test/json/created_security_context_constraint.json
220
222
  - test/json/created_service.json
221
223
  - test/json/empty_pod_list.json
222
224
  - test/json/endpoint_list.json
@@ -238,12 +240,17 @@ files:
238
240
  - test/json/pod.json
239
241
  - test/json/pod_list.json
240
242
  - test/json/pod_template_list.json
243
+ - test/json/pods_1.json
244
+ - test/json/pods_2.json
245
+ - test/json/pods_410.json
241
246
  - test/json/processed_template.json
242
247
  - test/json/replication_controller.json
243
248
  - test/json/replication_controller_list.json
244
249
  - test/json/resource_quota.json
245
250
  - test/json/resource_quota_list.json
246
251
  - test/json/secret_list.json
252
+ - test/json/security.openshift.io_api_resource_list.json
253
+ - test/json/security_context_constraint_list.json
247
254
  - test/json/service.json
248
255
  - test/json/service_account.json
249
256
  - test/json/service_account_list.json
@@ -274,6 +281,7 @@ files:
274
281
  - test/test_resource_list_without_kind.rb
275
282
  - test/test_resource_quota.rb
276
283
  - test/test_secret.rb
284
+ - test/test_security_context_constraint.rb
277
285
  - test/test_service.rb
278
286
  - test/test_service_account.rb
279
287
  - test/test_watch.rb
@@ -299,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
307
  version: '0'
300
308
  requirements: []
301
309
  rubyforge_project:
302
- rubygems_version: 2.6.11
310
+ rubygems_version: 2.7.6
303
311
  signing_key:
304
312
  specification_version: 4
305
313
  summary: A client for Kubernetes REST api
@@ -316,6 +324,7 @@ test_files:
316
324
  - test/json/bindings_list.json
317
325
  - test/json/component_status.json
318
326
  - test/json/component_status_list.json
327
+ - test/json/config.istio.io_api_resource_list.json
319
328
  - test/json/config_map_list.json
320
329
  - test/json/core_api_resource_list.json
321
330
  - test/json/core_api_resource_list_without_kind.json
@@ -323,6 +332,7 @@ test_files:
323
332
  - test/json/created_endpoint.json
324
333
  - test/json/created_namespace.json
325
334
  - test/json/created_secret.json
335
+ - test/json/created_security_context_constraint.json
326
336
  - test/json/created_service.json
327
337
  - test/json/empty_pod_list.json
328
338
  - test/json/endpoint_list.json
@@ -344,12 +354,17 @@ test_files:
344
354
  - test/json/pod.json
345
355
  - test/json/pod_list.json
346
356
  - test/json/pod_template_list.json
357
+ - test/json/pods_1.json
358
+ - test/json/pods_2.json
359
+ - test/json/pods_410.json
347
360
  - test/json/processed_template.json
348
361
  - test/json/replication_controller.json
349
362
  - test/json/replication_controller_list.json
350
363
  - test/json/resource_quota.json
351
364
  - test/json/resource_quota_list.json
352
365
  - test/json/secret_list.json
366
+ - test/json/security.openshift.io_api_resource_list.json
367
+ - test/json/security_context_constraint_list.json
353
368
  - test/json/service.json
354
369
  - test/json/service_account.json
355
370
  - test/json/service_account_list.json
@@ -380,6 +395,7 @@ test_files:
380
395
  - test/test_resource_list_without_kind.rb
381
396
  - test/test_resource_quota.rb
382
397
  - test/test_secret.rb
398
+ - test/test_security_context_constraint.rb
383
399
  - test/test_service.rb
384
400
  - test/test_service_account.rb
385
401
  - test/test_watch.rb